Skip to content

Commit 3c157d1

Browse files
docs: finish Project Website section
1 parent 8ba351e commit 3c157d1

File tree

10 files changed

+75
-37
lines changed

10 files changed

+75
-37
lines changed

afterpython/doc/myst.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[MyST History]: https://mystmd.org/guide/background#what-is-the-myst-document-engine-and-myst-markdown
44
[MyST Overview]: https://mystmd.org/guide/overview
55
[Jupyter Notebook]: https://jupyter.org
6-
[template]: https://github.com/AfterPythonOrg/project-website-template
76
[JupyterBook]: https://jupyterbook.org/stable/
87
[molab]: https://molab.marimo.io/
98
[Marimo]: https://marimo.io/
@@ -61,18 +60,21 @@ Some settings in `myst.yml` may not work as expected, and you may need to report
6160
Please do **_NOT_** report `mystmd` bugs on `afterpython` repository.
6261
:::
6362

63+
---
6464
### Table of Contents (TOC)
6565
The `toc` subsection under `project` in `myst.yml` defines how your content is organized.
6666

6767
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.
6868

6969
*See [Table of Contents](https://mystmd.org/guide/table-of-contents) for more details.*
7070

71+
---
7172
### authors.yml
7273
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.
7374

7475
*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.)*
7576

77+
---
7678
#### Change Author at Page Level
7779
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`):
7880
```markdown
@@ -81,3 +83,8 @@ authors:
8183
- new_author_id_defined_in_authors_yml
8284
---
8385
```
86+
87+
88+
:::{tip}
89+
This entire documentation is written in MyST Markdown. You can click the "Edit this page" button in the top right corner to see the source code as an example of how to write content in MyST Markdown.
90+
:::

afterpython/doc/myst.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ project:
3535
toc:
3636
- file: overview.md
3737
- file: quickstart.md
38-
- title: Walkthrough
39-
children:
40-
- file: walkthrough/directories.md
41-
- file: walkthrough/afterpython_toml.md
42-
- file: walkthrough/static_files.md
43-
- file: walkthrough/myst_yml.md
44-
- file: walkthrough/authors_yml.md
38+
- file: walkthrough.md
4539
- file: concepts.md
4640
- file: myst.md
4741
- file: project_website.md

afterpython/doc/project_website.md

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
[project-website-template]: https://github.com/AfterPythonOrg/project-website-template
2+
[MyST]: https://mystmd.org
3+
[pdoc]: https://pdoc.dev/docs/pdoc.html
14
[PyPI]: https://pypi.org/
5+
[WebLLM]: https://webllm.mlc.ai/
6+
[PageFind]: https://pagefind.app/
27
[Svelte]: https://svelte.dev/
8+
[NodeJS]: https://nodejs.org
9+
[pnpm]: https://www.npmjs.com/package/pnpm
310

411
# Project Website
512

@@ -25,37 +32,51 @@ Essentially, it **extends your documentation site into a fully featured website*
2532
![project website](../static/project_website.svg)
2633
:::
2734

28-
2935
:::{div}
3036
:class: hidden dark:block
3137
![project website dark](../static/project_website_dark.svg)
3238
:::
3339

34-
inside `afterpython/` directory:
35-
Blog/Tutorials/Examples
36-
content types: doc, blog, tutorial, example, guide, etc.
40+
During `ap init`, `afterpython` creates a new directory `afterpython/_website/` and initializes it with [project-website-template], which uses [Svelte] and SvelteKit to create the project website and serve the HTML files built by `mystmd` in all of the content folders in `afterpython/` (e.g., `afterpython/doc/`, `afterpython/blog/`)
3741

38-
use a full web ui framework ([Svelte]) to wrap the content and escape the scope of MyST
42+
This approach brings us into the realm of full-stack web development, which enables us to add features such as an AI chatbot, full-text search engine across the website, etc.
3943

40-
## Homepage
41-
Currently only your `README.md` is used as the homepage.
4244

43-
### API Reference
44-
use pdoc
45-
### FAQs
46-
faq.yml
47-
### Compatibility
48-
support sphinx, mkdocs
45+
---
46+
## Website Template Update
47+
[project-website-template] is a separate repository that will be updated independently of `afterpython` to provide new features and bug fixes for the project website.
48+
49+
When updates are available, run `ap update website`, which will update `afterpython/_website`, and you can start using the new features immediately.
50+
51+
52+
:::{warning} Caveat
53+
`ap update website` will overwrite the existing `afterpython/_website` with the latest [project-website-template]. If you have made any customizations to `afterpython/_website`, they will be lost.
54+
:::
55+
56+
57+
---
58+
## Customization and Styling
59+
Since all the code is pulled from [project-website-template] to `afterpython/_website/`, you can customize the project website by modifying the code in `afterpython/_website/src/`.
60+
61+
For example, to change the landing page, which by default displays the `README.md`, you can modify the code in `afterpython/_website/src/routes/+page.svelte`.
62+
63+
> If you don't know Svelte and are using an LLM to code for you, remember to ask it to write in Svelte 5 syntax.
64+
4965

5066
---
67+
## Work in Progress 🚧
5168
## Built-in Features
52-
- full-text search engine (Work in Progress)
53-
- AI chatbot (Work in Progress)
69+
- full-text search using [PageFind]
70+
- AI chatbot using [WebLLM]
71+
72+
### API Reference
73+
[pdoc] will be used to build the API Reference section on the project website.
74+
75+
### FAQs
76+
`faq.yml` will be used as content for the FAQs section on the project website.
77+
5478
### Google Analytics
79+
add google analytics support for the entire website
5580

56-
---
57-
## Website Template Update
58-
`ap update website`
59-
Caveat: This will overwrite the existing project website template.
60-
### Customization and Styling
61-
can use LLM to code any web components in [Svelte]
81+
### Compatibility
82+
Currently `afterpython` only supports content built `mystmd`. It does NOT work with Sphinx, MkDocs etc.

afterpython/doc/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ When using flags, a MyST development server starts for that specific content fol
5656
All content folders in `afterpython/` (e.g., `afterpython/doc/`, `afterpython/blog/`) are initialized by `myst init` (see [MyST Markdown]), and **each** has a default `index.md` file and a `myst.yml` file for configuration.
5757

5858
:::{seealso}
59-
To learn more about how to arrange your content in the content folders, see [Table of Contents] or a [Quick Guide about myst.yml](walkthrough/myst_yml.md).
59+
To learn more about how to arrange your content in the content folders, see [Table of Contents] or a [Quick Guide about myst.yml](myst.md).
6060
:::
6161

6262
---

afterpython/doc/references/roadmap.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ This roadmap is tentative and subject to change
1010
- incremental build, only build changed content (for `ap dev`)
1111
- integrate with `git-cliff` for changelog generation
1212
- integrate with `pixi`, supports `conda install`
13+
- supports docs built by different engines? e.g. Sphix, MkDocs

afterpython/doc/walkthrough/directories.md renamed to afterpython/doc/walkthrough.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[MyST Markdown]: https://mystmd.org/guide/quickstart
44

55

6-
# Directories
6+
# Walkthrough
77
After initialization, the following directories are created:
88
- `afterpython/`
99
- `afterpython/doc/`
@@ -15,3 +15,24 @@ After initialization, the following directories are created:
1515
The `afterpython/` directory is the main directory that contains all content, while the subdirectories are initialized by `myst init` (see [MyST Markdown]).
1616

1717
> Note that [NodeJS] and [pnpm] will be installed for you by default if they are not already installed
18+
19+
20+
## _website/
21+
22+
## Configuration Files
23+
24+
## afterpython.toml
25+
26+
`afterpython.toml` is a configuration file for `afterpython` inside `afterpython/`. Consider it as an extension of `pyproject.toml`, storing extra information of your project such as company name, company URL, project website URL, etc.
27+
28+
29+
ruff.toml
30+
cz.toml
31+
authors.yml
32+
myst.yml
33+
faq.yml
34+
.pre-commit-config.yaml
35+
.github/workflows/release.yml
36+
.github/workflows/deploy.yml
37+
38+
# Static Files

afterpython/doc/walkthrough/afterpython_toml.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

afterpython/doc/walkthrough/authors_yml.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

afterpython/doc/walkthrough/myst_yml.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

afterpython/doc/walkthrough/static_files.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)