Github Repository Readme



GitHub is an awesome place to host your open source project code. MooTools, Prototype, and jQuery all use GitHub. As you probably know, the MooTools Forge requires your plugins be hosted on GitHub. The only problem with hosting all my MooTools plugins is that I lose traffic when I want people to see my code. Problem solved: use PHP, the GitHub API, and PHP Markdown to display files of my choice on my website.

Macromedia freehand 10 free filehippo. Download and extract a GitHub repository from node. Burial untrue zip free. Easily Publish, Share and Collaborate using Grav Open Publishing Space!. Create a new Git repository (hosted on GitHub, GitLab, Bitbucket or your own server) with at least one commit.Tap the.

Our goals with this code will be to:

  • Connect to GitHub via the API to retrieve repository information.
  • Retrieve the content of two files from the repository: a source file and the README.md Markdown file.
  • Cache the information for a given period of time to reduce the load on GitHub.
  • Use PHP Markdown to output a formatted README.md file.
Github

I know that seems like a lot of work but you'll be amazed at how easy the process is. Tpu 66a install manual.

PHP MarkDown

You may download PHP Markdown at Michel Fortin's website. It's simple and full of features.

The PHP

The first step is to build a PHP function that will connect to GitHub using cURL:

Github add readmeRepository

Next we need to define a few settings:

The next step is to create another PHP function that grabs the repository information (JSON-encoded, because I love JSON) -- either fresh from GitHub (by first grabbing the most recent commit hash, then grabbing the contents of the two files) or our local cached information:

Once we've acquired the appropriate information, we output the information to screen:

Git Project Readme

That's all! Now I get the benefit of hosting my code on GitHub but displaying it on my own website. I've created a special WordPress template page to do so and recommend you do too!

Github Repo Readme Template

Demo?

Github Create Repository Readme

Visit my Projects page and click on the 'Docs' link for any project. All of the information that comes up on individual project pages comes from GitHub. No more manual page creation!