Code Monkey home page Code Monkey logo

nico-arale's Introduction

Theme for Arale Documentation

CMD 模块可统一使用 nico-cmd 作为主题,本仓库不再维护。

这是一个为 aralejs.org 文档设计的 nico 主题。

安装

1. 安装 node

请自己安装 node。

2. 安装 nico

参考 http://lab.lepture.com/nico/zh/

另外,如果你安装了 socket.io 的话,将有 livereload 功能。

$ npm install socket.io -g

3. 安装 arale theme

Linux & Mac 用户一键安装:

curl https://raw.github.com/aralejs/nico-arale/master/bootstrap.sh | sh

Windows 用户安装:

1.切换到.spm目录

2.创建一个themes的目录并切换进入

3.从git上拉一份arale的theme

4.重命名nico-arale目录为arale

5.切换到arale目录,把里面的make.bat文件复制到一个全局PATH下(保证make命令可用即可)

P.S. 注意千万别把C:\Users\{{username}}\.spm\themes\arale目录设置为全局PATH,这样nico命令会失效,切记!

cd C:\Users\{{username}}\.spm

mkdir themes
cd themes

git clone https://github.com/aralejs/nico-arale.git

rename nico-arale arale

cd arale

使用说明

复制一份 Makefile 到你的项目下:

Windows 用户可使用 make.bat

  • make build-doc 用于生成文档。

  • make debug 是开启本地服务器,可用来预览文档,并提供自动构建和 live reload 支持。(从本地 sea-modules 中加载依赖)

  • make watch 是开启本地服务器,可用来预览文档,并提供自动构建和 live reload 支持。 (从线上加载依赖)

  • make server 普通服务器,无自动刷新功能。

  • make publish 发布站点到 gh pages,你需要安装 ghp-import

    sudo easy_install -U ghp-import
    

Windows 用户注意,如果报错,说找不到 nico,请设置环境变量 NODE_PATH。 请根据实际情况自行解决,一般来说应该设置为:

NODE_PATH = C:\Users\{{username}}\AppData\Roaming\npm\node_modules

文档编辑

nico 还会用到模块根目录下的 package.json 文件,具体项的含义请参考:spm package.json

其中 repository.url 用来生成 View the Project 链接, bugs.url 用来生成讨论链接。

特有功能

用三个 ` 会高亮显示代码

```js
function something() {
}
```

用四个 ` 会高亮显示代码,还会将代码插入到生成的 HTML 页面中

````js
function something() {
}
````

插入 iframe

````iframe
<link rel="stylesheet" href="css/some.css">
<button>click</button>
<script>
    seajs.use('jquery', function($) {
        $('button').click(function() { alert('hello'); })
    });
</script>
````

还可以设置 iframe 的高度

````iframe:400
````

生成 iframe 的模板是 templates/iframe.html,不用写头写尾。

输出

假设模块的目录结构为:

package.json
Makefile
src/
    hello-world.js
examples/
    hello-world.md
docs/
    hello-world.md
README.md

执行 make build-doc 后会生成:

package.json
Makefile
_site/
    index.html
    src/
        hello-world.js
    examples/
        hello-world.html
    docs/
        hello-world.html
src/
    hello-world.js
examples/
    hello-world.md
docs/
    hello-world.md
README.md

所有生成的文件都在 _site 目录下。

测试

nico-arale's People

Contributors

lepture avatar afc163 avatar popomore avatar lizzie avatar hotoo avatar lifesinger avatar

Watchers

andy avatar

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.