Markdown Github

A plugin to inject markdown files directly into a post from Github.

Author:Nils Nolde (profile at wordpress.org)
WordPress version required:4.0
WordPress version tested:5.2.6
Plugin version:1.1.0
Added to WordPress repository:02-03-2019
Last updated:22-10-2019
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:2
Plugin URI:https://github.com/gis-ops/md-github-wordpres...
Total downloads:1 762
Active installs:200+
plugin download
Click to start download

WordPress Plugin to use Github as collaboration and version control platform for Markdown documents.

Advantages:

  • Easy to update by external users via pull requests, minimizes the chance of stale tutorials
  • Write Markdown in your favorite editor and just push to your repo to update your blog

It features 3 shortcodes:

  1. [md_github token=YourToken url=Github URL]: Pulls raw HTML from the https://api.github.com/repos/ endpoint and styles it with Github markdown CSS
  2. [checkout_github token=YourToken url=Github URL]: Displays a formatted link to the repo with the date of the latest update
  3. [history_github token=YourToken url=Github URL]: Displays a commit history of the last 5 commits.

Github API is queried on every new load of the page, so that changes in the repository will immediately be reflected on your blog. Private authentication tokens help increasing the API limit to 5000 requests per hour (enough even for Digital Ocean blogs) and accessing private repositories.

Idea and most of the code is based on Andy Challis’ WP plugin to display Jupyter notebooks https://github.com/ghandic/nbconvert. The CSS is taken from https://github.com/sindresorhus/github-markdown-css.

Usage

All shortcodes take token and url as attribute. token is your private personal access token, which you can generate here. url is the full URL to your document on Github. E.g.

[md_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]

[checkout_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]

[history_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]<h3>Demo</h3>

Check it out on of our blogs:

https://gis-ops.com/react-redux-leaflet-turfjs-building-a-density-based-clustering-dbscan-app-with-the-almighty-here-maps-places-api/

Support

Add issues at https://github.com/gis-ops/md-github-wordpress/issues.