-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️📚 Restructure code base and documentation (#566)
This PR restructures the code base into modules, to be more coherent as to the purpose of each module. It also restructures the documentation, to make it easier for users to follow, and expose the core concerns at the top-level. Finally, it introduces document-level configuration *via* the Markdown top-matter, under the `myst` key. This configuration is generated from the code `MdParserConfig` dataclass, so is inherently consistent with global configuration. The (YAML) top-matter of a MyST file is always read (within the docutils/sphinx parsers) before the full document is parsed, in order to acquire this file configuration, which overrides the default/global configuration (see `docs/configuration.md`). ## Breaking changes This should not be breaking, for general users of the sphinx extension, but will be for anyone directly using the Python API, mainly just requiring changes in import module paths. The `to_docutils`, `to_html`, `to_tokens` (from `myst_parser/main.py`) and `mock_sphinx_env`/`parse` (from `myst_parser.sphinx_renderer.py`) functions have been removed. These were really just for testing, and were confusing for users, since they did not run the full sphinx build. Instead, for single page builds, users should use the recently added docutils parser API/CLI (see `docs/docutils.md`), and for testing, functionality has been moved to https://github.com/chrisjsewell/sphinx-pytest. The top-level `html_meta` and `substitutions` top-matter keys have also been deprecated (i.e. they will still work but will emit a warning), as they now form part of the `myst` config, e.g. ```yaml --- html_meta: "description lang=en": "metadata description" substitutions: key1: I'm a **substitution** --- ``` is replaced by: ```yaml --- myst: html_meta: "description lang=en": "metadata description" substitutions: key1: I'm a **substitution** --- ```
- Loading branch information
1 parent
7dda7b5
commit 602470e
Showing
96 changed files
with
3,077 additions
and
4,641 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 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: 2 | ||
|
||
python: | ||
version: 3 | ||
version: "3" | ||
install: | ||
- method: pip | ||
path: . | ||
|
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,11 +1,24 @@ | ||
.bg-myst-one { | ||
background-color: #52d16f3b; | ||
/** Add a counter before subsections **/ | ||
h1 { | ||
counter-reset: subsection; | ||
text-decoration: underline; | ||
} | ||
|
||
.bg-myst-two { | ||
background-color: #e7dd7b73; | ||
h2 { | ||
counter-reset: subsubsection; | ||
} | ||
h2::before { | ||
counter-increment: subsection; | ||
content: counter(subsection) ". "; | ||
} | ||
h3::before { | ||
counter-increment: subsubsection; | ||
content: counter(subsection) "." counter(subsubsection) ". "; | ||
} | ||
|
||
.bg-myst-three { | ||
background-color: #e7b07b96; | ||
/** No icon for admonitions with no-icon class */ | ||
.admonition > .admonition-title, div.admonition.no-icon > .admonition-title::before { | ||
content: ""; | ||
} | ||
.admonition > .admonition-title, div.admonition.no-icon > .admonition-title { | ||
padding-left: .6rem; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.