0.2.17 • Published 12 months ago

quickref-cli v0.2.17

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Quickrefs CLI

该项目是在refs-cli的基础上做的改进,用于帮助快速搭建博客网站,它能扫描 .md 文件并打包生成样式美观的 .html 文件

使用方法

1、安装

npm i quickref-cli -g

2、按要求严格创建项目目录

├─input
├─attachments
├─README.md
└─.refsrc.json
名字描述备注
input输入目录可自定义名字;里面的.md将被打包成.html
attachments附件目录可自定义名字
README.md博客首页不可自定义名字;将被打包成index.html
.refsrc.json配置文件不可自定义名字

指令

Usage: quickref-cli [output-dir] [--help|h]
  Displays help information.

Options:
  --help, -h      Displays help information.
  --version, -v   Show version number
  --watch, -w     Watch and compile Markdown files.

Example:
  $ npm i quickref-cli -g
  $ quickref-cli
  $ quickref-cli -w

quickrefs-cli@v1.0.0

.refsrc.json配置

{
    "title": "Quick Reference",
    "description": "{{description}}. Sharing Quick Reference Cheat Sheets for Developers",
    "keywords": "reference-cli,reference,refs-cli,refs,cli",
    "data-info": "👆👆need your participation",
    "search": {
        "label": "搜索",
        "placeholder": "请输入搜索内容",
        "cancel": "取消"
    },
    "editor": {
        "label": "编辑",
        "disabled": true
    },
    "github": {
        "url": "https://github.com/yacshy/yacshy.github.io"
    },
    "inputDir": "./refs",                     // 输入目录
    "outputDir": "./docs",                    // 输出目录
    "attachmentDir": "./attachments",         // 附件目录
    "server": {                               // 在本地8181启动一个服务器,热更新,方便一边写一遍看
        "port": 8181,                            // 服务器端口
        "root": "./docs",                        // 在哪个目录下启动服务器?(一般和输出目录保持一致)
        "file": "index.html"                     // 服务器入口页面(一般是index.html)
    }
}

语法

为了创建你想要的、美观的博客,我们还需要掌握一些“语法”,不然你就只能创建简单的博客网站,尽管这个脚手架打包后的默认样式已经挺美观的了,但我仍然建议了解一点简单的语法