Skip to content

Commit 0a649d0

Browse files
committed
docs: wip
1 parent b11e14e commit 0a649d0

File tree

5 files changed

+82
-4
lines changed

5 files changed

+82
-4
lines changed
169 KB
Loading

docs/source/features.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Features
2+
3+
## How to add frontend dependency
4+
5+
1. npm i -D ...
6+
7+
## How to add Sphinx extension to sample docs
8+
9+
1. Add extension to `dependencies` list in `sample_docs/pyproject.toml`.
10+
1. Add extension to `extensions` list in `conf.py`.

docs/source/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@
77
:maxdepth: 2
88
99
quickstart
10+
features
11+
usage
12+
reference
1013
```

docs/source/reference.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Reference
2+
3+
## File layout structure
4+
5+
{{ project }} follows a fairly specific file system layout. This standardized structure eases maintenance and switching between multiple projects.
6+
7+
All tasks, like build and preview, are in the [noxfile.py file](#nox-tasks), and this documentation assumes the structure.
8+
9+
```
10+
.
11+
├── build/ ┐
12+
│ └── <builder>/ | Output files
13+
│ └── <language>/ |
14+
│ └── ... ┘
15+
├── source/ ┐
16+
│ ├── _static/ |
17+
│ │ ├── favicon.svg |
18+
│ │ └── logo.svg |
19+
│ ├── _templates/ | Sphinx project sources
20+
│ ├── conf.py | (documents, images, conf.py)
21+
│ ├── index.md |
22+
│ ├── overview.md |
23+
│ └── ... ┘
24+
├── .gitignore ┐
25+
├── CHANGELOG.md |
26+
├── LICENSE |
27+
├── noxfile.py | Meta files
28+
├── package-lock.json |
29+
├── package.json |
30+
└── pyproject.toml ┘
31+
```
32+
33+
The files and folders are for three purposes:
34+
35+
- Sphinx project sources. Regular files found in Sphinx projects like .md, .rst, images, conf.py.
36+
- When built by [tasks](#nox-tasks), output goes to (by default) to `build/`.
37+
- Meta files. Not the documentation itself. Like dependencies in `pyproject.toml`, license, standard `.gitignore`, etc.
38+
39+
Everything except the output directory should be versioned.

docs/source/usage.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,36 @@ orphan: true
44

55
# Usage
66

7-
## Add frontend dependency
7+
{#nox-tasks}
88

9-
npm i -D ...
9+
## noxfile tasks
1010

11-
## Update sample docs
11+
### preview
1212

13-
sample_docs/pyproject.toml
13+
In preview mode, Python (Sphinx) and Node.js (Tailwind) part runs in parallel. To distinct the terminal output, both are prefixed with their names.
14+
15+
Since they run in parallel, they are independent. It means:
16+
17+
- One may crash and other will continue to run. You must inspect failure yourself.
18+
- Output is mixed. For convenience, processes have different colors.
19+
20+
![](_static/preview-mixed-output.png)
21+
22+
## package.json tasks
23+
24+
The `package.json` must contain the following `scripts` tasks. They are called by Nox tasks. However, you can add your own additional tasks.
25+
26+
```json
27+
{
28+
"scripts": {
29+
"theme:build": "...",
30+
"theme:watch": "..."
31+
},
32+
...
33+
```
34+
35+
For example, if you want to build just Node.js assets, call `npm run theme:build`.
36+
37+
### theme:build
38+
39+
### theme:watch

0 commit comments

Comments
 (0)