unidoc

Crates.iounidoc
lib.rsunidoc
version0.7.8
sourcesrc
created_at2022-04-03 14:28:24.724338
updated_at2024-06-26 07:17:09.144128
descriptionunidoc: Unite all Markdown
homepage
repositoryhttps://github.com/cympfh/unidoc
max_upload_size
id561315
size122,319
/c/ympfh (cympfh)

documentation

README

:magnet: unidoc: Unite all Markdown.

crates.io Build Status

Install & Usage

$ cargo install unidoc

$ cat example.md | unidoc
$ unidoc example.md -o output.md
$ unidoc input1.md input2.md input3.md -o output.md

$ unidoc --help  # for more detail

Syntax

Text

*emphasis*
_emphasis_
**strong**
__strong__
***Emphasis and Strong***
~~deleted~~

![alt](image-link-Path-or-URL)

[text](link)

`inline code`

<!-- this is hidden comment -->

Headings

% h1
# h1
## h2
### h3
...
###### h6

List

- one
- two
- three

- any bullet is ok
    + plus
        * astersk

1. ordered with numbers
2. hgoehoge

a. with alphabets
a. hogehoge

- task list
    - [ ] not yet
    - [x] already done

Paragraph, Quoting

Text blocks separated with empty lines are paragraphs.

this is paragraph1.
this is paragraph1.
this is paragraph1.

this is paragraph2.  this is paragraph2.
this is paragraph2.

> This is quoted.  This is quoted.
> This is quoted.

Code block

```
def code():
    return code
```

```python
def code():
    return code
```

Prism.js will be used for Syntax highlight. Please check this to see language support.

Table

| A | B |   C   |   D |
|---|:--| :----:| --: |
| a | b |   c   |  d  |
| 1 | 2 |   3   |  4  |

Hr

---

Extended Syntax

MathJax Support

MathJax@3 works for

$inline-math-tex$
$$display-math-tex$$

Import Another Markdown

@(./relative/another.md)

Import Code

@[rust](./sample.rs)

Hyperlink

This is inline hyperlink: [[http://example.com]].
Hyperlink as a block generates Blogcard:

{{ https://cympfh.cc/ }}

:joy: Emojis

:(emoji-shortcode):
:joy: :cry: :+1:

Github style shortcodes are available. Awesome cheatsheet is here.

Template

unidoc uses Handlebars for rendering. --template can specify your customized template file (.hbs) and -V passes free variables.

Variable (crate::template::Context)

  • title
    • PageTtitle
  • body
    • body HTML
  • headers
    • Vec of files
    • --include-in-header, -H
  • befores
    • Vec of files
    • --include-before-body, -B
  • afters
    • Vec of files
    • --include-after-body, -A
  • css
    • Vec of files
    • --css, -C
  • variables
    • HashMap<String, String>
    • --variable, -V
      • -V KEY:VALUE in CLI
      • {{variable.KEY}} in Handlebars
Commit count: 46

cargo fmt