Home

Awesome

[OBSOLETE] As of 1 Feb 2016, this project is unmaintained. I'm working on a new project soimort/pancake which will replace Mayuki.

Mayuki

Mayuki is a minimalist Markdown/YAML-based static wiki generator.

It takes over a folder and converts wiki pages (written in Markdown syntax) into HTML format suitable for publishing on a website or embedding into other web templates.

Mayuki is originally designed as a naive script to generate static HTML pages from a directory of Markdown texts on filesystem, being able to "include" code snippets for syntax highlighting by file name rather than putting the whole code in the Markdown file, and finally send to another folder to be used directly by Jekyll, the static blogging system. It can also be used standalone, by generating static HTMLs for hosting on any web server without extra configuration.

Mayuki can be used as an HTML generator for:

that can be hosted on any website.

Features:

System Requirements

Dependencies

Install Pygments:

$ sudo easy_install Pygments

or (on Arch Linux):

$ sudo pacman -S python-pygments
$ sudo easy_install-3.2 Pygments

Note: pygmentize executable must exist in $PATH (or %PATH% in Windows).

Installation

Getting Started

Hello, Mayuki!

First of all, let's create the "main" directory for our new wiki:

$ mkdir hello_mayuki
$ cd hello_mayuki/

Write some basic configuration in a file named _config.yml: we want all Liquid and Markdown syntax to be parsed, and wish the wiki system could generate full HTML files for us:

$ cat > _config.yml
_render: [liquid, markdown]
_export: [html_full]

Now it's time to write some index.html... but wait, remember Mayuki generates this for us; what we need to write is a index.md. Let's just put a line of text "Chapter 1" with a link to page ch01 on it! (Cannot remember the Markdown syntax for that? Check it here.)

$ cat > index.md
[Chapter 1](ch01)

So what's in the page "ch01"? Create a ch01 folder under the main directory with another index.md, like this: (yep, there should be a link "HOME" back to "..", the main index)

$ mkdir ch01
$ cat > ch01/index.md
Hello, Mayuki!

[HOME](..)

OK, now run Mayuki in the main directory and start a web server to see what it looks like.

$ mayuki --server

Hopefully no error is prompted; open your browser and visit:

http://localhost:4000/

Congratulations! You are running your very minimalist personal wiki now. Want to change something or create a new page? Do it in your favorite text editor. Want to share your knowledge with the world? Upload the wiki folder via FTP or rsync, or just push it onto a Git server hosting web pages! (GitHub or Bitbucket)

You may want to learn some more Markdown syntax here.

Command Line Usage

Render the current directory:

$ mayuki

Render the current directory and start a web server on port 8080 (if no parameter is followed, port 4000 will be used):

$ mayuki --server 8080

The current directory is considered as the "main" directory of the wiki.

Show the version number of Mayuki:

$ mayuki --version

API Usage

Render the current directory and return the output path:

require 'mayuki'
output_dir = Mayuki::mayuki

Or render a specified directory:

Mayuki::mayuki("mysite/")

The processed directory is considered as the "main" directory of the wiki.

Directory Processing

Each directory in the "main" wiki directory will be processed recursively.

For the directory to be processed:

_config.yml

Each directory may contain one or more _conf*.yaml, _conf*.yml configuration file.

If no configuration file matched those name patterns is found, the global configuration (the one used in the "main" directory) will be applied; If no global configuration is found in the main directory, the default configuration below will be used.

Default configuration:

Syntax Highlighting

Suppose you have a test.rb source file in the same directory with the Markdown file. Then include a line in the Markdown text:

{{ "test.rb" | src: "ruby" }}

This way you "import" the syntax-highlighted source code into this wiki page, using Ruby lexer.

The string parameter specifies the name of lexer. It's the same as the short name used in Pygments (Check here for the complete list).

Without specifying a language lexer, you may just use:

{{ "test.rb" | code }}

And let Pygments decide itself which lexer to use by filename patterns.

Licensing

Mayuki is released under the MIT license. See the LICENSE file for details.

Last Revision: 2012-06-22, by Mort Yao