Skip to content

Commit f32bd38

Browse files
authored
updating documentation (#131)
1 parent 4bcce5e commit f32bd38

File tree

10 files changed

+98
-70
lines changed

10 files changed

+98
-70
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
pytest --cov=myst_parser --cov-report=xml --cov-report=term-missing
4646
coverage xml
4747
- name: Upload to Codecov
48-
if: matrix.python-version == 3.7 && github.repository == 'ExecutableBookProject/MyST-Parser'
48+
if: matrix.python-version == 3.7 && github.repository == 'executablebooks/MyST-Parser'
4949
uses: codecov/codecov-action@v1
5050
with:
5151
name: myst-nb-pytests-py3.7

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ pip install myst-parser[sphinx]
2727
Or for package development:
2828

2929
```bash
30-
git clone https://github.com/ExecutableBookProject/MyST-Parser
30+
git clone https://github.com/executablebooks/MyST-Parser
3131
cd MyST-Parser
3232
git checkout master
3333
pip install -e .[sphinx,code_style,testing,rtd]
3434
```
3535

3636
To use the MyST parser in Sphinx, simply add: `extensions = ["myst_parser"]` to your `conf.py`.
3737

38-
[github-ci]: https://github.com/ExecutableBookProject/MyST-Parser/workflows/continuous-integration/badge.svg?branch=master
39-
[github-link]: https://github.com/ExecutableBookProject/MyST-Parser
40-
[codecov-badge]: https://codecov.io/gh/ExecutableBookProject/MyST-Parser/branch/master/graph/badge.svg
41-
[codecov-link]: https://codecov.io/gh/ExecutableBookProject/MyST-Parser
38+
[github-ci]: https://github.com/executablebooks/MyST-Parser/workflows/continuous-integration/badge.svg?branch=master
39+
[github-link]: https://github.com/executablebooks/MyST-Parser
40+
[codecov-badge]: https://codecov.io/gh/executablebooks/MyST-Parser/branch/master/graph/badge.svg
41+
[codecov-link]: https://codecov.io/gh/executablebooks/MyST-Parser
4242
[rtd-badge]: https://readthedocs.org/projects/myst-parser/badge/?version=latest
4343
[rtd-link]: https://myst-parser.readthedocs.io/en/latest/?badge=latest
4444
[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg

docs/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
html_theme = "sphinx_book_theme"
5454
html_logo = "_static/logo.png"
5555
html_theme_options = {
56-
"github_url": "https://github.com/ExecutableBookProject/MyST-Parser",
57-
"repository_url": "https://github.com/ExecutableBookProject/MyST-Parser",
58-
"expand_sections": ["using/index"],
56+
"github_url": "https://github.com/executablebooks/MyST-Parser",
57+
"repository_url": "https://github.com/executablebooks/MyST-Parser",
58+
"expand_sections": ["examples/index"],
5959
}
6060

6161
# Add any paths that contain custom static files (such as style sheets) here,

docs/develop/contributing.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ Merging pull requests: There are three ways of 'merging' pull requests on GitHub
7070
- Merge with merge commit: put all commits as they are on the base branch, with a merge commit on top
7171
Choose for collaborative PRs with many commits. Here, the merge commit provides actual benefits.
7272

73-
[github-ci]: https://github.com/ExecutableBookProject/MyST-Parser/workflows/continuous-integration/badge.svg?branch=master
74-
[github-link]: https://github.com/ExecutableBookProject/MyST-Parser
75-
[codecov-badge]: https://codecov.io/gh/ExecutableBookProject/MyST-Parser/branch/master/graph/badge.svg
76-
[codecov-link]: https://codecov.io/gh/ExecutableBookProject/MyST-Parser
77-
[circleci-badge]: https://circleci.com/gh/ExecutableBookProject/MyST-Parser.svg?style=shield
78-
[circleci-link]: https://circleci.com/gh/ExecutableBookProject/MyST-Parser
73+
[github-ci]: https://github.com/executablebooks/MyST-Parser/workflows/continuous-integration/badge.svg?branch=master
74+
[github-link]: https://github.com/executablebooks/MyST-Parser
75+
[codecov-badge]: https://codecov.io/gh/executablebooks/MyST-Parser/branch/master/graph/badge.svg
76+
[codecov-link]: https://codecov.io/gh/executablebooks/MyST-Parser
77+
[circleci-badge]: https://circleci.com/gh/executablebooks/MyST-Parser.svg?style=shield
78+
[circleci-link]: https://circleci.com/gh/executablebooks/MyST-Parser
7979
[rtd-badge]: https://readthedocs.org/projects/myst-parser/badge/?version=latest
8080
[rtd-link]: https://myst-parser.readthedocs.io/en/latest/?badge=latest
8181
[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg

docs/index.md

+54-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,61 @@
11
MyST - Markedly Structured Text
22
===============================
33

4-
MyST is a markdown flavor that implements the best parts of reStructuredText.
5-
It provides a way to call Sphinx directives and roles from within Markdown.
6-
It is a *slight* extension of CommonMark markdown.
7-
8-
This project provides a parser for this flavor of markdown, as well as a bridge between
9-
MyST syntax and {doc}`Sphinx <sphinx:intro>`. This allows for native markdown support for roles and
10-
directives.
11-
12-
```{warning}
13-
The MyST parser is in an alpha stage, and may have breaking changes to its implementation
14-
and to the syntax that it supports. Use at your own risk. If you find any issues,
15-
please report them
16-
[in the MyST issues](https://github.com/ExecutableBookProject/meta/issues/24)
4+
**A fully-functional markdown flavor and parser for Sphinx.**
5+
6+
MyST allows you to write Sphinx documentation entirely in markdown.
7+
It is an attempt to have the best of both worlds: the flexibility
8+
and extensibility of Sphinx with the simplicity and readability of Markdown.
9+
10+
MyST has the following main features:
11+
12+
* **[A markdown parser for Sphinx](parse-with-sphinx)**. You can write your entire
13+
{doc}`Sphinx documentation <sphinx:intro>` in markdown.
14+
* **[Call Sphinx directives and roles from within Markdown](syntax/directives)**,
15+
allowing you to extend your document via Sphinx extensions.
16+
* **[Extended Markdown syntax for useful rST features](extended-block-tokens)**, such
17+
as line commenting and footnotes.
18+
* **[A Sphinx-independent parser of MyST markdown](using/use_api)** that can be extended
19+
to add new functionality and outputs for MyST.
20+
* **[A superset of CommonMark markdown][commonmark]**. Any CommonMark markdown
21+
(such as Jupyter Notebook markdown) is natively supported by the MyST parser.
22+
23+
See {doc}`using/intro` to get started.
24+
25+
```{note}
26+
The MyST parser is in a beta stage, and may change rapidly in its implementation
27+
and machinery. Use at your own risk. If you find any issues, please report them
28+
[in the MyST issues](https://github.com/executablebooks/meta/issues/24)
1729
```
1830

1931
```{tip}
2032
Check out the [MyST-Markdown VS Code extension](https://marketplace.visualstudio.com/items?itemName=ExecutableBookProject.myst-highlight),
2133
for MyST extended syntax highlighting.
2234
```
2335

24-
## Why a new flavor of markdown?
36+
## Site contents
37+
38+
```{toctree}
39+
---
40+
maxdepth: 2
41+
caption: Using MyST Markdown
42+
---
43+
using/intro.md
44+
using/syntax.md
45+
using/use_api.md
46+
```
47+
48+
```{toctree}
49+
---
50+
maxdepth: 2
51+
caption: Reference and contributing
52+
---
53+
examples/index.md
54+
develop/index.md
55+
api/index.md
56+
```
57+
58+
## Why MyST markdown?
2559

2660
While markdown is ubiquitous, it is not powerful enough for writing modern,
2761
fully-featured documentation. Some flavors of markdown support features needed for this,
@@ -34,7 +68,7 @@ particular, Sphinx defines two extension points that are extremely useful:
3468

3569
**This project is an attempt at combining the simplicity and readability of Markdown
3670
with the power and flexibility of reStructuredText and the Sphinx platform.** It
37-
starts with the CommonMark markdown specification, and selectively adds a few extra
71+
starts with the [CommonMark markdown specification][commonmark], and selectively adds a few extra
3872
syntax pieces to utilize the most powerful parts of reStructuredText.
3973

4074
```{note}
@@ -50,15 +84,9 @@ decides on an "official" extension syntax, we will likely utilize this syntax fo
5084
MyST.
5185
```
5286

53-
Here are the site contents:
87+
## Acknowledgements
5488

55-
```{toctree}
56-
---
57-
maxdepth: 2
58-
caption: Contents
59-
---
60-
using/index.md
61-
examples/index.md
62-
develop/index.md
63-
api/index.md
64-
```
89+
The MyST markdown language and MyST parser are both supported by the open community,
90+
[The Executable Book Project](https://executablebooks.org).
91+
92+
[commonmark]: https://commonmark.org/

docs/using/index.md

-10
This file was deleted.

docs/using/intro.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pip install myst-parser[sphinx]
2626
Or for package development:
2727

2828
```bash
29-
git clone https://github.com/ExecutableBookProject/MyST-Parser
29+
git clone https://github.com/executablebooks/MyST-Parser
3030
cd MyST-Parser
3131
git checkout master
3232
pip install -e .[sphinx,code_style,testing,rtd]
@@ -37,6 +37,7 @@ pip install -e .[sphinx,code_style,testing,rtd]
3737
[conda-badge]: https://anaconda.org/conda-forge/myst-parser/badges/version.svg
3838
[conda-link]: https://anaconda.org/conda-forge/myst-parser
3939

40+
(parse-with-sphinx)=
4041
## Parsing MyST with Sphinx
4142

4243
Sphinx is a documentation generator for building a website or book from multiple source documents and assets. To get started with Sphinx, see their [Quickstart Guide](https://www.sphinx-doc.org/en/master/usage/quickstart.html).
@@ -62,7 +63,7 @@ myst_config = {"disable_syntax": ["emphasis"], "math_delimiters": "brackets"}
6263
```{seealso}
6364
The {py:class}`~myst_parser.sphinx_parser.MystParser` class API
6465
and
65-
[markdown-it-py](https://github.com/ExecutableBookProject/markdown-it-py)
66+
[markdown-it-py](https://github.com/executablebooks/markdown-it-py)
6667
for the list of syntax elements (known as rules) that you can disable.
6768
```
6869

docs/using/syntax.md

+24-15
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
# The MyST Syntax Guide
44

55
As a base, MyST adheres to the [CommonMark specification](https://spec.commonmark.org/).
6-
For this, it uses the [markdown-it-py](https://github.com/ExecutableBookProject/markdown-it-py) parser,
6+
For this, it uses the [markdown-it-py](https://github.com/executablebooks/markdown-it-py) parser,
77
which is a well-structured markdown parser for Python that is CommonMark-compliant
88
and also extensible.
99

10-
MyST adds several new syntax options that extend its functionality to be used
10+
MyST adds several new syntax options to CommonMark in order to be used
1111
with Sphinx, the documentation generation engine used extensively in the Python
12-
ecosystem. Sphinx uses reStructuredText by default, which is both more
13-
powerful than Markdown, and also (arguably) more complex to use.
14-
15-
This project is an attempt to have the best of both worlds: the flexibility
16-
and extensibility of Sphinx with the simplicity and readability of Markdown.
12+
ecosystem.
1713

1814
Below is a summary of the syntax 'tokens' parsed,
1915
and further details of a few major extensions from the CommonMark flavor of markdown.
@@ -22,16 +18,20 @@ and further details of a few major extensions from the CommonMark flavor of mark
2218
% {ref}`MyST Extended AST Tokens API <api/tokens>`
2319
% ```
2420

25-
## Parsed Token
26-
2721
MyST builds on the tokens defined by markdown-it, to extend the syntax
2822
described in the [CommonMark Spec](https://spec.commonmark.org/0.29/), which the parser is tested against.
2923

3024
% TODO link to markdown-it documentation
3125

32-
### Block Tokens
26+
## Block Tokens
27+
28+
Block tokens span multiple lines of content. They are broken down into two sections:
3329

34-
#### Extended block tokens
30+
* {ref}`extended-block-tokens` contains *extra* tokens that are not in CommonMark.
31+
* {ref}`commonmark-block-tokens` contains CommonMark tokens that also work, for reference.
32+
33+
(extended-block-tokens)=
34+
### Extended block tokens
3535

3636
`````{list-table}
3737
:header-rows: 1
@@ -89,7 +89,8 @@ described in the [CommonMark Spec](https://spec.commonmark.org/0.29/), which the
8989
```
9090
`````
9191

92-
#### CommonMark tokens
92+
(commonmark-block-tokens)=
93+
### CommonMark tokens
9394

9495
`````{list-table}
9596
:header-rows: 1
@@ -156,9 +157,16 @@ described in the [CommonMark Spec](https://spec.commonmark.org/0.29/), which the
156157
157158
`````
158159

159-
### Span (Inline) Tokens
160+
## Span (Inline) Tokens
161+
162+
Span (or inline) tokens are defined on a single line of content. They are broken down into two
163+
sections below:
164+
165+
* {ref}`extended-span-tokens` contains *extra* tokens that are not in CommonMark.
166+
* {ref}`commonmark-span-tokens` contains CommonMark tokens that also work, for reference.
160167

161-
#### Extended inline tokens
168+
(extended-span-tokens)=
169+
### Extended inline tokens
162170

163171
`````{list-table}
164172
:header-rows: 1
@@ -191,7 +199,8 @@ described in the [CommonMark Spec](https://spec.commonmark.org/0.29/), which the
191199
```
192200
`````
193201

194-
#### CommonMark inline tokens
202+
(commonmark-span-tokens)=
203+
### CommonMark inline tokens
195204

196205
`````{list-table}
197206
:header-rows: 1

docs/using/use_api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
MyST-Parser may be used as an API *via* the `myst_parser` package.
44

55
```{seealso}
6-
- The [markdown-it-py](https://github.com/ExecutableBookProject/markdown-it-py) package
6+
- The [markdown-it-py](https://github.com/executablebooks/markdown-it-py) package
77
- {ref}`The MyST-Parser API <api/main>`
88
```
99

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
),
1212
long_description=open("README.md").read(),
1313
long_description_content_type="text/markdown",
14-
url="https://github.com/ExecutableBookProject/MyST-Parser",
14+
url="https://github.com/executablebooks/MyST-Parser",
1515
project_urls={"Documentation": "https://myst-parser.readthedocs.io"},
1616
author="Chris Sewell",
1717
author_email="[email protected]",

0 commit comments

Comments
 (0)