Git Product home page Git Product logo

minoriwiki's Introduction

MinoriWiki

MinoriWiki

MinoriWiki is a static Wiki site Generator npm version

Currently under development - PRs welcome

Usage

  1. Install via NPM: npm install minori -g
  2. Create an empty directory
  3. minori init
  4. Edit config.yml to fit your needs
  5. Use minori note [filename] to create new note or edit existing one, you can also use api/data for filename to create directories
  6. Deploy your files generated under site directory (Default to wiki) to production environment with command minori commit.

Directories

  • source (defaults to notes) directory contains all note markdown files
  • static (defaults to static) directory will be copied to site directory, you could store any static files that may be used in your wiki site.
  • site (defaults to wiki) directory contains generated site files.

If you are going to change the site directory, just rename the wiki folder to keep Git objects.

Commands

  • minori init or minori i - Init under current working directory
  • minori note [filename] or minori n [filename] - Create or edit note
  • minori done or minori d - Generate site files
  • minori commit or minori c - Commit changes and deploy to production environment
  • minori updatecfg or minori u - Update current config.yml file with the new version installed. New config file will written to config.yml.new.
  • minori server or minori s - Start a static file server to preview your wiki site locally.

Theme

Theme is customizable. Theme directory should contain:

  • assets directory to store style sheets, scripts, fonts, etc.
  • index.ejs is the homepage template.
  • page.ejs is the post page template.
  • changes.ejs is the changelog page template.

The following variables are passed to EJS:

  • config - the parsed config.yml object
  • categories - Array of category object:
[
	{
		"name": "uncategoried",
		"pages": [
			{
				"title": "page title",
				"link": "page-file-name",
				"category": "uncategoried",
				"time": 1471234567890,
				"content": "parsed html"
			},
			...
		]
	},
	...
]
  • page - {} in homepage and the specified page object in post page.

When parsing changelog page, the commits object is passed:

[
    {
        hash: '2765ac1dea7f8080048d6f603683615b2f2c2c78',
        abbrevHash: '2765ac1',
        subject: 'update test.md',
        committerName: 'foo bar',
        committerDate: 'Tue Dec 1 15:48:53 2015 +0800',
        status: [ 'M' ],
        files: [ 'test.md' ]
    }, {
        hash: '9bf21ee34231208fd2e24469b7472b54df3954182',
        abbrevHash: '9bf21ee',
        subject: 'update',
        committerName: 'foo bar',
        committerDate: 'Tue Dec 1 15:26:06 2015 +0800',
        status: [ 'M' ],
        files: [ 'test.md' ]
    }
]

Speed

For 1200 * Format Test Page in 3 different categories:

  • with MathJax
~> time minori d
minori d  70.00s user 1.42s system 105% cpu 1:07.76 total
  • without MathJax
~> time minori d
minori d  10.91s user 1.01s system 105% cpu 11.320 total

Tested on a ThinkPad X1 Carbon 2015 (i7-5600U / 16G RAM / 512G NVMe) with Arch Linux.

License

MIT.

minoriwiki's People

Contributors

blacate avatar phoenixlzx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minoriwiki's Issues

是否能支持多级标签?

首先感谢作者的工作![\花]
能不能加入对多级标签的支持?
这样issue里多级文件就可以不用显示目录名了^ ^

  • programming
    • javascript / grammar
    • javascript / tools

  • programming
    • javascript
      • grammar
      • tools
    • python

下面这个应该会好看点吧>

Maybe a bug when paring config file?

For example, in config.yml

# Custom
custom:
  time: YYYY-MM-DD HH:mm:ss
  disqus:
  markdown:
    gfm: true
    pedantic: false
    sanitize: false
    tables: true
    breaks: true
    smartLists: true
    smartypants: true
  editor:subl    #I missed a blank after ':' 

it comes a error when minori note:

/usr/local/lib/node_modules/minori/lib/note.js:42
    var file = path.resolve(cwd + '/' + config['dir'].source + '/' + filename + '.md');
                                                     ^

TypeError: Cannot read property 'source' of undefined
    at module.exports (/usr/local/lib/node_modules/minori/lib/note.js:42:54)
    at /usr/local/lib/node_modules/minori/lib/index.js:28:21
    at /usr/local/lib/node_modules/minori/lib/index.js:76:13
    at FSReqWrap.oncomplete (fs.js:82:15)

The error messages are the same no matter where the missing blank is.

I'm not sure whether you have already known about this problem?

Can't install by NPM

Hi,

i did the npm install minori -g, and it print this:

npm ERR! fetch failed https://github.com/mathjax/MathJax/tarball/mathjax-node-2.5.1
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 192.30.252.161:443
⸨    ░░░░░░░░░░░░░░⸩ ⠧ loadRequestedDeps: WARN retry will retry, error on last a⸨    ░░░░░░░░░░░░░░⸩ ⠦ loadRequestedDeps: WARN retry will retry, error on last attempt: Error: connec⸨    ░░░░░░░░░░░░░░⸩ ⠇ loadRequestedDeps: WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 192.30.252.161:443

and I can install other package via npm.
I'm a newbie to Node, do you know what is the issue here?

是否支持文件夹?

比如这样:
minori note uc/account_login

因为API比较多 如果全一个文件夹看着太奇怪了……

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.