Skip to content

Commit da5c124

Browse files
feat: build llms.txt
1 parent 6563744 commit da5c124

7 files changed

Lines changed: 393 additions & 0 deletions

File tree

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# AfterPython: Python Package Maintenance Toolkit and Project Website Generator
2+
3+
[MyST]: https://mystmd.org
4+
[MyST Markdown]: https://mystmd.org/spec/
5+
[Jupyter Notebook]: https://jupyter.org
6+
[pre-commit]: https://pre-commit.com
7+
[pagefind]: https://pagefind.app
8+
[SemVer]: https://semver.org
9+
[great-docs]: https://posit-dev.github.io/great-docs/
10+
[GitHub Actions]: https://github.com/features/actions
11+
[PyTorch]: https://pytorch.org
12+
[Scikit-Learn]: https://scikit-learn.org
13+
[WebLLM]: https://webllm.mlc.ai/
14+
[project-website-template]: https://github.com/AfterPythonOrg/project-website-template
15+
[commitizen]: https://github.com/commitizen-tools/commitizen
16+
[uv]: https://docs.astral.sh/uv/
17+
[ruff]: https://docs.astral.sh/ruff/
18+
19+
## Problem
20+
Going from **writing Python code to publishing and maintaining a package** is **time-consuming**.
21+
First-time maintainers must learn multiple tools and concepts, e.g. [MyST], [SemVer], CI/CD ([pre-commit] hooks, GitHub workflows), and they often spending hours just to deploy a documentation site whereas well-resourced projects like [PyTorch] and [Scikit-Learn] have **dedicated websites** that serve as their project hubs.
22+
23+
## Solution
24+
`afterpython` **automates** the tedious parts of Python package maintenance and generates a **project website** for **building community** and **hosting content** such as documentation, **blog posts**, tutorials, examples and more — empowering more developers to write packages with ease.
25+
26+
---
27+
`afterpython` is a CLI tool that **abstracts away the complexity** of **content writing, website deployment, and package release/maintenance** by providing an opinionated set of modern tools — so you don’t have to spend time selecting or learning anything beyond the basics.
28+
29+
## Core Features
30+
- [x] Write content directly in [MyST Markdown] or [Jupyter Notebook]
31+
- [x] Go from writing to **website deployment in minutes** — no need to learn any of the underlying tools
32+
- [x] Centralize all your content in a modern, **unified project website** — from documentation to blog posts
33+
- [x] Zero-config orchestration — Pre-configured modern tooling with sane defaults (see [Tech Stack](#tech-stack)), so you can start maintaining packages immediately **without learning each tool**
34+
- [ ] Export content as PDF — for example, combine all blog posts into a single PDF file
35+
- [ ] **⚡ Full-text search** across **ALL** your content in your website — docs, blogs, tutorials, everything
36+
- [ ] **🤖 Embedded AI Chatbot** that answers questions directly using an in-browser LLM — at no cost
37+
38+
---
39+
## Project Website
40+
> The project website for `afterpython` is created using `afterpython` itself. See the [**website**](https://afterpython.afterpython.org).
41+
<picture>
42+
<source media="(prefers-color-scheme: dark)" srcset="afterpython/static/website-dark.png">
43+
<source media="(prefers-color-scheme: light)" srcset="afterpython/static/website-light.png">
44+
<img alt="Project Website" src="afterpython/static/website-light.png">
45+
</picture>
46+
47+
You can create your own website too and deploy it to GitHub Pages in **less than a minute**! See [Quickstart](https://afterpython.afterpython.org/doc/quickstart).
48+
49+
---
50+
## Installation
51+
```bash
52+
# install afterpython as a dev dependency
53+
uv add --dev afterpython
54+
55+
# initialize afterpython
56+
ap init
57+
```
58+
59+
---
60+
## CLI Commands
61+
```bash
62+
# show all commands
63+
ap --help
64+
65+
# or use terminal UI (TUI)
66+
ap tui
67+
```
68+
69+
---
70+
## Tech Stack
71+
- [MyST]
72+
- [project-website-template]
73+
- [pre-commit]
74+
- [GitHub Actions]
75+
- [great-docs]
76+
- [commitizen]
77+
- [uv]
78+
- [ruff]
79+
- [pagefind]
80+
- [WebLLM]
81+
<!-- - ty -->
82+
<!-- - [pixi] -->
83+
84+
## Documentation
85+
86+
> CLI tool to streamline Python package maintenance and generate a dedicated project website
87+
88+
- [CI/CD Pipelines](/doc/ci-cd.md)
89+
- [Commit Workflow](/doc/commit-workflow.md)
90+
- [Concepts](/doc/concepts.md)
91+
- [CONTRIBUTING 🚧](/doc/contributing.md)
92+
- [Environment Variables](/doc/environment-variables.md)
93+
- [Overview](/doc/index.md)
94+
- [llms.txt](/doc/llms-txt.md)
95+
- [Quick Guide to MyST](/doc/myst.md)
96+
- [Package Management](/doc/package-management.md)
97+
- [Package Releases](/doc/package-releases.md)
98+
- [Project Website](/doc/project-website.md)
99+
- [Quickstart](/doc/quickstart.md)
100+
- [Roadmap](/doc/roadmap.md)

afterpython/doc/llms_txt.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[llms.txt]: https://llmstxt.org/
2+
3+
# llms.txt
4+
5+
[llms.txt] is a markdown file at a website's root (`/llms.txt`) that serves as a curated catalog of the site's content for AI agents (Claude, GPT, etc.) to consume. Think of it as a sitemap, but written for LLMs instead of search engines.
6+
7+
> You can find the llms.txt of `afterpython`'s website here: <https://afterpython.afterpython.org/llms.txt>
8+
9+
---
10+
## Role in `afterpython`
11+
12+
`afterpython` generates **one single `llms.txt`** for the whole project website — there is no per-content-type variant. Its job is to act as **the catalog** that points an AI agent at every published page in one place.
13+
14+
The file is built into `afterpython/_website/static/llms.txt` during `ap build` and served at `/llms.txt` on the deployed project website.
15+
16+
---
17+
## What's in it
18+
19+
- **Header**: your project's `README.md`, copied in verbatim — with badges (shields, download counters, etc.) automatically stripped from the header zone.
20+
- **Sections**: one `## ` per content type, in this order:
21+
- Documentation, Tutorials, Guides, Examples, Blog
22+
- empty content types are skipped entirely
23+
- **Section blurb**: pulled from `project.description` in `afterpython/{type}/myst.yml`.
24+
- **Entries**: one link per page, with the page's `abstract:` (from frontmatter) appended if set.
25+
26+
Example of a section:
27+
28+
```markdown
29+
## Documentation
30+
31+
> Documentation for the AfterPython toolkit
32+
33+
- [Quickstart](/doc/quickstart.md): get afterpython running in 5 minutes
34+
- [Concepts](/doc/concepts.md)
35+
- [Project Website](/doc/project-website.md)
36+
```

afterpython/doc/myst.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ project:
4848
children:
4949
- file: references/environment_variables.md
5050
- file: references/roadmap.md
51+
- file: llms_txt.md
5152
- file: CONTRIBUTING.md
5253
title: ''
5354
thumbnail: ../static/thumbnail.png

src/afterpython/builders/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
delete_placeholder_index_md_files,
55
)
66
from afterpython.builders.jupyter_notebook import build_jupyter_notebooks
7+
from afterpython.builders.llms_txt import build_llms_txt
78
from afterpython.builders.markdown import build_markdown
89
from afterpython.builders.metadata import build_metadata
910
from afterpython.builders.url_md import build_url_md
1011

1112
__all__ = (
1213
"build_content_json",
1314
"build_jupyter_notebooks",
15+
"build_llms_txt",
1416
"build_markdown",
1517
"build_metadata",
1618
"build_url_md",

0 commit comments

Comments
 (0)