Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to structure GitHub wiki files?

I have cloned one of my GitHub project's wiki locally, and I want to restructure the file system. By default different pages added to the wiki are all created in the parent directory:

/wiki
     home.md
     wiki_page_1.md
     ...

I want have a directory structure similar to this:

/wiki
  /setup
    setup_procedures.md
    index.md
  /development
    index.md
    tools.md
  /images
    front_page.png

I've tried to structure my wiki files similarly, but it's not working for the .md files. However, it works for the images folder. Is there a way to make this work?

like image 582
tsega Avatar asked Jun 16 '14 04:06

tsega


People also ask

Can you use HTML in GitHub wiki?

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for.

Can you fork a GitHub wiki?

You can't fork it directly on GitHub, but you can get Git access to it by going into the Git access tab of the wiki and you should be able to fork it on your local machine and edit it as much as you want (and even get updates to it!)

How do I clone a wiki from GitHub?

The Wiki pages are managed as a repository. So click on your repository, then on the left side click on Wiki. Finally on the upper right corner click on Clone Repository. There you will clear instructions on how to clone it correctly.


3 Answers

If GitHub is still using github/gollum, then, as explained in "How can you use subdirectories in a GitHub wiki checkout?", subfolders are not supported (or were buggy at the time of the fork).

More recent versions of gollum/gollum supports that organization, even though recent PR (Pull Requests) are still fixing issues around it (like PR 787).

The OP tsega adds in the comments:

tried to look into the Gollum wiki myself and it turns out you can organize your files under directories but that will not be how you access them.

Every page is accessed from the root of the wiki,e.g. github.com/user/repo/wiki/file-name not github.com/user/repo/wiki/directory/file-name.

The file names should be unique, and if you want to have proper titles they need to be capitalized and dashed (not underscored).

like image 58
VonC Avatar answered Sep 23 '22 19:09

VonC


I've just hit the same problem and I've solved it (kinda) using a custom menu bar, and using regular Markdown, i.e. headers and links to create a folder structure.

like image 29
Felipe Avatar answered Sep 25 '22 19:09

Felipe


In 2022 this is still not possible.
Please upvote this feature request 👈

like image 39
Floris Devreese Avatar answered Sep 23 '22 19:09

Floris Devreese