All Projects → magnetikonline → github-markdown-render

magnetikonline / github-markdown-render

Licence: MIT license
Display Markdown formatted documents on your local web server using GitHub's Markdown rendering API and CSS to mimic the visuals of GitHub itself.

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to github-markdown-render

ghrecipes
⛔ ARCHIVED ⛔ Provides some helper functions for using the GitHub V4 API
Stars: ✭ 28 (+55.56%)
Mutual labels:  github-api
Gitter
Gitter for GitHub - 可能是目前颜值最高的GitHub微信小程序客户端
Stars: ✭ 3,555 (+19650%)
Mutual labels:  github-api
GithubApp-android-architecture
Let's learn a deep look at the Android architecture
Stars: ✭ 16 (-11.11%)
Mutual labels:  github-api
github-interact-cli
🎩 Interact with GItHub right inside your terminal
Stars: ✭ 43 (+138.89%)
Mutual labels:  github-api
go-github-app
Template for building GitHub Apps in Go.
Stars: ✭ 45 (+150%)
Mutual labels:  github-api
actions
Collection of repetitive GitHub Actions
Stars: ✭ 12 (-33.33%)
Mutual labels:  github-api
github-rater
📊 Check your GitHub rating, view results and enhance your profile quality.
Stars: ✭ 319 (+1672.22%)
Mutual labels:  github-api
org-stats
Get the contributor stats summary from all repos of any given organization
Stars: ✭ 151 (+738.89%)
Mutual labels:  github-api
Issues-Hunt
Hunt for problems to solve using GitHub API. Save time searching for "good first issue" or "help wanted" labels.
Stars: ✭ 44 (+144.44%)
Mutual labels:  github-api
ezprofile
🚀 Create an automatic portfolio based on GitHub profile.
Stars: ✭ 344 (+1811.11%)
Mutual labels:  github-api
git-space
A web application to view Github's user profile.
Stars: ✭ 14 (-22.22%)
Mutual labels:  github-api
node-github-publish
Publishes a file to a repository through the GitHub Contents API
Stars: ✭ 20 (+11.11%)
Mutual labels:  github-api
GithubClient
Github iOS Client based on Github REST V3 API and GraphQL V4 API
Stars: ✭ 42 (+133.33%)
Mutual labels:  github-api
stellar
Search your github stars in R
Stars: ✭ 24 (+33.33%)
Mutual labels:  github-api
gh-notify
GitHub CLI extension to display GitHub notifications
Stars: ✭ 66 (+266.67%)
Mutual labels:  github-api
version exporter
Monitor the versions of the things you run and care about
Stars: ✭ 16 (-11.11%)
Mutual labels:  github-api
github-react-native-apollo-graphql
📱 A GitHub mobile app built with React-Native and Apollo GraphQL
Stars: ✭ 24 (+33.33%)
Mutual labels:  github-api
neo
A Discord bot built to satisfy a multitude of needs
Stars: ✭ 16 (-11.11%)
Mutual labels:  github-api
zulipbot
GitHub workflow-optimizing bot by @zulip
Stars: ✭ 70 (+288.89%)
Mutual labels:  github-api
Triton
GitHub notifications tracker for Telegram. Pushes GitHub notifications to Telegram.
Stars: ✭ 12 (-33.33%)
Mutual labels:  github-api

GitHub Markdown render

Display Markdown formatted documents on your local development web server using GitHub's Markdown Rendering API and CSS to mimic the visual display on GitHub itself.

Handy for authoring/previewing README.md files (or any Markdown for that matter) in project repositories, hopefully avoiding noisy git push actions in commit logs due to excessive typos/errors.

Note: this is intended for local development only, probably not a good idea for production use due to GitHub API rate limits per user.

Requires

  • PHP 5.4+
  • PHP cURL extension - more than likely already part of your PHP install/compile.
  • Nginx or Apache URL rewrite support.

Usage

Markdown files are accessible from a local web server and returned in plain text, for example:

http://localhost/projects/ghmarkdownrender/README.md
http://localhost/projects/thummer/README.md
http://localhost/projects/unrarallthefiles/README.md
http://localhost/projects/webserverinstall.ubuntu12.04/install.md

To view rendered Markdown, request same URIs with a querystring switch:

http://localhost/projects/ghmarkdownrender/README.md?ghmd
http://localhost/projects/thummer/README.md?ghmd
http://localhost/projects/unrarallthefiles/README.md?ghmd
http://localhost/projects/webserverinstall.ubuntu12.04/install.md?ghmd

Rendered result is cached against the last modification time of each Markdown document to reduce repeated GitHub API calls for identical source content.

Install

Configure index.php

Generate a new GitHub OAuth personal access token using either:

Note down the token generated.

Update the following constants within index.php in the GitHubMarkdownRender class:

Setting Description
GITHUB_PERSONAL_ACCESS_TOKEN Your generated GitHub personal access token. Anonymous GitHub API calls are limited to 60 per hour, providing user credentials ramps this up to a more usable 5000 requests per hour.
DOCUMENT_ROOT Web server document root location on the file system. Assumes you are serving up all your project(s) directories under a default virtual host.

Setup URL rewrite rules

  • Configure a URL rewrite for your default virtual host so all requests to /local/path/*.md?ghmd are rewritten to /path/to/ghmarkdownrender/index.php.
  • Refer to the supplied rewrite.nginx.conf & rewrite.apache.conf for examples.

Note:

  • You may wish to have requested raw Markdown files served up with a MIME type such as text/plain for convenience.
    • Nginx by default serves up unknown file types based on extension as application/octet-stream, forcing a browser download - see /etc/nginx/mime.types within your Nginx installation and modify to suit.
  • Haven't tested rewrite.apache.conf - it should do the trick, would appreciate a pull-request if it needs fixing.

Test

You should now be able to call a Markdown document with a querystring of ?ghmd to receive a familiar GitHub style Markdown display. The page footer will also display the total/available API rate limits, or if rendering was returned from cache.

CSS style issues

Markdown display CSS has been lifted (deliberately) from GitHub.com. It's quite possible/likely there are some CSS styles missing to make this complete.

If anything missing is noted with your own markdown documents, it would be great to get any source examples or pull requests (add your example(s) to test.md) to help make things complete.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].