9

Librarian: 帮你快速一键启动一个markdown站点

 4 years ago
source link: https://studygolang.com/articles/28504
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

有时候我们写的文档,想要发布到公网或局域网上,分享给他人。当你不想花时间在纠结怎么搭建网站,下载各种依赖等等。那么 Librarian 也许可以帮到你。Librarian 可以一键启动一个 markdown 站点,你只需要写好 markdown 文档,以及设置目录yml。

github地址: https://github.com/GoAdminGroup/librarian

使用

下载Librarian

文件名 系统 系统架构 大小 librarian_darwin_x86_64_v0.0.1.zip macOS x86-64 11.1 MB librarian_linux_x86_64_v0.0.1.zip Linux x86-64 14.6 MB librarian_linux_armel_v0.0.1.zip Linux x86 13.9 MB librarian_windows_i386_v0.0.1.zip Windows x86 14.1 MB librarian_windows_x86_64_v0.0.1.zip Windows x86-64 14.5 MB

设置数据库

下载 librarian.db ,并放置于项目文件夹下。

设置目录

设置好目录,编写一个 nav.yml ,放置于文档文件夹下:

nav:
  - 介绍: README.md
  - 准备工作: installation.md
  - 快速开始: quick_start.md

运行

我们的文件夹结构如下,docs是放置markdown文档的地方。

.
├── docs
│   ├── ...
│   └── nav.yml
├── librarian.db
└── librarian

接着我们执行:

./librarian --port=9055 --path=./docs

访问: http://localhost:9055/docs

可以看到:

6r22iyR.png!web

关于 librarian 更多命令行参数,可以执行:

./librarian --help

欢迎关注我们的微信公众号,每天学习Go知识

FveQFjN.jpg!web

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK