Search code examples
githubmarkdowngist

How to have multiple markdowns in the same gist


I would like to create a gist in which I can present a main markdown document containing a set of links. These links will point to secondary markdowns which actually contain the code examples and technical explanations:

Here's what I have so far. I have included two markdown files:

  • Notes.md: contains a listing of existing secondary markdown documents
  • tree_traversal.md: an example of such a secondary markdown

As you can see I have tried to add a link in Notes.md to tree_traversal.md using the following syntax:

example of a [link](tree_traversal.md)

However there are two issues:

  1. The Gist server attempts to display both Notes.md and tree_traversal.md. This is not what I want. I want to have Notes.md display first, then click on the link to navigate to tree_traversal.md
  2. When I actually click on the link I created in Notes.md I get a 404 Page not found error.

Is it possible to have a multi-page gist like this? If so how? If not is gist only designed to have one markdown file?


Solution

  • Mousing over the tree_traversal.md header we see that it is a link to

    https://gist.github.com/awa5114/4052ba8adb51779192a4a715a048f8ca#file-tree_traversal-md
    

    Try simply linking to #file-tree_traversal-md in Notes.md. This should let you link between files, though they will both still be rendered in a single view.

    Gists are designed for quick snippets, not documentation. Maybe you are looking for GitHub wikis? Wikis can be cloned via Git, managed locally, and pushed back, and they render pages one at a time.

    Or possibly GitHub Pages, which can be used to host static websites?