Skip to main content

markdown 静态网页生成器

Project description

RPBook

由于 gitbook 基于Nodejs单线程构建太慢了,决定自己写一个用于书写自己的书籍生成器。

一切参照 gitbook,只为加快网站的生成速度。

只支持 md 语法

部署

部署 python,安装 RPBook

pip install RPBook

使用

RPBook -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 内容。

内容将在页面加载后运行。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RPBook-1.0.19.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RPBook-1.0.19-py3-none-any.whl (6.0 MB view details)

Uploaded Python 3

File details

Details for the file RPBook-1.0.19.tar.gz.

File metadata

  • Download URL: RPBook-1.0.19.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4

File hashes

Hashes for RPBook-1.0.19.tar.gz
Algorithm Hash digest
SHA256 75be88141aacae94e8db8a2d0b4636cf33916984a164c004f199d91580725fea
MD5 7279d20c3ec910f963fdd44f65dccb3e
BLAKE2b-256 6db49d60f42fb700f3d79708d0a41e5c6dcbcd62f1ee60283e14586dfba331a4

See more details on using hashes here.

File details

Details for the file RPBook-1.0.19-py3-none-any.whl.

File metadata

  • Download URL: RPBook-1.0.19-py3-none-any.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4

File hashes

Hashes for RPBook-1.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 4797c5fc39174f373818172c6199b1bc0c9b21dc08333b89c5e86d172076d81b
MD5 9a9684d40175a8cb861acefcf25f6e41
BLAKE2b-256 369b956dcbeec20a8f2204d7c185e20c56568574b357af94d6464930d43ba04e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page