前言介紹
- 這款 WordPress 外掛「GetGit」是 2013-03-10 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2013-03-19,距離現在已有 4429 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.5.1 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
code | embed | Github | snippet | repositories |
內容簡介
此外掛會將公開 GitHub 存儲庫的內容嵌入到 WordPress 文章中。它可以擷取文件的完整內容或片段。程式碼會顯示語法突出顯示和行號。
現在支援內容快取,以提高頁面反應速度和載入速度。
語法突出顯示是由 Sunlight JS 語法突出顯示器提供的。非常感謝參與該項目的人員!
使用说明
此外掛註冊了一個 shortcode,允許將 GitHub 存儲庫內容嵌入到博客文章中。要將內容嵌入到文章中,請使用如下所示的 github shortcode:
[github userid="[目標使用者 ID]" repoid="[目標存儲庫 ID]" path="[內容的路徑]" language="[目標內容的語言]"]
github shortcode 使用的屬性:
userid – 存儲庫所有者的使用者 ID。
repoid – 包含目標內容的存儲庫的 ID。
path – 內容的完整路徑。此路徑應該從存儲庫根目錄開始,不包括領先的 /,並以目標內容的檔名結束。
language – 內容中包含的程式碼的程式語言。此資訊將傳遞給語法突出顯示器。該值必須匹配 Sunlight JS 引擎的可識別值之一。有關值列表,請參閱 Sunlight 說明文件。
startloc – 可選。要在程式碼片段中顯示的程式碼的開始行。如果省略此屬性,第一行的擷取檔將是片段中顯示的第一行程式碼。
stoploc – 可選。要顯示在程式碼片段中的最後一行程式碼(含)。如果省略此屬性,片段中顯示的最後一行內容將是擷取檔的最後一行。
範例
擷取 jQuery 項目存儲庫中的 src/support.js:
[getgit repoid="jquery" userid="jquery" path="src/support.js" language="javascript"]
取得此外掛程式碼回收類的第 39 至第 64 行:
[getgit repoid=github-wordpress-plugin userid=claycarpenter path="src/php/github_repo_content_retriever.php" language="php" startloc=39 stoploc=64]
原文外掛簡介
This plugin embeds the content of a public GitHub repository into your WordPress posts. It’s capable of retrieving either the full content or a snippet of a file. The code will be displayed with syntax highlighting and line numbers.
Now supports content caching for improved page responsiveness and load times.
Syntax highlighting is provided by the Sunlight JS syntax highlighter. Many thanks to those involved in that project!
Usage
This plugin registers a shortcode that allows for embedding GitHub repo content into blog posts. To embed content into your post, use the github shortcode like so:
[github userid="[target user id]" repoid="[target repo id]" path="[path to content]" language="[language of target content]"]
Attributes used by the github shortcode:
userid – The user ID of the repository owner.
repoid – The ID of the repository that contains the target content.
path – The full path to the content. This path should start at the repository root, not inclusive of the leading /, and terminate with the name of the target content’s filename.
language – The programming language of the code contained in the content. This information will be passed to the syntax highlighter. The value must match one of the recognized values for the Sunlight JS engine. For a list of values, see the Sunlight documentation.
startloc – Optional. The starting line of code to display in the code snippet. If this attribute is ommitted, the first line of retrieved file will be the first line of code displayed in the snippet.
stoploc – Optional. The final line of code (inclusive) to display in the code snippet. If this attribute is ommitted, the final line of content shown in the snippet will be the last line of the retrieved file.
Examples
Retrieve src/support.js from the jQuery project repo:
[getgit repoid=”jquery” userid=”jquery” path=”src/support.js” language=”javascript”]
Retrieve lines 39 through 64 of this plugin’s content retrieval class:
[getgit repoid=github-wordpress-plugin userid=claycarpenter path=”src/php/github_repo_content_retriever.php” language=”php” startloc=39 stoploc=64]
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「GetGit」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Github Embed 》此外掛允許您只需貼上 URL,即可嵌入 GitHub 的詳細資訊,就像您嵌入其他嵌入來源一樣。目前支援:, , 資料庫, 使用者檔案, 專案里程碑摘要, 專案貢獻者, , ...。
Jekyll Exporter 》nclude information relevant to the issue you are reporting., , , 功能, , 將所有文章、頁面和 WordPress 設定轉換為 Markdown 和 YAML 格式,可用於 Jeky...。
Pastacode 》使用 Pastacode,您可以輕鬆地將代碼加入您的文章中,並使用宏偉的 PrismJs 着色庫。, 您可以將源代碼插入到文章編輯器中,直接將其寫入編輯器中(使用 Guten...。
Embed Block for GitHub 》這個外掛能夠在區塊編輯器中加入 GitHub 儲存庫嵌入區塊。, 此外掛是在 GitHub 上開發的,歡迎貢獻!, 特別感謝:, – @pedro-mendonca 提供 i18n/l10n ...。
WordPress GitHub Sync 》這是一個 WordPress 外掛,可以將內容與 GitHub 儲存庫(或 Jekyll 網站)進行同步, , 如果您希望能夠協同撰寫 WordPress 網站的內容(或公開展示更改歷史...。
Documents from Git 》官方文件: https://github.com/gis-ops/wordpress-markdown-git, 這個WordPress外掛讓您能夠輕鬆地從您最喜愛的遠端Git平台上發布、協作和版本控制您的[...。
Git it Write – Write posts from GitHub 》Git it Write允許將存儲在Github存儲庫中的markdown文件發布到您的WordPress網站中。因此,使用此外掛程序,當存儲庫中添加、更新文件時,WordPress文章將相...。
Gist GitHub Shortcode 》這款外掛可以通過使用 shortcode 在您的文章中添加 Github Gists。, 範例:, 添加完整的 gist:, [gist id="3837669"], , 添加 gist 中的特定文件:, [gist i...。
Embed Repo For Github 》以下為繁體中文總結:, , 透過這款 WordPress 外掛,您可以把自己的 GitHub 倉庫嵌入 WordPress 網站的各個區域,快速簡單地展示您的作品。以下為使用方法。,...。
External Markdown 》這是一個 WordPress 外掛,可使用短碼 [external_markdown] 從外部網站(例如 GitHub、GitLab 等)嵌入 Markdown 文件到 WordPress 內容中。可能的使用情況是...。
Embed GitHub Gist 》這個專案可以在 GitHub 上進行 Fork:, , https://github.com/dflydev/embed-github-gist, , 嵌入GitHub Gists, 到 WordPress 中。提供文章和頁面的縮碼,還有...。
Canvas-Nest.js 》Canvas-nest.js是 GitHub 上一個非常華麗的開源專案,它使用不到2kb的Javascript代碼,構造一個炫酷的網頁背景效果。該專案的網址是:https://github.com/aTo...。
WP Github 》WP Github 提供三個側邊欄小工具,可配置為在側邊欄中顯示來自 Github 的公開資料,包括個人資料、存儲庫、提交、問題和 Gist。您可以配置任意多個小工具以顯...。
GitHub Release Downloads 》gs » GitHub Release Downloads, you can set default values for user and repo attributes, as well as change the downloads suffix string and sel...。
Mytory Markdown 》ugin allows you to convert Markdown files to HTML and display them in your post content. You can provide a URL for the Markdown file, like a GitHub...。