Skip to content

Commit fa6f5bf

Browse files
committed
改名为 wabook
1 parent 4e071e9 commit fa6f5bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+252
-113
lines changed

.github/workflows/mnbook.yml .github/workflows/wabook.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @2023 凹语言 作者。保留所有权利。
22

3-
name: MnBook
3+
name: waBook
44
on:
55
pull_request:
66
push:
@@ -27,8 +27,7 @@ jobs:
2727

2828
Publish:
2929
runs-on: ubuntu-latest
30-
if: ${{github.repository == 'wa-lang/mnbook'}}
31-
needs: [Test]
30+
if: ${{github.repository == 'wa-lang/wabook'}}
3231
steps:
3332
- name: Checkout
3433
uses: actions/checkout@v2

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ debug:
1717
-rm -rf ./testdata/_book
1818

1919
go run main.go build ./testdata && cd ./testdata && mv book _book_go
20-
cd ./testdata && mnbook build && mv book _book
20+
cd ./testdata && wabook build && mv book _book
2121
cd ./testdata && mv _book_go book
2222

2323
clean:

README-zh.md

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<div align="center">
2+
<h1>waBook: 简单的 Markdown 图书构建工具.</h1>
3+
4+
[简体中文](https://github.com/wa-lang/wabook/blob/master/README-zh.md) | [English](https://github.com/wa-lang/wabook/blob/master/README.md)
5+
6+
7+
</div>
8+
<div align="center">
9+
10+
[![Build Status](https://github.com/wa-lang/waBook/workflows/CI/badge.svg?event=push)](https://github.com/wa-lang/waBook/actions?workflow=CI)
11+
[![Coverage Status](https://coveralls.io/repos/github/wa-lang/wabook/badge.svg)](https://coveralls.io/github/wa-lang/wabook)
12+
[![GitHub release](https://img.shields.io/github/v/tag/wa-lang/wabook.svg?label=release)](https://github.com/wa-lang/wabook/releases)
13+
[![license](https://img.shields.io/github/license/wa-lang/wa.svg)](https://github.com/wa-lang/wa/blob/master/LICENSE)
14+
15+
</div>
16+
17+
## 特性
18+
19+
- 支持 Markdown 格式的电子书构建
20+
- 支持 Markdown 格式的幻灯片构建
21+
- 支持基于 Github Discuss 的留言功能
22+
- 电子书支持自定义 页眉/页脚
23+
24+
## 案例
25+
26+
使用 [waBook](https://github.com/wa-lang/wabook) 构建的图书列表:
27+
28+
- 《Go语言圣经》: https://gopl-zh.github.io
29+
- 《Go语言高级编程》: https://github.com/chai2010/advanced-go-programming-book
30+
- 《Go语言定制指南》: https://github.com/chai2010/go-ast-book
31+
- 《µGo语言实现(从头开发一个迷你Go语言编译器)》: https://github.com/wa-lang/ugo-compiler-book
32+
- 《凹语言手册》: https://wa-lang.org/man/
33+
- 《Wa-lang's Manual》: https://wa-lang.github.io/man/en/
34+
- 《VS Code插件开发》: https://chai2010.cn/vscode-extdev-book/
35+
- 《Go语言圣经读书笔记》: https://github.com/chai2010/gopl-notes-zh
36+
37+
## 安装
38+
39+
```
40+
$ go install github.com/wa-lang/wabook@latest
41+
```
42+
43+
## 命令行
44+
45+
```
46+
$ wabook
47+
NAME:
48+
wabook - A tool for build mini markdown book
49+
50+
USAGE:
51+
wabook [global options] command [command options] [arguments...]
52+
53+
COMMANDS:
54+
init Creates a new book
55+
build Builds a book from its markdown files
56+
serve Serves a book at http://localhost:3000
57+
clean Deletes a built book
58+
59+
GLOBAL OPTIONS:
60+
--help, -h show help
61+
62+
See "https://github.com/wa-lang/wabook" for more information.
63+
```
64+
65+
- init: 初始化一个 Book 基础版本
66+
- build: 将 Markdown 的 Book 构建为 html
67+
- serve: 构建并启动服务, 方便本地查看效果
68+
- clean: 删除构建的 book 子目录
69+
70+
## `book.ini` 文件
71+
72+
不支持注释,不支持未定义属性:
73+
74+
```ini
75+
[book]
76+
authors = ["chai2010"]
77+
description = ""
78+
language = "zh"
79+
src = "."
80+
title = "book title"
81+
82+
[output.html]
83+
git-repository-icon = "fa-github"
84+
git-repository-url = "https://github.com/wa-lang/wabook"
85+
edit-url-template = "https://github.com/wa-lang/wabook/edit/master/testdata/{path}"
86+
```
87+
88+
## `SUMMARY.md` 文件
89+
90+
```md
91+
# Summary
92+
93+
[Preface](preface.md)
94+
95+
- [Chapter 1](./src/chapter_1.md)
96+
- [Chapter 1.1](./src/chapter_1.1.md)
97+
- [Chapter 1.2](./src/chapter_1.2.md)
98+
99+
- [Chapter 2](./src/chapter_2.md)
100+
101+
<!-- comment -->
102+
```
103+
104+
## Markdown 文件
105+
106+
```md
107+
# Chapter 1
108+
109+
[Github Repo](https://github.com/wa-lang/wabook): `[Github Repo](https://github.com/wa-lang/wabook)`
110+
111+
112+
Image: `![](../images/video-001.png)`:
113+
114+
![](../images/video-001.png)
115+
116+
OK!
117+
```
118+
119+
不支持内联 HTML。

README.md

+39-27
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
# Mini Markdown Book
1+
<div align="center">
2+
<h1>waBook: Create book/talk from markdown files.</h1>
23

3-
简单的 Markdown 图书构建工具。
4+
[简体中文](https://github.com/wa-lang/wabook/blob/master/README-zh.md) | [English](https://github.com/wa-lang/wabook/blob/master/README.md)
45

5-
## 特性
66

7-
- 支持 Markdown 格式的电子书构建
8-
- 支持 Markdown 格式的幻灯片构建
9-
- 支持基于 Github Discuss 的留言功能
10-
- 电子书支持自定义 页眉/页脚
7+
</div>
8+
<div align="center">
119

12-
## 案例
10+
[![Build Status](https://github.com/wa-lang/waBook/workflows/CI/badge.svg?event=push)](https://github.com/wa-lang/waBook/actions?workflow=CI)
11+
[![Coverage Status](https://coveralls.io/repos/github/wa-lang/wabook/badge.svg)](https://coveralls.io/github/wa-lang/wabook)
12+
[![GitHub release](https://img.shields.io/github/v/tag/wa-lang/wabook.svg?label=release)](https://github.com/wa-lang/wabook/releases)
13+
[![license](https://img.shields.io/github/license/wa-lang/wa.svg)](https://github.com/wa-lang/wa/blob/master/LICENSE)
1314

14-
使用 [MNBook](https://github.com/wa-lang/mnbook) 构建的图书列表:
15+
</div>
16+
17+
## Features
18+
19+
- Create book from Markdown
20+
- Create slide from Markdown
21+
- Create book discuss based on Github Discuss
22+
- Supports custom header/footer
23+
24+
## Example
25+
26+
Book list built using [waBook](https://github.com/wa-lang/wabook):
1527

1628
- 《Go语言圣经》: https://gopl-zh.github.io
1729
- 《Go语言高级编程》: https://github.com/chai2010/advanced-go-programming-book
@@ -22,21 +34,21 @@
2234
- 《VS Code插件开发》: https://chai2010.cn/vscode-extdev-book/
2335
- 《Go语言圣经读书笔记》: https://github.com/chai2010/gopl-notes-zh
2436

25-
## 安装
37+
## Install
2638

2739
```
28-
$ go install github.com/wa-lang/mnbook@latest
40+
$ go install github.com/wa-lang/wabook@latest
2941
```
3042

3143
## 命令行
3244

3345
```
34-
$ mnbook
46+
$ wabook
3547
NAME:
36-
mnbook - A tool for build mini markdown book
48+
wabook - A tool for build mini markdown book
3749
3850
USAGE:
39-
mnbook [global options] command [command options] [arguments...]
51+
wabook [global options] command [command options] [arguments...]
4052
4153
COMMANDS:
4254
init Creates a new book
@@ -47,17 +59,17 @@ COMMANDS:
4759
GLOBAL OPTIONS:
4860
--help, -h show help
4961
50-
See "https://github.com/wa-lang/mnbook" for more information.
62+
See "https://github.com/wa-lang/wabook" for more information.
5163
```
5264

53-
- init: 初始化一个 Book 基础版本
54-
- build: Markdown Book 构建为 html
55-
- serve: 构建并启动服务, 方便本地查看效果
56-
- clean: 删除构建的 book 子目录
65+
- init: Initialize a basic version of Book
66+
- build: Build the Markdown Book into html
67+
- serve: Build and start the service to facilitate local viewing of the effect
68+
- clean: Delete the built book subdirectory
5769

58-
## `book.ini` 文件
70+
## `book.ini` file
5971

60-
不支持注释,不支持未定义属性:
72+
No annotations supported, no undefined properties supported:
6173

6274
```ini
6375
[book]
@@ -69,11 +81,11 @@ title = "book title"
6981

7082
[output.html]
7183
git-repository-icon = "fa-github"
72-
git-repository-url = "https://github.com/wa-lang/mnbook"
73-
edit-url-template = "https://github.com/wa-lang/mnbook/edit/master/testdata/{path}"
84+
git-repository-url = "https://github.com/wa-lang/wabook"
85+
edit-url-template = "https://github.com/wa-lang/wabook/edit/master/testdata/{path}"
7486
```
7587

76-
## `SUMMARY.md` 文件
88+
## `SUMMARY.md` file
7789

7890
```md
7991
# Summary
@@ -89,12 +101,12 @@ edit-url-template = "https://github.com/wa-lang/mnbook/edit/master/testdata/{pat
89101
<!-- comment -->
90102
```
91103

92-
## Markdown 文件
104+
## Markdown file
93105

94106
```md
95107
# Chapter 1
96108

97-
[Github Repo](https://github.com/wa-lang/mnbook): `[Github Repo](https://github.com/wa-lang/mnbook)`
109+
[Github Repo](https://github.com/wa-lang/wabook): `[Github Repo](https://github.com/wa-lang/wabook)`
98110

99111

100112
Image: `![](../images/video-001.png)`:
@@ -104,4 +116,4 @@ Image: `![](../images/video-001.png)`:
104116
OK!
105117
```
106118

107-
不支持内联 HTML。
119+
Do not support inline HTML。

changelog.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 版本日志
2+
3+
- (dev)
4+
- v1.0.0 (2024-08-13)
5+
- 改名为 waBook, 正式发布
6+
- v0.1.0 (2024-08-08)
7+
- 第一个预览版本, 支持 book/talk 构建, 支持留言功能, 支持自定义页眉/页脚
8+
- v0.0.1 (2023-10-11)
9+
- 第一个Demo版本

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/wa-lang/mnbook
1+
module github.com/wa-lang/wabook
22

33
go 1.21
44

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
// A tool for build markdown book
66
package main
77

8-
import "github.com/wa-lang/mnbook/pkg/cmd"
8+
import "github.com/wa-lang/wabook/pkg/cmd"
99

1010
func main() { cmd.Main() }

pkg/cmd/_example_book/book.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ title = "book title"
77

88
[output.html]
99
git-repository-icon = "fa-github"
10-
git-repository-url = "https://github.com/wa-lang/mnbook"
11-
edit-url-template = "https://github.com/wa-lang/mnbook/edit/master/testdata/{path}"
10+
git-repository-url = "https://github.com/wa-lang/wabook"
11+
edit-url-template = "https://github.com/wa-lang/wabook/edit/master/testdata/{path}"

pkg/cmd/cmd_build.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
cli "github.com/urfave/cli/v2"
1212

13-
"github.com/wa-lang/mnbook/pkg/mnbook"
14-
"github.com/wa-lang/mnbook/pkg/render"
13+
"github.com/wa-lang/wabook/pkg/render"
14+
"github.com/wa-lang/wabook/pkg/wabook"
1515
)
1616

1717
var CmdBuild = &cli.Command{
@@ -32,7 +32,7 @@ var CmdBuild = &cli.Command{
3232
}
3333

3434
func BuildBook(path string) error {
35-
book, err := mnbook.LoadBook(path)
35+
book, err := wabook.LoadBook(path)
3636
if err != nil {
3737
return fmt.Errorf("LoadBook: %w", err)
3838
}

pkg/cmd/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
func Main() {
1717
cliApp := cli.NewApp()
18-
cliApp.Name = "mnbook"
18+
cliApp.Name = "wabook"
1919
cliApp.Usage = "A tool for build mini markdown book"
2020
cliApp.HideHelpCommand = true
2121
cliApp.Version = func() string {
@@ -28,7 +28,7 @@ func Main() {
2828
}()
2929

3030
cliApp.CustomAppHelpTemplate = cli.AppHelpTemplate +
31-
"\n See \"https://github.com/wa-lang/mnbook\" for more information.\n"
31+
"\n See \"https://github.com/wa-lang/wabook\" for more information.\n"
3232

3333
cliApp.Action = func(ctx *cli.Context) error {
3434
if ctx.NArg() > 0 {

pkg/render/_static/.nojekyll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This file makes sure that Github Pages doesn't process mnbook's output.
1+
This file makes sure that Github Pages doesn't process wabook's output.

pkg/render/_static/static/mnbook/book.js pkg/render/_static/static/wabook/book.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ function playground_text(playground) {
232232

233233
function get_theme() {
234234
var theme;
235-
try { theme = localStorage.getItem('mnbook-theme'); } catch (e) { }
235+
try { theme = localStorage.getItem('wabook-theme'); } catch (e) { }
236236
if (theme === null || theme === undefined) {
237237
return default_theme;
238238
} else {
@@ -274,7 +274,7 @@ function playground_text(playground) {
274274
var previousTheme = get_theme();
275275

276276
if (store) {
277-
try { localStorage.setItem('mnbook-theme', theme); } catch (e) { }
277+
try { localStorage.setItem('wabook-theme', theme); } catch (e) { }
278278
}
279279

280280
html.classList.remove(previousTheme);
@@ -313,7 +313,7 @@ function playground_text(playground) {
313313
}
314314
});
315315

316-
// Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/mnbook/issues/628
316+
// Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/wabook/issues/628
317317
document.addEventListener('click', function(e) {
318318
if (themePopup.style.display === 'block' && !themeToggleButton.contains(e.target) && !themePopup.contains(e.target)) {
319319
hideThemes();
@@ -371,7 +371,7 @@ function playground_text(playground) {
371371
});
372372
sidebarToggleButton.setAttribute('aria-expanded', true);
373373
sidebar.setAttribute('aria-hidden', false);
374-
try { localStorage.setItem('mnbook-sidebar', 'visible'); } catch (e) { }
374+
try { localStorage.setItem('wabook-sidebar', 'visible'); } catch (e) { }
375375
}
376376

377377

@@ -393,7 +393,7 @@ function playground_text(playground) {
393393
});
394394
sidebarToggleButton.setAttribute('aria-expanded', false);
395395
sidebar.setAttribute('aria-hidden', true);
396-
try { localStorage.setItem('mnbook-sidebar', 'hidden'); } catch (e) { }
396+
try { localStorage.setItem('wabook-sidebar', 'hidden'); } catch (e) { }
397397
}
398398

399399
// Toggle sidebar

0 commit comments

Comments
 (0)