LsBook
无法忍受 gitbook 龟速的生成速度,决定自己写一个用于书写自己的书籍生成器。
一切参照 gitbook,只为加快网站的生成速度。
只支持 md 语法:CommonMark 规格
项目示例:https://github.com/liushilive/github_software_testing_dictionary
部署
部署 python,安装 lsbook
pip install lsbook
使用
lsbook -b --log debug <book> <output>
编辑 book.json
{
"author": "作者",
"title": "书籍标题",
"language": "zh-cn",
// ar bn ca cs de el en es fa fi fr he it ja ko nl no pl pt ro ru sv tr uk ui zh-cn zh-hans zh-tw
"github_url": "主页地址",
"ignore": [
".git",
".svn",
"要排除的文件与文件夹"
]
}
数学公式使用
支持 KaTeX 已支持的全部符号。
-
内联数学公式:
$$\int_{-\infty}^\infty g(x) dx$$ $$\fcolorbox{red}{aqua}{A}$$ $$\textcolor{#228B22}{F=ma}$$ -
块级数学公式:
$$ \def\arraystretch{1.5} \begin{array}{c|c:c} a & b & c \\ \hline d & e & f \\ \hdashline g & h & i \end{array} $$
流程图使用
-
支持 mermaid 以支持的流程图。
```mermaid graph TD; A-->B; A-->C; B-->D; C-->D; ```
代码高亮支持
采用 prism 支持所有官方支持语言。
鼠标悬浮可见
用法:把要隐藏文本内容放在
{%s%}和{%ends%}之间。
{%s%}Hello World.{%ends%}
点击隐藏或显示片段
可以使用标签定义一个新的片段:(默认隐藏),不支持嵌套
<!--sec title="点我隐藏答案" show=true ces-->
B
<!--endsec-->
<!--sec title="点我看分析" show=false ces-->
CPU
<!--endsec-->
<!--sec title="点我看分析" ces-->
C
<!--endsec-->
本标签包含以下参数:
- title:标题
- show:是否初始隐藏
导入外部代码文件
@import "你的代码文件" {语言}
@import "你的代码文件"
如果没有指明相关语言,将默认根据文件后缀推断语言。
如果文件为 markdown,将直接引入文件中内容。文件中图片会导入到当前项目中。
自定义 js
书籍目录下创建 book.js 文件保存自定义 js 内容。
内容将在页面加载后运行。
Metadata
Release files for LsBook 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| LsBook-2.0.3.tar.gz | 5.9 MB | Without provenance | Details for LsBook-2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| LsBook-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for LsBook-2.0.3-py3-none-any.whl |
Total release size: 11.9 MB
Release files / LsBook-2.0.3.tar.gz
| Download URL | LsBook-2.0.3.tar.gz |
|---|---|
| Size | 5.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05acafcaaadf46c24be43954b01b9a1bdd59839aedb3a7cbcf40dc881fdbb08f
|
|
BLAKE2b-256 checksum How to use checksums |
f308097c575d88a417eef7faf66d38c1d2f0bf2df7a16ff7e1b59fe4dbb173b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / LsBook-2.0.3-py3-none-any.whl
| Download URL | LsBook-2.0.3-py3-none-any.whl |
|---|---|
| Size | 6.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9600043fd511f6e82abbb2be4a392c95324dd95e6862e0689aee0162eb19ae6
|
|
BLAKE2b-256 checksum How to use checksums |
b2a9a9c1be00fac85f79256c293205eff7ea54110c9bb151b3c053de98a5e7bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for LsBook 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.