# Markup Github

Github-markup 4.0.0. This gem is used by GitHub to render any fancy markup such as Markdown, Textile, Org-Mode, etc. Fork it and add your own! Versions: 4.0.0. Markdown is a lightweight and easy-to-use syntax for styling all forms of writing on the GitHub platform. What you will learn: How the Markdown format makes styled collaborative editing easy How Markdown differs from traditional formatting approaches.

We show rendered markup in several places on GitHub, most notably including a
project’s main README on the Repository page itself.

Starting today, GitHub supports relative links in markup files. Now you can
link directly between different documentation files, whether you view the
documentation on GitHub itself, or locally, using a different markup renderer.

You want examples of link definitions and how they work? Here’s some

…you can use a relative link:

and we’ll make sure it gets linked to user/repo/blob/branch/other_file.md.

If you were using a workaround like [a workaround link](repo/blob/master/other_file.md),
you’ll have to update your documentation to use the new syntax.

This also means your documentation can now easily stand on its own, without always
pointing to GitHub.

If you want more information, we have a help article for you. Happy documenting!

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.

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:

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.

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).

## Markdown Github

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

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 Neospeech julie voice download.

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

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.

## Markup Language Github

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:

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.