Plugin yìí kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress. Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

GetGit

Àpèjúwe

This plugin embeds the content of a public GitHub repository into your WordPress posts. ItÌtumọ̀ Yorùbá: ’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 Ìtumọ̀ Yorùbá: – The user ID of the repository owner.

  • repoid Ìtumọ̀ Yorùbá: – The ID of the repository that contains the target content.

  • path Ìtumọ̀ Yorùbá: – 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Ìtumọ̀ Yorùbá: ’s filename.

  • language Ìtumọ̀ Yorùbá: – 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 Ìtumọ̀ Yorùbá: – 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 Ìtumọ̀ Yorùbá: – 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Ìtumọ̀ Yorùbá: ’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]

Àwọn àwòrán ìbòjú

  • A snippet of content retrieval code from this plugin, with PHP syntax highlighting.

  • A snippet of a jQuery file, with JavaScript syntax highlighting.

  • The plugin settings page.

Ìgbéwọlẹ̀

To install this plugin:

  1. Upload the plugin archive ZIP (getgit.zip) to the /wp-content/plugins/ directory.
  2. Activate the GetGit plugin through the ‘Plugins’ menu in WordPress.
  3. Add the github shortcode to your blog posts, as outlined in the Description section.

FAQ

Does this plugin support configurable syntax highlighting?

Currently, the syntax highlighting style choice is not user configurable. However, such functionality is expected in future releases.

Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

Àwọn Olùkópa & Olùgbéejáde

“GetGit” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí plugin yìí.

Àwọn Olùkópa

Túmọ̀ “GetGit” sí èdè rẹ.

Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

Ṣàwárí koodu, ṣàyẹ̀wò ibi ìpamọ́ SVN, tàbí ṣe àgbékalẹ̀ sí àkọsílẹ̀ ìdàgbàsókè nípasẹ̀ RSS.

Àkọsílẹ̀ àwọn àyípadà

0.3

  • Adds configurability to the caching support. The content cache system can now be enabled or disabled. Content in the cache can now have a configurable expiry.
  • Updates cache (Transient) key generation so that the generated keys are more likely to be unique across plugins.

0.2

  • Adds support for content caching. The caching support is provided via the Transients API. This is an initial implementation and does not allow for configuration of the cache entry expiration date.

0.1

  • Initial public release.
  • Supports basic syntax highlighting, line numbers.
  • Supports showing only snippets of files, rather than the full file content.
  • Uses Sunlight JS syntax highlighter, v1.17.