在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:magnetikonline/github-markdown-render开源软件地址:https://github.com/magnetikonline/github-markdown-render开源编程语言:PHP 93.3%开源软件介绍:GitHub Markdown renderDisplay 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 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
UsageMarkdown files are accessible from a local web server and returned in plain text, for example:
To view rendered Markdown, request same URIs with a querystring switch:
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 |
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. |
/local/path/*.md?ghmd
are rewritten to /path/to/ghmarkdownrender/index.php
.rewrite.nginx.conf
& rewrite.apache.conf
for examples.Note:
text/plain
for convenience.
application/octet-stream
, forcing a browser download - see /etc/nginx/mime.types
within your Nginx installation and modify to suit.rewrite.apache.conf
- it should do the trick, would appreciate a pull-request if it needs fixing.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.
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.
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论