Linux 软件免费装

Embed GitHub Gist

开发者 dflydev
更新时间 2012年12月14日 05:05
PHP版本: 2.8.6 及以上
WordPress版本: 3.5

标签

embed highlighter syntax highlight source github gist

下载

0.6 0.1 0.10 0.11 0.12 0.13 0.2 0.3 0.4 0.5 0.7 0.8 0.9

详情介绍:

This project is available for forking on GitHub: Embed GitHub Gists into WordPress. Provides a shortcode for posts and pages but also has the ability to embed by hand in the event that a Gist needs to be embedded somewhere in the page that does not pass through the shortcode filters. Examples: [gist id=546764] [gist id=546764 file=file.txt] [gist id=546764 file=file.txt bump=1] [gist]http://gist.github.com/546764[/gist] Cache is implemented with the Transients API to minimize delay on loading content. Default TTL (time to live) is 86400 seconds or one day. Upcoming features:

安装:

  1. Download the plugin zip file
  2. Unzip contents of plugin zip file
  3. Upload the embed-github-gist directory to the /wp-content/plugins/ directory
  4. Activate the plugin through the 'Plugins' menu in WordPress
  5. Start using the plugin by adding Gists to posts!

升级注意事项:

0.13 Now looks for EMBED_GISTHUB_USERNAME and EMBED_GISTHUB_PASSWORD 0.12 0.11 Now defaults to not embedding HTML directly. Now requires json_decode to be available. 0.5 Now defaults to using cache and embedding HTML directly. 0.4 No changes from previous release. 0.3 No changes from previous release. 0.2 Should have no negative impact. 0.1 First release.

常见问题:

How can I fix rate limit exceded errors?

Define EMBED_GISTHUB_USERNAME and EMBED_GISTHUB_PASSWORD in wp-settings.php.

Can the cache be broken?

Yes. Use a unique bump value to force cache to update. For instance, if you have the following: [gist id=546764] The cache can be broken by specifying a bump value: [gist id=546764 bump=1] To break the cache again later, change to a new unique bump value: [gist id=546764 bump=2]

Can I change the TTL on a Gist-by-Gist basis?

Yes. Specify a TTL (in seconds) like this: [gist id=546764 ttl=3600]

Can I embed a Gist outside of a post or a page?

Yes. <?php echo embed_github_gist(546764); ?>

Can I display a specific file from my gist?

Ues. You can use the file parameter: [gist id=546764 file=file.txt]

更新日志:

0.13 0.12 0.11 0.10 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1