-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from tasuren/develop
update: ドキュメント生成にJinja2とmizuを使うようにした。
- Loading branch information
Showing
11 changed files
with
111 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# mizu - Build documentation | ||
|
||
from mizu import parse | ||
from jinja2 import Template, Environment, FileSystemLoader | ||
|
||
env = Environment(loader=FileSystemLoader('.'), trim_blocks=False) | ||
template = env.get_template('main.tpl') | ||
with open("main.md", "r") as f: | ||
raw = f.read() | ||
text = template.render(content=parse(raw)) | ||
with open("index.html", "w") as f: | ||
f.write(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document of mizu</title> | ||
</head> | ||
<body><h1>mizu</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# mizu 💧 | ||
|
||
[![Version](https://img.shields.io/pypi/v/mizu)](https://pypi.org/project/mizu/) | ||
[![Downloads](https://pepy.tech/badge/mizu)](https://pepy.tech/project/mizu) | ||
[![Downloads](https://pepy.tech/badge/mizu/month)](https://pepy.tech/project/mizu) | ||
[![Downloads](https://pepy.tech/badge/mizu/week)](https://pepy.tech/project/mizu) | ||
|
||
Mizu is markdown parser, written by rust and used [pulldown-cmark](https://github.com/raphlinus/pulldown-cmark). | ||
|
||
## Installation | ||
|
||
```sh | ||
pip install mizu | ||
``` | ||
|
||
Or | ||
|
||
```sh | ||
pip install "mizu @ git+https://github.com/tuna2134/mizu" | ||
``` | ||
|
||
## Examples | ||
```py | ||
from mizu import parse | ||
|
||
|
||
parse("# Hello tuna2134") | ||
``` | ||
|
||
Extension: | ||
```py | ||
from mizu import parse_ext | ||
|
||
|
||
parse_ext(""" | ||
- [ ] test | ||
- [ ] test2 | ||
""") | ||
``` | ||
|
||
## API Reference | ||
### `parse` | ||
This function is parse markdown to html. | ||
|
||
**PARAMETERS:** | ||
text (`str`) – Markdown content. | ||
|
||
**RETURNS:** | ||
Html content. | ||
|
||
**RETURN TYPE:** | ||
str | ||
|
||
## `parse_ext` | ||
This function is parse markdown to html. | ||
|
||
**PARAMETERS:** | ||
text (`str`) – Markdown content. | ||
tables (`Optional[bool]`) – Enable tables. | ||
footnotes (`Optional[bool]`) – Enable footnotes. | ||
strikethrough (`Optional[bool]`) – Enable strikethrough. | ||
tasklists (`Optional[bool]`) – Enable tasklists. | ||
smart_punctuation (`Optional[bool]`) – Enable smart_punctuation. | ||
heading_attribute (`Optional[bool]`) – Enable heading_attribute. | ||
|
||
**RETURNS:** | ||
Html content. | ||
|
||
**RETURN TYPE:** | ||
str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document of mizu</title> | ||
</head> | ||
<body>{{ content }}</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sphinx | ||
furo | ||
mizu | ||
Jinja2 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.