GitSwag displays data from a Github account using Github’s public API. In order to avoid
rate-limiting, it caches the JSON from the API locally, and refers to that whenever
available. You can display a user profile, list of repositories, header for a single
repository, preview files or gists.
In “GitSwag” under the settings tab, enter your github username, select the
“update cache” checkbox and submit to change your username. Files under that
username can be deleted by checking the box next to the file and submitting.
Any changes you make to your github repo won’t be reflected immediately by
the plugin, you’ll have to manually delete the cache first.
To save a bit of space, composer.phar isn’t included with this plugin.
Parsedown is [https://github.com/erusev/parsedown/blob/master/LICENSE.txt](MIT licensed)
Display the profile of a single user
Display a list of repos for a user
View data for a repository
[gitswag_repo_view github_username=”username” github_repo=”reponame”]
Preview a file
[gitswag_file_view github_username=”username” github_repo=”reponame” path=”path/to/” filename=”file.txt”]
List gists by a user
Preview a gist
display the readme for a repo
[gitswag_readme github_username=”username” github_repo=”reponame”]
Because the public github API is rate limited, this plugin will download and keep a cached
version of the .json files and readme markdown from API calls locally, and will need to be deleted
in the admin panel when a change needs to be reflected. You can select a file and submit to delete them.
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Add some shortcodes.
- Can I clone/pull/push/whatever?
..no. Nothing that requires authentication is supported.
- what’s to stop me from getting the data from someone else’s repo?
..nothing. It’s all public data anyway. Be nice.
- this is missing an api feature
I’ll probably get around to it at some point.
Contributors & Developers
“GitSwag” is open source software. The following people have contributed to this plugin.Contributors
1.2 added output buffering and changed echoes to returns, fixing possible rendering issues. updated css.