Is it possible to include contents of a wiki page in another wiki page? - github

Is it possible with the Github wiki to include the contents of another wiki page in a wiki page?

Not directly.
Yo would need to use a preprocessor in order to include or embed one document in another.
See for instance gajus/gitdown:
Gitdown adds additional functionality (generating table of contents, including documents, using variables, etc.) to GitHub Flavored Markdown.
In your case: Include file.

Related

How to make a book using Jekyll on github.io

I have about 1000 regular static html pages in the GitHub repository (book). I regularly edit these pages using a special program. Each page contains only content; no header, footer or table of contents.
I want to use Jekyll to host them on Github Pages so that each page has a header, footer and a navigation block - a tree-like table of contents on the left side of browser. The table of contents is also a prepared static html file, common for the entire book.
The easiest way is to use frames, but this is not considered the best option.
I want the result to be something like https://rust-lang-nursery.github.io/rust-cookbook/
I have scanned github (search all repositories for _config.yml file) but have not found any similar use of Jekyll.
Can I do something like this using Jekyll?
This is an ideal use-case for a static site generator like Jekyll:
You might need to convert your content to Markdown or clean them up depending on the HTML
Each page has a common layout with the header, footer and navigation
You can make a separate page for table of contents by iterating over your pages inside a separate template
There's not really a concise answer here, short of learning more of Jekyll's feature set to become familiar with the concepts referenced above:
https://jekyllrb.com/docs/
https://cloudcannon.com/community/learn/jekyll-101/
Here's a template with a live demo that is made for hosting a book. You could use this as a starting point: https://github.com/CloudCannon/author-jekyll-template

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:
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
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?
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?

Generate github pages with navigation elements

I have a project on github that includes a number of markdown files (introduction, user guide, examples, reference).
I want to create a website using Github Pages based on these files that also includes a navigation element of some sorts, like a simple sidebar containing links to all the generated pages.
It seems that, out-of-the-box, pages generated with Github Pages are all stand-alone with no way to navigate between them.
Is there an easy way to achieve this, or is this use case too complicated for github pages? The documentation seems to be lacking on this point.
The Markdown to link to pages within the same folder
[__PageA__](PageA.md)
[__PageB__](PageB.md)
To link to pages in other folders just put in the relative link like this
[__PageC__](FolderC/PageC.md)
[__PageX__](../../PageX.md)
This works for files hosted on GitHub ... how you then use these to generate a standalone website you would need a tool that converts Markdown to HTML, something I have not looked into.

How to create documentation linked with GitHub?

I was just reading this elasticsearch link. I found edit option with every heading which was redirecting me to GitHub website. I know git provides wiki option with every account but that is hosted on GitHub only and supports limited features.
How can I make documentation like this that is linked to GitHub?
It looks like they're using AsciiDoc and just put the repository on Github.
The edit links don't appear to be a special feature of AsciiDoc. They're simple URLs of the form https://github.com/<owner>/<repo>/edit/5.x/<path>. Presumably someone regenerates the site after they accept a pull request.
This will work with most site generation tools, it doesn't appear to be anything specific to AsciiDoc.
I read:
https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/nest-getting-started.html
Then I want edit, it redirect to:
https://github.com/elastic/elasticsearch-net/edit/5.x/docs/client-concepts/high-level/getting-started.asciidoc
Link source code:
https://github.com/elastic/elasticsearch-net/blob/5.x/docs/client-concepts/high-level/getting-started.asciidoc
URL file:
elasticsearch-net/docs/client-concepts/high-level/getting-started.asciidoc
The different is URL parameter: edit and blob. How to create documentation linked with GitHub? So simple, use this convention when create static document file.

Is there a way to create a simple Markdown wiki with GitHub pages?

I want to use GitHub pages to write and host my own system administration wiki in Markdown.
I already created a repository with myname.github.io and placed in it only one file index.html with the text:
Hello world!
As the result I want a structured Markdown wiki, for example:
index.html
io/mdadm.md
io/lvm.md
io/disks.md
mail/postfix.md
mail/mail.md
bacula/setup.md
bacula/tips.md
bash/tips.md
system/applications/repositories.md
When I will navigate to http://myname.github.io I want to see the main page with links to another. I will create the main page in HTML manually.
When I will navigate to http://myname.github.io/system/applications/repositories or something else I want to see rendered Markdown HTML.
How can I create this layout and force GitHub to render Markdown files into HTML?
Is there a better way to use GitHub as a free wiki?
I also understand that I can use standard md files in a repository and default GitHub repository interface. But this interface is over complicated, compared to pure HTML rendered from Markdown.
You can use Jekyll, the static site generator which works very well with GitHub pages and uses Markdown out of the box.
See documentation here.