-
Notifications
You must be signed in to change notification settings - Fork 6
/
readme.txt
66 lines (42 loc) · 2.88 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
=== Markdown Github ===
Contributors: Nils Nolde
Tags: github,markdown
Requires at least: 4.0
Tested up to: 5.0.2
Requires PHP: 5.6
Stable tag: 1.1.0
License: GPLv2
License URI: https://github.com/gis-ops/md-github-wordpress/blob/master/LICENSE
A plugin to inject markdown files directly into a post from Github.
== Description ==
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](https://github.com/settings/developers). `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]`
## Demo
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>.
== Installation ==
1. Install WP Pusher (https://wppusher.com) via ZIP and activate
2. Install from Github via WP Pusher from gis-ops/md-github-wordpress
3. Activate and add shortcode to your posts.
Or directly from WordPress plugin repository.
Or install as ZIP from https://github.com/gis-ops/md-github-wordpress/archive/master.zip
== Changelog ==
= v1.1.0 =
* Add shortcode to display commit history
= v1.0.0 =
* First version