Skip to content

epsil/mdwiki

Repository files navigation

Markdown wiki

A wiki written in Markdown.

Organization

The wiki has the following file structure:

. |-- index.md |-- index.html |-- page | |-- index.md | `-- index.html `-- anotherpage |-- index.md `-- index.html 

Every page has its own folder, and folders can be nested. The page's contents are stored in a Markdown file named index.md. There is also an associated index.html file, which uses JavaScript to render the Markdown as HTML when opened in a browser.

One of several benefits of this file structure is that the whole wiki can be served as a web page. Every page gets its own URL:

URL Page
/ root
/page/ page
/anotherpage/ anotherpage

Simply upload the wiki to a server, or serve it locally. To do the latter, run npm run http.

One can also open index.html files directly from disk, although this only works in Firefox; other browsers require a HTTP server running.

Versioning

The wiki uses Git to keep track of changes. The wiki is a regular Git repository, and standard Git commands work as one would expect.

It is optional, but highly recommended, to set up a remote repository for the wiki.

Editing

A wiki page is edited by opening its index.md file in a text editor, making changes, and committing them with Git. A shorthand command for this is npm run commit (requires Node). To synchronize the changes, one can use npm run push. One can also use standard Git commands (git commit and git push) for the same task.

The wiki can be edited online simply by hosting the repository at GitHub, BitBucket or a similar service. These websites lets one edit Markdown files via a web interface.

Markup

The wiki is written in Markdown (Pandoc flavor).

The wiki supports metadata in the form of a YAML block:

--- title: Page title author: Page author --- This is a page written in **Markdown**.

The wiki uses markdown-it for its Markdown parser, which is customizable with extensions.

Styling

By default, the wiki uses Bootstrap to provide responsive CSS styling.

One can add custom CSS styling to a page by adding a stylesheet file to the page's directory:

. `-- page |-- index.md |-- index.html `-- style.css 

Then reference the file in the page's metadata block:

--- title: Page title author: Page author css: style.css ---

Images

To add an image to a page, put it in the page's folder:

. `-- page |-- index.md |-- index.html `-- image.jpg 

Then reference it with the standard Markdown image syntax:

![](image.jpg)

Future compatibility

Markdown is a light-weight markdown language, and Markdown files are plain text. As such, they are human readable.

Markdown can also be converted to a host of other formats with Pandoc, whether to other markup languages or to more conventional formats like Microsoft Word.

About

Markdown wiki

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published