-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] Describe the doc toolchain, with examples.
Fix lint error too.
- Loading branch information
Andy Chu
committed
Oct 27, 2020
1 parent
ab0a914
commit 775e329
Showing
6 changed files
with
177 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
in_progress: yes | ||
default_highlighter: oil-sh | ||
--- | ||
|
||
Examples of HTML Plugins | ||
======================== | ||
|
||
This file is a sort of unit test for [doctools/]($oil-src). | ||
|
||
<div id="toc"> | ||
</div> | ||
|
||
## Link Shortcuts with `$` | ||
|
||
- `$xref`: [bash]($xref) | ||
- `$blog-tag`: [oil-release]($blog-tag) | ||
- `$oil-src`: [INSTALL.txt]($oil-src), [INSTALL.txt]($oil-src:INSTALL.txt) | ||
- `$blog-code-src`: [interactive-shell/README.md]($blog-code-src) | ||
- `$issue`: [issue 11]($issue:11) | ||
- `$oil-commit`: [this commit]($oil-commit:a1dad10d53b1fb94a164888d9ec277249ae98b58) | ||
|
||
|
||
## Syntax Highlighting With Markdown Code Blocks | ||
|
||
### sh-prompt | ||
|
||
```sh-prompt | ||
$ echo hi # comment | ||
hi | ||
``` | ||
|
||
### Pygments | ||
|
||
```python | ||
x = 42 | ||
print(x, file=sys.stderr) | ||
``` | ||
|
||
### `default_highlighter` in Front matter | ||
|
||
`oil-sh` is a generic formatter that works for both shell and Oil code. This | ||
is what we use in [idioms.html](idioms.html). | ||
|
||
No: | ||
|
||
pat='*.py' # pattern stored in a string | ||
echo $pat # implicit glob in shell | ||
|
||
Yes: | ||
|
||
var pat = '*.py' # Oil assignment | ||
echo @glob(pat) # explicit | ||
|
||
### Plugins We Should Have | ||
|
||
- Side-by-side sh and Oil | ||
- Side-by-side PCRE and Eggex | ||
- sh-session - How to replace the data? | ||
|
||
A shell session could look like this: | ||
|
||
<div shell="sh"> | ||
|
||
``` | ||
$ echo one | ||
$ echo two | ||
``` | ||
|
||
</div> | ||
|
||
Embeddings: | ||
|
||
- Embed Image Preview of Web Page? | ||
- Embed Github Commit? | ||
- Graphviz | ||
- LaTeX (although I don't really use it) | ||
|
||
## Related Docs | ||
|
||
- [doc-toolchain](doc-toolchain.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
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 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,14 @@ | ||
Doctools | ||
======== | ||
|
||
Tools we use to generate [Oil's documentation](../doc/). Some of this code is | ||
used to build the [the blog](//www.oilshell.org/blog/) as well. | ||
|
||
See [doc/doc-toolchain.md](../doc/doc-toolchain.md) for details. | ||
|
||
- `cmark.py`: Our wrapper around CommonMark. | ||
- `html_head.py`: Common HTML fragments. | ||
- `oil_doc.py`: HTML filters. | ||
- `split_doc.py`: Split "front matter" from Markdown. | ||
- `make_help.py`: For `doc/{osh,oil}-help-topics.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