|
1 | | -[MyST Markdown]: https://mystmd.org/spec/ |
| 1 | +[MyST Documentation]: https://mystmd.org |
| 2 | +[MyST Specification]: https://mystmd.org/spec/ |
| 3 | +[MyST History]: https://mystmd.org/guide/background#what-is-the-myst-document-engine-and-myst-markdown |
| 4 | +[MyST Overview]: https://mystmd.org/guide/overview |
2 | 5 | [Jupyter Notebook]: https://jupyter.org |
3 | | -[MyST Document Engine]: https://mystmd.org/guide/background#what-is-the-myst-document-engine-and-myst-markdown |
4 | 6 | [template]: https://github.com/AfterPythonOrg/project-website-template |
| 7 | +[JupyterBook]: https://jupyterbook.org/stable/ |
| 8 | +[molab]: https://molab.marimo.io/ |
| 9 | +[Marimo]: https://marimo.io/ |
5 | 10 |
|
6 | | -# MyST |
| 11 | +# Quick Guide to MyST |
7 | 12 |
|
8 | | -## Common Markdown |
| 13 | +:::{attention} |
| 14 | +This section serves as a quick guide to MyST. Quotes below are sourced from the [MyST Documentation], where you can find more comprehensive information. |
| 15 | +::: |
9 | 16 |
|
10 | | -## MyST Markdown |
11 | 17 |
|
12 | | -## Jupyter Notebooks |
13 | | -add molab badge |
| 18 | +## What is MyST? |
| 19 | +> MyST (Markedly Structured Text) is designed to create publication-quality, computational documents written entirely in Markdown. The main use case driving the development and design of MyST is [JupyterBook], which creates educational online textbooks and tutorials with Jupyter Notebooks and narrative content written in MyST. |
14 | 20 |
|
| 21 | + |
| 22 | +### MyST Markdown vs Common Markdown |
| 23 | +> MyST is a superset of CommonMark (a standard form of Markdown) and allows you to directly create “directives” and “roles” as extension points in the language. These extensions points are influenced by ReStructured Text (RST) and Sphinx -- pulling on the nomenclature and introducing additional standards where appropriate. directives are block-level extension points, like callout panels, tabs, figures or embedded charts; and roles are inline extension points, for components like references, citations, or inline math. |
| 24 | +
|
| 25 | +- **See [this](https://mystmd.org/guide/quickstart-myst-markdown) for a quick start guide to MyST Markdown's syntax.** |
| 26 | +- See [MyST Specification] and [MyST History] for more details about what MyST is. |
| 27 | + |
| 28 | + |
| 29 | +--- |
| 30 | +## Jupyter Notebook |
| 31 | +The [MyST Document Engine][MyST Overview] can parse [Jupyter Notebook]s and render them as HTML. This means you can write content in both MyST Markdown and Jupyter Notebooks—`afterpython` will organize and render them together as part of your project website. |
| 32 | + |
| 33 | +### Molab Badge |
| 34 | + |
| 35 | +If the [environment variable](references/environment_variables.md) `AP_MOLAB_BADGE` is set to `1`, `afterpython` automatically adds [molab] badges to Jupyter Notebooks during the build process. |
| 36 | + |
| 37 | +:::{note} |
| 38 | +[molab] is a cloud service by [Marimo] that supports running Jupyter Notebooks in the cloud. The badge lets users open your notebooks and run them in the cloud for free. |
| 39 | +::: |
| 40 | + |
| 41 | + |
| 42 | +--- |
15 | 43 | ## myst.yml |
| 44 | +`myst.yml` is a configuration file for MyST, and since `afterpython` uses MyST to build content, each directory (`doc/`, `blog/`, `tutorial/`, `example/`, and `guide/`) has its own `myst.yml` configuration file. This allows you to customize MyST's behavior per directory. |
| 45 | + |
| 46 | +### Configuration Structure |
| 47 | + |
| 48 | +A `myst.yml` file contains two main sections: |
| 49 | + |
| 50 | +**`project`** — Project-level settings such as description, keywords, and GitHub URL. |
| 51 | + |
| 52 | +*See [Frontmatter](https://mystmd.org/guide/frontmatter#available-frontmatter-fields) for all available options.* |
| 53 | + |
| 54 | +**`site`** — Website-level settings such as template, site title, logo, and favicon. |
| 55 | + |
| 56 | +*See [Site Options](https://mystmd.org/guide/website-templates#available-website-template-options) for all available options.* |
| 57 | + |
| 58 | +:::{caution} Bug Report |
| 59 | +Some settings in `myst.yml` may not work as expected, and you may need to report the bugs on [`mystmd` GitHub Issues](https://github.com/jupyter-book/mystmd/issues). |
| 60 | + |
| 61 | +Please do **_NOT_** report `mystmd` bugs on `afterpython` repository. |
| 62 | +::: |
| 63 | + |
| 64 | +### Table of Contents (TOC) |
| 65 | +The `toc` subsection under `project` in `myst.yml` defines how your content is organized. |
| 66 | + |
| 67 | +You can run `myst init --write-toc` in your content directory (e.g., `afterpython/doc/`) to automatically generate a TOC based on your existing content. |
| 68 | + |
| 69 | +*See [Table of Contents](https://mystmd.org/guide/table-of-contents) for more details.* |
16 | 70 |
|
17 | | -## TOC |
| 71 | +### authors.yml |
| 72 | +When you run `ap init`, `afterpython` creates an `authors.yml` file in the `afterpython/` directory and syncs authors from `pyproject.toml`. This allows you to easily manage the authors of your project. |
18 | 73 |
|
19 | | -## VSCode Extension |
| 74 | +*See [Authorship](https://mystmd.org/guide/authorship#skip-to-frontmatter), you can add social media links to your authors in `authors.yml` (e.g. GitHub, X, etc.)* |
20 | 75 |
|
21 | | -## authors.yml |
| 76 | +#### Change Author at Page Level |
| 77 | +By default, authors defined in `authors.yml` will all be used in `myst.yml` at the project level (see `project.authors` in `myst.yml`). However, you can override this behavior at the page level by adding the `authors` frontmatter at the top of your content (e.g. `doc/your_page.md`): |
| 78 | +```markdown |
| 79 | +--- |
| 80 | +authors: |
| 81 | +- new_author_id_defined_in_authors_yml |
| 82 | +--- |
| 83 | +``` |
0 commit comments