Github Html Readme



Go to github.com and create an account. Then go to your accountsettings (icon in the upper left corner of the page),choose SSH Keys, and provide your SSH keyunless you have already registered this key with another GitHubaccount (see Appendix Appendix: Working with multiple GitHub accounts).Often, it is just amatter of pasting the contents of id_rsa.pub or id_dsa.pub files,located in the.ssh subdirectory of your home directory, into the Key box in theweb page. Make sure to just cut and paste the text from, e.g., id_rsa.pubwithout any extra whitespaces or other text. How to generate thesefiles is described in the link generating SSH keys above the SSH Keysbox.

  1. Github Readme Html Code
  2. Github Readme Html Style
  3. Github Profile Readme Html
  4. Github Html Readme
  5. Github Readme Html Link

Github’s markdown editor is used to edit the README. This file contains getting started information about the github repository. Get to know why writing a good README is important, and how to improve its legibility. How to make a link in GitHub readme.md to open link in new tab my website(www.google.com). The same GitHub README source for the blogpost. Format but there's a second barrier which is a HTML sanitizer that post-processes the asciidoc output. The only part of the GitHub web interface which allows you to push a binary (or any other file you want) is when creating a release. Then, there is a step where you can drag and drop any binary you.

If the account is a project account and not a personal account,I do not recommend to provide an SSH key although it can bedone (see Appendix Appendix: Working with multiple GitHub accounts). It is easierto log in and add collaborators using their personal GitHub usernames.

Creating a new project¶

Click on New repository on the main page and fill out a projectname, here My Project, click the check button Initialize thisrepository with a README, and click on Create repository.Unless you pay, all repos are public, but students and teacherscan request free, private repos.

The next step is to clone the project on your personal computer. Clickon the SSH button to see the address of the project, andpaste this address into a terminal window, after gitclone:

Html

Make sure you substitute user by your own username on GitHub.

The result of the gitclone command is a new directory My-Project.It contains the file .git, which shows that it is a Git repository.It also contains a default README.md file with the project name anddescription. The extension .md signifies a file written in theMarkdown format.You may use the reStructuredText format as an alternative(README.rst), or simply write a plain text file (README),but the gitmv command must be used to change the filename.

You can now add files and directories into the My-Project directory.When your initial file collection has the desired form, you mustrun

The daily file operations are explained in the section Using Git.

Collaborating¶

To give others permissions to push their edits of files to therepository, you click on the Settings link in the right sidebar,then click on Collaborators on the left, and fill in the nameof a collaborator (her or his username on GitHub).Many find it convenient to be notified in email when others havepushed a new version of the files to the repo. Click on Service Hooksin the project’s Settings menu, choose Email, fill inat most two whitespace-separated email addresses, mark theSend from Author and Active boxes, and click on Update Settings.More addresses must be dealt with through a mailing listand filling in the name of that list.

Anyone who participates in a project (has write access) or watches aproject (having clicked the watch button) can monitor thedevelopment of the activity on their GitHub main page. Go to Account Settingsand choose Notification Center. There you see two sections,Participating and Watching, for those participating in the project(granted write access) and those watching the project (having clickedthe watch button), respectively.

Wiki pages¶

With every GitHub project there is an option to create wiki pages.Click on the Wiki button in the right sidebar on the main page ofthe project. Click on New Page to create a new page. The wiki pagescan be written in different markup languages. Markdown is the defaultchoice, but you can alternatively use MediaWiki andreStructuredText. Unfortunately, GitHub wiki pages do not allow LaTeXmathematics through MathJax, even though MediaWiki has support forLaTeX (the reason is security issues).

The wiki pages can be written and maintained through the web browserinterface, but it is usually more convenient to clone them onyour computer as this makes it easy to add figures and other documentsyou may want to link to. It also makes it straightforward to editthe wiki text in your favorite text editor. The wiki pages arestored in a separate repo and can be cloned by

This command makes a local copy of the pages in the directoryMy-Project.wiki, which you may prefer to have at the same levelas the project directory itself in your directory tree.

Each wiki page has its own file, where the extension reflectsthe markup language used, e.g., .md for Markdown, .rest forreStructuredText, .mediawiki for MediaWiki,and .creole for Creole wiki. The wiki files are handled as other files in aGitHub project, i.e., you need to pull before editing and thenperform commit and push. After the push you can reload the pagein the web browser to monitor the effect.

You may consider having the original text in doconce format andgenerate the wiki in the reStructuredText or MediaWiki format.

Do changes, commit the usual way, and push by

The address can be stored as url in .git/config in theroot directory of the wiki project so that just a standardgitpush works.

Project web pages¶

HTML pages stored in your repo cannot be linked to and properlyrendered as web pages.Say you have some HTML file doc/file.html in the repo.The normal link to the file is

which shows up as a nicely typeset, colorful HTML code.The raw text file,

shows up as pure text in a browser. If one wants to see the filerendered as HTML code, one can view it through htmlpreview.github.io.This means that one can use the link

to produce the HTML document in a browser.

However, there is another technique available where all HTML files ina special branch gh-pages of the repository are automaticallyrendered correctly as HTML documents in a browser. This isthe recommended technique for publishing a collection of HTML filesrelated to the project in a simple and convenient way.The recipe is described in detail below.

  1. Go to the project page on github.com and click Settings.
  2. Click on Automatic Page Generator under the GitHub Pages.
  3. Proceed clicking Continue to Layouts, choosea design of the index.html page that GitHub willcreate for you, and click Publish.
  4. Go to the root directory of the project, My-Projectand run gitfetchorigin.
  5. Run gitcheckoutgh-pages.

You have now a new branch called gh-pages of your projectcontaining an index.html file and directories for JavaScriptprograms and CSS style sheets in the root directory. The gh-pagesbranch will also all files not contained in the master branch,typically redundant files you have generated and which should not bestored in the version control system (remove these manually with gitrm). You can populate the root directory and subdirectories of yourgh-pages branch with HTML and other files as you like. The key issueis that the people out there will only see the web pages thatcorrespond to your HTML files in the gh-pages branch!

The index.html page is invoked by the web address

where user is the GitHubusername and My-Project is the project name.

Github Readme Html Code

The web pages and project files are now in two different branches.To see the branches, type gitbranch, and the one you are in willbe marked with * in the output. Switching to the master branchis done by gitcheckoutmaster. Similarly, gitcheckoutgh-pagesswitches to the gh-pages branch.

My personal preference is to have the master and gh-pagessynchronized, at least in projects where I want to link to varioussource code files or other files from the web documentation.Sometimes I also update files in the gh-pages branch withoutremembering to switch to the master branch. To this end, one needsto merge the branches, i.e., automatically edit filesin the current branch such that they are up-to-date andidentical to files in another branch.

To merge the current branch with some branch named otherbranch, run

Git applies smart algorithms that very often manage to merge thefiles without human interaction. However, occasionally these algorithmsare not able to resolve conflicts between two files.A message about the failure of the merge is seen in the terminalwindow, and the corresponding files have markers in them showingwhich sections that needs manual editing to resolve the conflicts.Rungitdiff to show the problems (you can tailor this command to yourneeds as explained in the section Replacing pull by fetch and merge). After a manualedit, do gitcommit-a. More details on merging appearsin the section Merging files with Git.

If you want to keep the master branch and the gh-pages branchsynchronized,start with merging the gh-pages branch with the masterbranch and push the complete file collection to the gh-pages branch.Then switch to the masterbranch and merge with gh-pages so you get the autogeneratedindex.html file and associated files and directories for web pagesin the root directory of the master branch as well:

You must add an empty file .nojekyll in the topdirectory of the project pages if you want to use Sphinx-generatedHTML pages (or other pages using javascripts, style sheets, and imagesin subdirectories whose names start with an underscore).

You can now add the documentation to the project files andmaintain them in the master branch.Before publishing documents online,make sure to update the gh-pages branch by

Github Readme Html Style

Personally, I like to move the generated index.html file and allassociated scripts, stylesheets, and images from the root directory tosome more isolated place, say doc/web:

The URL of the index.html file is

Linking to source code files or other files in the project is easy:just find the file in GitHub’s web interface, choose which version ofthe file you want to link to (nicely HTML formatted version or the rawfile), right-click on the link, choose Copy Link, and paste thelink into the document you want. You can test that the link works bythe Unix command curl-O<link>. Note that the link to a fileis different from the source file’s intuitive path in the repository.Typically, a source file dir/f.py in project prj is reachedthrough

Github Html Readme

Sometimes you want to link to another HTML file, PDF file, movie file,or a file that is to be interpreted as a web resource by the browser.Do not use the path to the file in the repo as explained above as it willjust bring the reader to the repo page. Instead, make sure the file is inthe gh-pages branch and use a local link, like ../doc.pdf, or thecomplete gh-pages URL to the file, say

Tip

The ordinary GitHub URL of image files can be usedin web pages to insert images from your repo, provided the image filesare in the raw format - click the Raw button when viewing a file atgithub.com and use the corresponding URL in the img tag inthe HTML code.

User web pages¶

GitHub also allows you to create user pages and organization pages nottied to any specific project.Your personal site has addresshttp://user.github.com.Go to your home page on github.com and click New repository,and give it the project name user.github.com.Then follow the instructions that come up:

Github Profile Readme Html

Go to http://user.github.com and see how the index.html isrendered. You can now add various contents as in any ordinaryGit repository.If you want to use Sphinx generated HTML pages, recall to add an empty file.nojekyll.

Code

The GitHub Pages feature allows you to publish content to the web by simply pushing content to one of your GitHub hosted repositories. There are two different kinds of Pages that you can create: User Pages and Project Pages.

User & Organization Pages

Let’s say your GitHub username is “alice”. If you create a GitHub repository named alice.github.com, commit a file named index.html into the master branch, and push it to GitHub, then this file will be automatically published to http://alice.github.com/.

On the first push, it can take up to ten minutes before the content is available.

The same works for organizations. If your org account is named “PlanEx”, creating the repo planex.github.com under the org will publish pages to http://planex.github.com/.

Real World Example: github.com/defunkt/defunkt.github.com → http://defunkt.github.com/.

Github Html Readme

Project Pages

Let’s say your GitHub username is “bob” and you have an existing repository named fancypants. If you create a new root branch named gh-pages in your repository, any content pushed there will be published to http://bob.github.com/fancypants/.

In order to create a new root branch, first ensure that your working directory is clean by committing or stashing any changes. Then create a new branch named gh-pages which is independent and totally disconnected from all the other branches. This branch will store all your files for your project’s webpage.

After running this you’ll have an empty working directory (don’t worry, your main repo is still on the master branch). Now you can create some content in this branch and push it to GitHub. For example:

On the first push, it can take up to ten minutes before the content is available.

Real World Example: github.com/defunkt/ambition@gh-pages → http://defunkt.github.com/ambition.

Project Page Generator

If you don’t want to go through the steps above to generate your branch, or you simply would like a generic page, you can use our page generator to create your gh-pages branch for you and fill it with a default page.

First navigate to your project and click the ‘Admin’ button on the top right

Then check the ‘GitHub Pages’ check box.

A pop-up will appear. Click on the ‘Automatic GitHub Page Generator’

After your page is generated, you can check out the new branch:

In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.

Every GitHub Page is run through Jekyll when you push content to your repo. Because a normal HTML site is also a valid Jekyll site, you don’t have to do anything special to keep your standard HTML files unchanged. Jekyll has a thorough README that covers its features and usage.

As of April 7, 2009, you can configure most Jekyll settings via your _config.yml file. Most notably, you can select your permalink style and choose to have your Markdown rendered with RDiscount instead of the default Maruku. The only options we override are as follows:

If your Jekyll site is not transforming properly after you push it to GitHub, it’s useful to run the converter locally so you can see any parsing errors. In order to do this, you’ll want to use the same version that we use.

We currently use Jekyll 0.10.0 and run it with the equivalent command:

As of December 27, 2009, you can completely opt-out of Jekyll processing by creating a file named .nojekyll in the root of your pages repo and pushing that to GitHub. This should only be necessary if your site uses directories that begin with an underscore, as Jekyll sees these as special dirs and does not copy them to the final destination.

Github

If there’s a feature you wish that Jekyll had, feel free to fork it and send a pull request. We’re happy to accept user contributions.

Real World Example: github.com/pages/pages.github.com → http://pages.github.com/.

Github Html Readme

GitHub Pages allows you to direct a domain name of your choice at your Page.

Let’s say you own the domain name example.com. Furthermore, your GitHub username is “charlie” and you have published a User Page at http://charlie.github.com/. Now you’d like to load up http://example.com/ in your browser and have it show the content from http://charlie.github.com/.

Start by creating a file named CNAME in the root of your repository. It should contain your domain name like so:

Push this new file up to GitHub. The server will set your pages to be hosted at example.com, and create redirects from www.example.com and charlie.github.com to example.com.

Next, you’ll need to visit your domain registrar or DNS host and add a record for your domain name. For a sub-domain like www.example.com you would simply create a CNAME record pointing at charlie.github.com. If you are using a top-level domain like example.com, you must use an A record pointing to 207.97.227.245. Do not use a CNAME record with a top-level domain, it can have adverse side effects on other services like email. Many DNS services will let you set a CNAME on a TLD, even though you shouldn’t. Remember that it may take up to a full day for DNS changes to propagate, so be patient.

Real World Example: github.com/mojombo/mojombo.github.com → http://tom.preston-werner.com/.

If you provide a 404.html file in the root of your repo, it will be served instead of the default 404 page. Note that Jekyll-generated pages will not work, it must be an html file.

Real World Example: http://github.com/tekkub/tekkub.github.com/blob/master/404.html → http://tekkub.net/404.html.





Comments are closed.