Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/feakin/writing
A document-code sync tools for document engineering. Writing 是一个自动 “文档-代码” 同步工具。解析 Markdown 中的代码定义,读取目标代码,并嵌入到新的文档中。
https://github.com/feakin/writing
documentation documentation-generator markdown
Last synced: 2 months ago
JSON representation
A document-code sync tools for document engineering. Writing 是一个自动 “文档-代码” 同步工具。解析 Markdown 中的代码定义,读取目标代码,并嵌入到新的文档中。
- Host: GitHub
- URL: https://github.com/feakin/writing
- Owner: feakin
- Created: 2021-10-22T11:59:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-25T11:32:22.000Z (over 3 years ago)
- Last Synced: 2024-08-07T23:47:35.118Z (6 months ago)
- Topics: documentation, documentation-generator, markdown
- Language: Rust
- Homepage:
- Size: 66.4 KB
- Stars: 18
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
Awesome Lists containing this project
- my-awesome - feakin/writing - generator,markdown pushed_at:2021-10 star:0.0k fork:0.0k A document-code sync tools for document engineering. Writing 是一个自动 “文档-代码” 同步工具。解析 Markdown 中的代码定义,读取目标代码,并嵌入到新的文档中。 (Rust)
README
# Writing
> A document-code sync tools for document engineering. Writing 是一个自动 “文档-代码” 同步工具。解析 Markdown 中的代码定义,读取目标代码,并嵌入到新的文档中。
Language parse support by [guarding](https://github.com/inherd/guarding) with [tree-sitter](https://github.com/tree-sitter/tree-sitter), current supported language: Java, JavaScript, Rust
## Usage
### Install
install with Rust Cargo
```
cargo install writing
```or download from: [release](https://github.com/inherd/writing/releases)
### Run
usage:
```
writing -p README.md
```all command:
```bash
OPTIONS:
-h, --help Print help information
-i, --input [default: README.md]
-o, --output [default: out.md]
-V, --version Print version information
```## Samples
by Lines
```writing
// doc-code: file("src/lib.rs").line()[1, 5]
```by Section
```writing
// doc-section: file("src/lib.rs").section("section1")
```by Function
```writing
// doc-func: file("src/lib.rs").func()["pre_process_file", "process_file"]
```````custom image
```graphviz?
Graphviz
```
````## Development
setup:
1. `git clone https://github.com/inherd/writing`
2. `cargo build`others: parser with [pest](https://github.com/pest-parser/pest)
process:
1. read markdown file
2. filter by line with ends_with `// doc-***`
3. parse `// doc-**` from `[writing.pest](src/parser/writing.pest)`
4. read code
5. generate output### Grammar
see in [writing.pest](src/parser/writing.pest)
### Documents
[API 库的文档体系支持:主流编程语言的文档设计](https://www.phodal.com/blog/api-ducumentation-design-dsl-base/)
[文档工程体验设计:重塑开发者体验](https://www.phodal.com/blog/documentation-enginnering-experience-design/)
License
---@ 2021 This code is distributed under the MIT license. See `LICENSE` in this directory.