diff --git a/.github/workflows/mnbook.yml b/.github/workflows/mnbook.yml
deleted file mode 100644
index 600f37b..0000000
--- a/.github/workflows/mnbook.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-# @2023 凹语言 作者。保留所有权利。
-
-name: MnBook
-on:
- pull_request:
- push:
- branches:
- - main
- - master
- - "releases/*"
-jobs:
- build-and-test-ubuntu:
- runs-on: ubuntu-latest
- steps:
- - name: Git checkout
- uses: actions/checkout@v2
-
- - name: Set up Go
- uses: actions/setup-go@v2
- with:
- go-version: 1.21
-
- - run: go version
- - run: go env
-
- - run: go test ./...
-
- Publish:
- runs-on: ubuntu-latest
- if: ${{github.repository == 'wa-lang/mnbook'}}
- needs: [Test]
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- with:
- fetch-depth: 0
- - name: Set up Go
- uses: actions/setup-go@v2
- with:
- go-version: 1.21
- - name: Run GoReleaser
- uses: goreleaser/goreleaser-action@v4
- with:
- distribution: goreleaser
- version: latest
- args: release --clean
- env:
- GITHUB_TOKEN: ${{ secrets.WA_DEPLOY }}
diff --git a/.github/workflows/wabook.yml b/.github/workflows/wabook.yml
new file mode 100644
index 0000000..0797544
--- /dev/null
+++ b/.github/workflows/wabook.yml
@@ -0,0 +1,26 @@
+# @2023 凹语言 作者。保留所有权利。
+
+name: waBook
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - "releases/*"
+jobs:
+ build-and-test-ubuntu:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Git checkout
+ uses: actions/checkout@v2
+
+ - name: Set up Go
+ uses: actions/setup-go@v2
+ with:
+ go-version: 1.21
+
+ - run: go version
+ - run: go env
+
+ - run: go test ./...
diff --git a/Makefile b/Makefile
index 9100091..d0072ec 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ debug:
-rm -rf ./testdata/_book
go run main.go build ./testdata && cd ./testdata && mv book _book_go
- cd ./testdata && mnbook build && mv book _book
+ cd ./testdata && wabook build && mv book _book
cd ./testdata && mv _book_go book
clean:
diff --git a/README-zh.md b/README-zh.md
new file mode 100644
index 0000000..e81f97a
--- /dev/null
+++ b/README-zh.md
@@ -0,0 +1,119 @@
+
+
waBook: 简单的 Markdown 图书构建工具.
+
+[简体中文](https://github.com/wa-lang/wabook/blob/master/README-zh.md) | [English](https://github.com/wa-lang/wabook/blob/master/README.md)
+
+
+
+
+
+[![Build Status](https://github.com/wa-lang/waBook/workflows/CI/badge.svg?event=push)](https://github.com/wa-lang/waBook/actions?workflow=CI)
+[![Coverage Status](https://coveralls.io/repos/github/wa-lang/wabook/badge.svg)](https://coveralls.io/github/wa-lang/wabook)
+[![GitHub release](https://img.shields.io/github/v/tag/wa-lang/wabook.svg?label=release)](https://github.com/wa-lang/wabook/releases)
+[![license](https://img.shields.io/github/license/wa-lang/wa.svg)](https://github.com/wa-lang/wa/blob/master/LICENSE)
+
+
+
+## 特性
+
+- 支持 Markdown 格式的电子书构建
+- 支持 Markdown 格式的幻灯片构建
+- 支持基于 Github Discuss 的留言功能
+- 电子书支持自定义 页眉/页脚
+
+## 案例
+
+使用 [waBook](https://github.com/wa-lang/wabook) 构建的图书列表:
+
+- 《Go语言圣经》: https://gopl-zh.github.io
+- 《Go语言高级编程》: https://github.com/chai2010/advanced-go-programming-book
+- 《Go语言定制指南》: https://github.com/chai2010/go-ast-book
+- 《µGo语言实现(从头开发一个迷你Go语言编译器)》: https://github.com/wa-lang/ugo-compiler-book
+- 《凹语言手册》: https://wa-lang.org/man/
+- 《Wa-lang's Manual》: https://wa-lang.github.io/man/en/
+- 《VS Code插件开发》: https://chai2010.cn/vscode-extdev-book/
+- 《Go语言圣经读书笔记》: https://github.com/chai2010/gopl-notes-zh
+
+## 安装
+
+```
+$ go install github.com/wa-lang/wabook@latest
+```
+
+## 命令行
+
+```
+$ wabook
+NAME:
+ wabook - A tool for build mini markdown book
+
+USAGE:
+ wabook [global options] command [command options] [arguments...]
+
+COMMANDS:
+ init Creates a new book
+ build Builds a book from its markdown files
+ serve Serves a book at http://localhost:3000
+ clean Deletes a built book
+
+GLOBAL OPTIONS:
+ --help, -h show help
+
+ See "https://github.com/wa-lang/wabook" for more information.
+```
+
+- init: 初始化一个 Book 基础版本
+- build: 将 Markdown 的 Book 构建为 html
+- serve: 构建并启动服务, 方便本地查看效果
+- clean: 删除构建的 book 子目录
+
+## `book.ini` 文件
+
+不支持注释,不支持未定义属性:
+
+```ini
+[book]
+authors = ["chai2010"]
+description = ""
+language = "zh"
+src = "."
+title = "book title"
+
+[output.html]
+git-repository-icon = "fa-github"
+git-repository-url = "https://github.com/wa-lang/wabook"
+edit-url-template = "https://github.com/wa-lang/wabook/edit/master/testdata/{path}"
+```
+
+## `SUMMARY.md` 文件
+
+```md
+# Summary
+
+[Preface](preface.md)
+
+- [Chapter 1](./src/chapter_1.md)
+ - [Chapter 1.1](./src/chapter_1.1.md)
+ - [Chapter 1.2](./src/chapter_1.2.md)
+
+- [Chapter 2](./src/chapter_2.md)
+
+
+```
+
+## Markdown 文件
+
+```md
+# Chapter 1
+
+[Github Repo](https://github.com/wa-lang/wabook): `[Github Repo](https://github.com/wa-lang/wabook)`
+
+
+Image: `![](../images/video-001.png)`:
+
+![](../images/video-001.png)
+
+OK!
+```
+
+不支持内联 HTML。
diff --git a/README.md b/README.md
index 994edc3..d95894d 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,29 @@
-# Mini Markdown Book
+
+
waBook: Create book/talk from markdown files.
-简单的 Markdown 图书构建工具。
+[简体中文](https://github.com/wa-lang/wabook/blob/master/README-zh.md) | [English](https://github.com/wa-lang/wabook/blob/master/README.md)
-## 特性
-- 支持 Markdown 格式的电子书构建
-- 支持 Markdown 格式的幻灯片构建
-- 支持基于 Github Discuss 的留言功能
-- 电子书支持自定义 页眉/页脚
+
+
-## 案例
+[![Build Status](https://github.com/wa-lang/waBook/workflows/CI/badge.svg?event=push)](https://github.com/wa-lang/waBook/actions?workflow=CI)
+[![Coverage Status](https://coveralls.io/repos/github/wa-lang/wabook/badge.svg)](https://coveralls.io/github/wa-lang/wabook)
+[![GitHub release](https://img.shields.io/github/v/tag/wa-lang/wabook.svg?label=release)](https://github.com/wa-lang/wabook/releases)
+[![license](https://img.shields.io/github/license/wa-lang/wa.svg)](https://github.com/wa-lang/wa/blob/master/LICENSE)
-使用 [MNBook](https://github.com/wa-lang/mnbook) 构建的图书列表:
+
+
+## Features
+
+- Create book from Markdown
+- Create slide from Markdown
+- Create book discuss based on Github Discuss
+- Supports custom header/footer
+
+## Example
+
+Book list built using [waBook](https://github.com/wa-lang/wabook):
- 《Go语言圣经》: https://gopl-zh.github.io
- 《Go语言高级编程》: https://github.com/chai2010/advanced-go-programming-book
@@ -22,21 +34,21 @@
- 《VS Code插件开发》: https://chai2010.cn/vscode-extdev-book/
- 《Go语言圣经读书笔记》: https://github.com/chai2010/gopl-notes-zh
-## 安装
+## Install
```
-$ go install github.com/wa-lang/mnbook@latest
+$ go install github.com/wa-lang/wabook@latest
```
## 命令行
```
-$ mnbook
+$ wabook
NAME:
- mnbook - A tool for build mini markdown book
+ wabook - A tool for build mini markdown book
USAGE:
- mnbook [global options] command [command options] [arguments...]
+ wabook [global options] command [command options] [arguments...]
COMMANDS:
init Creates a new book
@@ -47,17 +59,17 @@ COMMANDS:
GLOBAL OPTIONS:
--help, -h show help
- See "https://github.com/wa-lang/mnbook" for more information.
+ See "https://github.com/wa-lang/wabook" for more information.
```
-- init: 初始化一个 Book 基础版本
-- build: 将 Markdown 的 Book 构建为 html
-- serve: 构建并启动服务, 方便本地查看效果
-- clean: 删除构建的 book 子目录
+- init: Initialize a basic version of Book
+- build: Build the Markdown Book into html
+- serve: Build and start the service to facilitate local viewing of the effect
+- clean: Delete the built book subdirectory
-## `book.ini` 文件
+## `book.ini` file
-不支持注释,不支持未定义属性:
+No annotations supported, no undefined properties supported:
```ini
[book]
@@ -69,11 +81,11 @@ title = "book title"
[output.html]
git-repository-icon = "fa-github"
-git-repository-url = "https://github.com/wa-lang/mnbook"
-edit-url-template = "https://github.com/wa-lang/mnbook/edit/master/testdata/{path}"
+git-repository-url = "https://github.com/wa-lang/wabook"
+edit-url-template = "https://github.com/wa-lang/wabook/edit/master/testdata/{path}"
```
-## `SUMMARY.md` 文件
+## `SUMMARY.md` file
```md
# Summary
@@ -89,12 +101,12 @@ edit-url-template = "https://github.com/wa-lang/mnbook/edit/master/testdata/{pat
```
-## Markdown 文件
+## Markdown file
```md
# Chapter 1
-[Github Repo](https://github.com/wa-lang/mnbook): `[Github Repo](https://github.com/wa-lang/mnbook)`
+[Github Repo](https://github.com/wa-lang/wabook): `[Github Repo](https://github.com/wa-lang/wabook)`
Image: `![](../images/video-001.png)`:
@@ -104,4 +116,4 @@ Image: `![](../images/video-001.png)`:
OK!
```
-不支持内联 HTML。
+Do not support inline HTML。
diff --git a/changelog.md b/changelog.md
new file mode 100644
index 0000000..2919bc7
--- /dev/null
+++ b/changelog.md
@@ -0,0 +1,9 @@
+# 版本日志
+
+- (dev)
+- v1.0.0 (2024-08-13)
+ - 改名为 waBook, 正式发布
+- v0.1.0 (2024-08-08)
+ - 第一个预览版本, 支持 book/talk 构建, 支持留言功能, 支持自定义页眉/页脚
+- v0.0.1 (2023-10-11)
+ - 第一个Demo版本
diff --git a/go.mod b/go.mod
index 6e4e7c7..30a6b4b 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/wa-lang/mnbook
+module github.com/wa-lang/wabook
go 1.21
diff --git a/main.go b/main.go
index c2093ba..5a85993 100644
--- a/main.go
+++ b/main.go
@@ -5,6 +5,6 @@
// A tool for build markdown book
package main
-import "github.com/wa-lang/mnbook/pkg/cmd"
+import "github.com/wa-lang/wabook/pkg/cmd"
func main() { cmd.Main() }
diff --git a/pkg/cmd/_example_book/book.toml b/pkg/cmd/_example_book/book.toml
index 749d69d..e029b39 100644
--- a/pkg/cmd/_example_book/book.toml
+++ b/pkg/cmd/_example_book/book.toml
@@ -7,5 +7,5 @@ title = "book title"
[output.html]
git-repository-icon = "fa-github"
-git-repository-url = "https://github.com/wa-lang/mnbook"
-edit-url-template = "https://github.com/wa-lang/mnbook/edit/master/testdata/{path}"
+git-repository-url = "https://github.com/wa-lang/wabook"
+edit-url-template = "https://github.com/wa-lang/wabook/edit/master/testdata/{path}"
diff --git a/pkg/cmd/cmd_build.go b/pkg/cmd/cmd_build.go
index 9daa90d..52f7374 100644
--- a/pkg/cmd/cmd_build.go
+++ b/pkg/cmd/cmd_build.go
@@ -10,8 +10,8 @@ import (
cli "github.com/urfave/cli/v2"
- "github.com/wa-lang/mnbook/pkg/mnbook"
- "github.com/wa-lang/mnbook/pkg/render"
+ "github.com/wa-lang/wabook/pkg/render"
+ "github.com/wa-lang/wabook/pkg/wabook"
)
var CmdBuild = &cli.Command{
@@ -32,7 +32,7 @@ var CmdBuild = &cli.Command{
}
func BuildBook(path string) error {
- book, err := mnbook.LoadBook(path)
+ book, err := wabook.LoadBook(path)
if err != nil {
return fmt.Errorf("LoadBook: %w", err)
}
diff --git a/pkg/cmd/main.go b/pkg/cmd/main.go
index 13099f7..b4e2694 100644
--- a/pkg/cmd/main.go
+++ b/pkg/cmd/main.go
@@ -15,7 +15,7 @@ import (
func Main() {
cliApp := cli.NewApp()
- cliApp.Name = "mnbook"
+ cliApp.Name = "wabook"
cliApp.Usage = "A tool for build mini markdown book"
cliApp.HideHelpCommand = true
cliApp.Version = func() string {
@@ -28,7 +28,7 @@ func Main() {
}()
cliApp.CustomAppHelpTemplate = cli.AppHelpTemplate +
- "\n See \"https://github.com/wa-lang/mnbook\" for more information.\n"
+ "\n See \"https://github.com/wa-lang/wabook\" for more information.\n"
cliApp.Action = func(ctx *cli.Context) error {
if ctx.NArg() > 0 {
diff --git a/pkg/render/_static/.nojekyll b/pkg/render/_static/.nojekyll
index d3ad6c2..399b53f 100644
--- a/pkg/render/_static/.nojekyll
+++ b/pkg/render/_static/.nojekyll
@@ -1 +1 @@
-This file makes sure that Github Pages doesn't process mnbook's output.
+This file makes sure that Github Pages doesn't process wabook's output.
diff --git a/pkg/render/_static/static/mnbook/FontAwesome/css/font-awesome.css b/pkg/render/_static/static/wabook/FontAwesome/css/font-awesome.css
similarity index 100%
rename from pkg/render/_static/static/mnbook/FontAwesome/css/font-awesome.css
rename to pkg/render/_static/static/wabook/FontAwesome/css/font-awesome.css
diff --git a/pkg/render/_static/static/mnbook/FontAwesome/fonts/FontAwesome.ttf b/pkg/render/_static/static/wabook/FontAwesome/fonts/FontAwesome.ttf
similarity index 100%
rename from pkg/render/_static/static/mnbook/FontAwesome/fonts/FontAwesome.ttf
rename to pkg/render/_static/static/wabook/FontAwesome/fonts/FontAwesome.ttf
diff --git a/pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.eot b/pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.eot
similarity index 100%
rename from pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.eot
rename to pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.eot
diff --git a/pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.svg b/pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.svg
similarity index 100%
rename from pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.svg
rename to pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.svg
diff --git a/pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.ttf b/pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.ttf
similarity index 100%
rename from pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.ttf
rename to pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.ttf
diff --git a/pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.woff b/pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.woff
similarity index 100%
rename from pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.woff
rename to pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.woff
diff --git a/pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.woff2 b/pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.woff2
similarity index 100%
rename from pkg/render/_static/static/mnbook/FontAwesome/fonts/fontawesome-webfont.woff2
rename to pkg/render/_static/static/wabook/FontAwesome/fonts/fontawesome-webfont.woff2
diff --git a/pkg/render/_static/static/mnbook/ayu-highlight.css b/pkg/render/_static/static/wabook/ayu-highlight.css
similarity index 100%
rename from pkg/render/_static/static/mnbook/ayu-highlight.css
rename to pkg/render/_static/static/wabook/ayu-highlight.css
diff --git a/pkg/render/_static/static/mnbook/book.js b/pkg/render/_static/static/wabook/book.js
similarity index 98%
rename from pkg/render/_static/static/mnbook/book.js
rename to pkg/render/_static/static/wabook/book.js
index 9a74c4a..0a01ff2 100644
--- a/pkg/render/_static/static/mnbook/book.js
+++ b/pkg/render/_static/static/wabook/book.js
@@ -232,7 +232,7 @@ function playground_text(playground) {
function get_theme() {
var theme;
- try { theme = localStorage.getItem('mnbook-theme'); } catch (e) { }
+ try { theme = localStorage.getItem('wabook-theme'); } catch (e) { }
if (theme === null || theme === undefined) {
return default_theme;
} else {
@@ -274,7 +274,7 @@ function playground_text(playground) {
var previousTheme = get_theme();
if (store) {
- try { localStorage.setItem('mnbook-theme', theme); } catch (e) { }
+ try { localStorage.setItem('wabook-theme', theme); } catch (e) { }
}
html.classList.remove(previousTheme);
@@ -313,7 +313,7 @@ function playground_text(playground) {
}
});
- // Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/mnbook/issues/628
+ // Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/wabook/issues/628
document.addEventListener('click', function(e) {
if (themePopup.style.display === 'block' && !themeToggleButton.contains(e.target) && !themePopup.contains(e.target)) {
hideThemes();
@@ -371,7 +371,7 @@ function playground_text(playground) {
});
sidebarToggleButton.setAttribute('aria-expanded', true);
sidebar.setAttribute('aria-hidden', false);
- try { localStorage.setItem('mnbook-sidebar', 'visible'); } catch (e) { }
+ try { localStorage.setItem('wabook-sidebar', 'visible'); } catch (e) { }
}
@@ -393,7 +393,7 @@ function playground_text(playground) {
});
sidebarToggleButton.setAttribute('aria-expanded', false);
sidebar.setAttribute('aria-hidden', true);
- try { localStorage.setItem('mnbook-sidebar', 'hidden'); } catch (e) { }
+ try { localStorage.setItem('wabook-sidebar', 'hidden'); } catch (e) { }
}
// Toggle sidebar
diff --git a/pkg/render/_static/static/mnbook/clipboard.min.js b/pkg/render/_static/static/wabook/clipboard.min.js
similarity index 100%
rename from pkg/render/_static/static/mnbook/clipboard.min.js
rename to pkg/render/_static/static/wabook/clipboard.min.js
diff --git a/pkg/render/_static/static/mnbook/cover-example.svg b/pkg/render/_static/static/wabook/cover-example.svg
similarity index 93%
rename from pkg/render/_static/static/mnbook/cover-example.svg
rename to pkg/render/_static/static/wabook/cover-example.svg
index a629c7d..bfa0dee 100644
--- a/pkg/render/_static/static/mnbook/cover-example.svg
+++ b/pkg/render/_static/static/wabook/cover-example.svg
@@ -1,6 +1,6 @@