Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save suewonjp/7493de784f4a88c63d1810031609ee35 to your computer and use it in GitHub Desktop.
Save suewonjp/7493de784f4a88c63d1810031609ee35 to your computer and use it in GitHub Desktop.
Edit and review github wiki on your local machine
First, clone your github wiki to your local machine
  1. Checkout your repository wiki via git.
     - You can find the URL at the lower-right of your wiki page (look for the label "Clone this wiki locally")
  2. Now that you have pulled down a local copy of your github repo wiki, create a new file in the repo called _Sidebar.md  - Note that other names might not work.
  3. Within the newly created _Sidebar.md file, you can add appropriate [[link]] markdown syntax.
  4. Add your new file to the local repository, and push via git push origin master.

With the same procedure, you can add a header(_Header.md) and footer(_Footer.md) file.

For more details, refer to https://help.github.com/articles/adding-and-editing-wiki-pages-locally/
Also, for a complete example, refer to https://github.com/suewonjp/civilizer/wiki

Install gollum
  • Prerequisites
    • Ruby, RubyGem
  • install gollum
  • gem install gollum
    • This may not go well at the 1st attempt;
    • On OS X, I needed to install icu4c package ( by running brew install icu4c )
  • review your wiki
    1. Navigate to your git repository (wiki) via the command line.
    2. Run: gollum
    3. Open http://localhost:4567 in your browser.

For more details, refer to https://github.com/gollum/gollum

Extra

If you're a Vim user, then create a .vimrc in your local wiki directory, and add the following commands

set filetype=markdown

:nnoremap <f8> :wa \| !gollum > /dev/null 2>&1 &<CR>

:nnoremap <f9> :!kill $( pgrep -f gollum )<CR>

Now you can start the gollum server by pressing F8, and kill it by pressing F9 in your Vim.

@briandant
Copy link

See also the official install docs at the Gollum wiki: https://github.com/gollum/gollum/wiki/Installation

@atrenton
Copy link

atrenton commented Jul 2, 2020

I recently created a wiki on my Windows PC using Gollum 5.0 in a Docker container. Much to my surprise, I found that the GitHub wiki version of Gollum does not support a number of features. Here's a list of features found in Gollum 5.0 release notes that don't work after pushing the wiki to GitHub:

  • _Header.md not recognized
  • Support for wiki_options in config.rb
  • YAML front matter metadata: E.G. title instead of H1 title
  • Support special attributes when linking internal images: E.G. [[/images/logo.png|align=center]]
  • Standard Macro support:
    • <<Navigation>>
    • <<Video>>
    • <<Note>>
    • <<Octicon>>

I have posted this info in feedback to GitHub support but have not had a response from them yet.

@tyn1998
Copy link

tyn1998 commented Oct 18, 2022

I'm using a M1 Mac and this works for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment