Repository navigation
Expand file tree
/
Copy pathfaq_sample.yml
More file actions
136 lines (104 loc) · 5.61 KB
/
Copy pathfaq_sample.yml
File metadata and controls
136 lines (104 loc) · 5.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Variations covered:
# - uncategorized items before, between and after categories
# - a category used twice non-consecutively (shows up as two groups)
# - short one-line answers and long multi-paragraph ones
# - inline code in questions, bold/italic, internal and external links
# - bullet and numbered lists, code blocks, a table, a blockquote
# - a very long question (wraps in the heading and the sidebar)
- question: What is AfterPython?
answer: |
AfterPython is a CLI (`ap`) that takes care of the tedious parts of maintaining a Python package: linting and formatting hooks, commit conventions, versioning and releases. It also generates a **project website** from the content in your `afterpython/` folder.
- question: Is it free?
answer: Yes. AfterPython is open source and free to use.
- question: Which Python versions are supported?
answer: Python **3.13** and newer.
category: Getting started
- question: How do I add AfterPython to an existing project?
answer: |
From your project root (the folder with `pyproject.toml`):
```bash
uv add --dev afterpython
ap init
```
`ap init` creates the `afterpython/` folder, installs the pre-commit hooks and sets up the website template. Nothing in your package source is touched.
category: Getting started
- question: What does `ap init` set up for me?
answer: |
- **Pre-commit hooks**: ruff (lint + format) and ty (type checking)
- **Commit message checks** for conventional commits
- **Versioning and changelog** config (`cliff.toml`)
- **The project website** under `afterpython/_website/`
Every tool keeps its own config file in `afterpython/`, so you can tune any of them later without learning them up front.
category: Getting started
- question: Do I need a GitHub repository?
answer: No. Everything works locally. You only need a remote for `ap release` and for deploying the website to GitHub Pages.
- question: Where do I put my content?
answer: |
Each content type has its own folder under `afterpython/`:
| Folder | Shows up as |
| --- | --- |
| `doc/` | Documentation |
| `blog/` | Blog posts |
| `tutorial/` | Tutorials |
| `example/` | Examples |
| `guide/` | Guides |
Empty folders are skipped, so only the sections you write appear on the website.
category: Writing content
- question: Can I write content in Jupyter or marimo notebooks?
answer: |
Yes. Write in whichever you prefer:
- **MyST Markdown** (`.md`)
- **Jupyter notebooks** (`.ipynb`)
- **marimo notebooks** (`.py`), which need the `marimo` extra: `uv add --dev "afterpython[marimo]"`
Use `ap dev --execute` to run Jupyter notebooks when building, so their outputs are fresh.
category: Writing content
- question: How do I add questions to this FAQ page?
answer: |
Edit `afterpython/faq.yml`. Each item has a `question`, an `answer` (markdown) and an optional `category`:
```yaml
- question: Is it free?
answer: Yes.
category: General
```
While `ap dev` is running, saving the file updates the page in your browser.
category: Writing content
- question: How do I preview the website while I write?
answer: |
Run `ap dev`. On its own it serves just the website; add flags to also serve content:
```bash
ap dev # website only
ap dev --doc # website + documentation
ap dev --all # website + every content type
```
Pages reload automatically when you save.
category: Website
- question: How do I customize the website's look?
answer: |
The website is a SvelteKit app in `afterpython/_website/`, styled with [Tailwind CSS](https://tailwindcss.com/docs). Change the theme colours in `src/app.css`, or edit any component in `src/lib/components/`.
> The website folder is yours once it's created. AfterPython only writes the data files in `static/`, so your edits are never overwritten.
category: Website
- question: How do I release a new version?
answer: |
1. `ap bump` bumps the version, commits it and tags it.
2. `ap release` pushes the branch and the tag.
3. CI builds and publishes the package.
Use `ap changelog` first to preview what will go into the changelog.
category: Releases
- question: Can I write my own commit types, like `perf:` or `deps:`?
answer: Yes. Add them to the commit types in `afterpython.toml`, and the commit message check will accept them.
category: Releases
- question: I ran `ap dev` but my latest blog post doesn't show up on the home page, even though I can open it directly. What's going on and how do I fix it?
answer: |
The post's page comes straight from MyST, but the **list of posts** is a separate data file built from MyST's output. Check that:
1. the post is in `afterpython/blog/` and listed in `afterpython/blog/myst.yml`
2. you started the blog server too: `ap dev --blog` (or `--all`)
If it still doesn't appear, restart `ap dev` and check the terminal for build errors.
category: Troubleshooting
- question: "`ap build` says it can't find `pyproject.toml`"
answer: Run it from your project root, or any folder inside the project. AfterPython looks for `pyproject.toml` in the current folder and its parents.
category: Troubleshooting
- question: Is there a way to type-check without running all the hooks?
answer: Yes, `ap check` runs ty on its own. Likewise `ap lint` runs ruff's linter and `ap format` its formatter.
category: Getting started
- question: Where can I ask questions that aren't answered here?
answer: Open a discussion on [GitHub Discussions](https://github.com/AfterPythonOrg/afterpython/discussions). Bug reports go in GitHub *Issues*.