[WordPress] 外掛分享: WP Github Gist

前言介紹

  • 這款 WordPress 外掛「WP Github Gist」是 2011-08-22 上架。
  • 目前有 50 個安裝啟用數。
  • 上一次更新是 2021-10-13,距離現在已有 1299 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.8 以上版本才可以安裝。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

sudar |

外掛標籤

Gist | embed | Github |

內容簡介

WP Github Gist WordPress 插件提供了在您的博客文章或頁面中嵌入 Github Gist 和文件的功能。雖然 Github 沒有提供一種嵌入文件的方式,不過這個插件仍然可以使用 gist-it 服務。

特色
嵌入 Gist

要嵌入 Gist,您需要使用以下簡碼:

[gist id="{GIST_ID}" file="{GIST_FILE}" width="{WIDTH}" height="{HEIGHT}"]

以下是簡碼中可用的不同屬性:

id - 您的 Gist ID。
file - 要顯示的 Gist 內部文件。如果 Gist 中只有一個文件,則可以忽略此項。
width - 代碼包裝器的寬度。默認為 100%。
height - 代碼包裝器的高度。默認為 100%。

例如:[gist id="12345" file="myfile" width="100%" height="100%"]

嵌入 Github 文件

要嵌入 Github 文件,您需要使用以下簡碼:

[github file="{GITHUB_FILE}" start_line="{START_LINE}" end_line="{END_LINE}"]

{GITHUB_FILE} - 您的 Github 文件的完整路徑。例如:如果您想要嵌入 https://github.com/sudar/MissileLauncher/blob/master/MissileLauncher.cpp,那麼 {GITHUB_FILE} 將是 /sudar/MissileLauncher/blob/master/MissileLauncher.cpp
{START_LINE} - 如果您只想嵌入文件的一部分,可以指定起始行號(可選)
{END_LINE} - 如果您只想嵌入文件的一部分,可以指定結束行號(可選)

例如:[github file="/sudar/MissileLauncher/blob/master/MissileLauncher.cpp"]

如果您只想嵌入文件的一部分,可以指定開始和結束行號

[github file="/sudar/MissileLauncher/blob/master/MissileLauncher.cpp" start_line="10" end_line="20"]
更改 Gist-it 服務器

默認情況下,此插件使用我的自己的gist-it 服務器,該服務器托管在免費的 Google App Engine 帳戶上。如果您的網站預期會有大量訪問量,您可以考慮使用自己的 gist-it 服務器。您可以按照 這些指示部署您自己的 gist-it 服務器,然後轉到設置頁面更改 URL。

翻譯

插件附帶了 POT 檔。如果您愿意為插件做翻譯,請使用 POT 檔創建您語言的 .po 文件並告訴我。我會在給予您信用後添加到插件中。

支援

可以從 插件主頁獲得插件的支援。如果您有任何問題或建議,請在那裡留下評論或聯繫我(Twitter)。

Readme 生成器

此 README 文件是使用 wp-readme 生成的,這是一個為 WordPress 插件生成 README 文件的工具。

原文外掛簡介

WP Github Gist WordPress Plugin, provides the ability to embed gist and files from Github in your blog posts or pages. Even though Github doesn’t provide a way to embed files, this Plugin still works by using the gist-it service.
Features
Embed Gist
To embed a gist you have to use the following shortcode
[gist id = "{GIST_ID}" file = "{GIST_FILE}" width = "{WIDTH}" height = "{HEIGHT}"]

The following are the different attributes that you can use in the shortcode

id – Id of your gist.
file – File inside gist that you want to display. If there is only one file in the gist, then you can ignore this.
width – Width of the code wrapper. Default is 100%.
height – Height of the code wrapper. Default is 100%.

eg: [gist id = "12345" file = "myfile" width = "100%" height = "100%"]
Embed Github files
To embed a github file you have to use the following shortcode
[github file = "{GITHUB_FILE}" start_line = "{START_LINE}" end_line = "{END_LINE}"]

{GITHUB_FILE} – full path to your github file. eg: If you want to embed https://github.com/sudar/MissileLauncher/blob/master/MissileLauncher.cpp then {GITHUB_FILE} would be /sudar/MissileLauncher/blob/master/MissileLauncher.cpp
{START_LINE} – If you want to embed only part of the file, then you can specify the starting line number (optional)
{END_LINE} – If you want to embed only part of the file, then you can specify the ending line number (optional)

eg: [github file = "/sudar/MissileLauncher/blob/master/MissileLauncher.cpp"]
if you want to embed only part of the file, then you can specify the start and end line as well
[github file = "/sudar/MissileLauncher/blob/master/MissileLauncher.cpp" start_line = "10" end_line = "20"]

Changing Gist-it server
By default, this Plugin uses my own gist-it server which is hosted on a free Google App Engine account. If you expect significant amount of traffic to your blog, then do consider using your own gist-it server. You can follow the instructions to deploy your own gist-it server and then go to the settings page to change the url.
Translation
The pot file is available with the Plugin. If you are willing to do translation for the Plugin, use the pot file to create the .po files for your language and let me know. I will add it to the Plugin after giving credit to you.
Support
Support for the Plugin is available from the Plugin’s home page. If you have any questions or suggestions, do leave a comment there or contact me in twitter.
Readme Generator
This Readme file was generated using wp-readme, which generates readme files for WordPress Plugins.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP Github Gist」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | 0.2 | 0.3 | 0.4 | 0.5 | trunk |

延伸相關外掛(你可能也想知道)

  • EmbedPress – PDF Embed, PDF 3D FlipBook, Instagram Social Feeds, Google Docs, Vimeo, Wistia, YouTube Videos, Maps & Upload PDF Documents 》EMBEDPRESS - 從150多個來源嵌入任何東西 - YouTube、Google文件、Drive、地圖、Vimeo、Wistia、Spotify、Boomplay、PDF、PPT等,並通過Elementor、Block Edi...。
  • iframe 》, 高級 iFrame Pro, iframe, 捐贈, GitHub, , [iframe src=”http://www.youtube.com/embed/oDlbBy9vfgI” width=”100%” height=̶...。
  • Advanced iFrame 》看起來您正在尋找一個 WordPress 外掛 - Advanced iFrame Pro。這個外掛可讓您使用 iframe 包含其他網頁到您的網站中,同時具有隱藏和修改元素、自動調整高度...。
  • Insert Pages 》Insert Pages 可讓您使用 Shortcode API,將任何 WordPress 內容(例如,頁面、文章、自訂文章類型)嵌入其他 WordPress 內容。它還包括一個小工具,可將頁面...。
  • Compact WP Audio Player 》Compact WordPress Audio Player 插件是一個基於 HTML5 + Flash 混合的 WordPress 外掛,可以透過使用 shortcode 在 WordPress 文章或頁面中嵌入 mp3 音頻文...。
  • Advanced Responsive Video Embedder for Rumble, Odysee, YouTube, Vimeo, Kick … 》這是最佳的 WordPress 影片外掛嗎?支援幾乎你所能想像的一切,同時保持易用性和簡單性。這很可能是你需要的唯一一個外掛,來處理 WordPress 網站上的影片嵌...。
  • Code Embed 》注意: WordPress 5.0 及以上版本的使用者請查看常見問題以了解如何在區塊編輯器中使用此外掛。, Code Embed 外掛允許您在文章中嵌入程式碼(JavaScript 和 H...。
  • PDF.js Viewer 》透過 Gutenberg 區塊或簡單的縮略語,將 Mozilla 的 PDF.js Viewer 整合到您的網頁或文章中。PDF.js 是一個用於在瀏覽器中顯示 PDF 頁面的 JavaScript 函式庫...。
  • Embed PDF Viewer 》透過oEmbed或以區塊的方式,將來自媒體庫或其他地方的PDF嵌入至object標籤或Google Doc Viewer當作備用選項。URL只需要是可以讓全球使用的連結即可。, 靈感來...。
  • PDF viewer for Elementor & Gutenberg 》「PDFjs Viewer for Elementor」外掛是一個強大的工具,可輕鬆將 PDF 檔案嵌入到您的 Elementor 頁面建構器頁面中。它專為 Elementor 設計,因此您可以輕鬆在...。
  • PDF Viewer 》PDF Viewer 是一個 WordPress 外掛,允許您在網站上嵌入 PDF 文件,無需使用 Flash 外掛程式,僅依賴 JavaScript 來運作。這將使您的網站符合 HTML5 標準。此...。
  • Jotform oEmbed 》使用 Jotform 的 oEmbed 外掛程式,現在您可以輕鬆地在部落格文章中加入網路表單。安裝此外掛程式後,WordPress 將會辨識 Jotform 表單的 URL,以方便地嵌入...。
  • Disable Embeds 》這個外掛的功能:, , 防止他人嵌入您的網站。, 防止您嵌入非白名單網站。, 禁用所有與此功能相關的 JavaScript。, 從新版區塊編輯器中移除 WordPress 嵌入區...。
  • Videojs HTML5 Player 》Video.js HTML5 Player 是一個支持桌面和移動裝置視頻播放的用戶友好的外掛。它讓你輕鬆嵌入自主託管的視頻文件或使用 Video.js 庫的外掛視頻文件。, , Video...。
  • File Manager for Google Drive – Integrate Google Drive with WordPress 》使用這款最佳且使用者友善的「Google Drive」WordPress外掛,讓您的Google Drive與WordPress完美整合,體驗順暢的使用體驗。, , 輕鬆地在您的網站上管理和分...。

文章
Filter
Apply Filters
Mastodon