Skip to content

Commit 9e18aab

Browse files
committed
Better readme for timeline app
1 parent 26f71cd commit 9e18aab

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

pydis_site/apps/timeline/README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,36 @@ powered by this Django application.
88
Timeline entries are written in markdown files with YAML frontmatter under the
99
`entries` directory.
1010

11-
Each file represents a timeline entry. The files are named with the format
12-
`<date>_<name>.md`:
13-
- `date`: The date is in the `YYYY-MM-DD` format, intended for easy sorting in
14-
editor/shell command directory listings. It's also used to sort the entries
15-
before rendering the timeline page.
16-
- `name`: The name component is an arbitrary slug in **kebab-case**. This is used
17-
for linking to individual timeline entries on the page, and will be set in
18-
the `id` attribute.
11+
Each file represents a timeline entry. The file names have the format
12+
`<date>_<name>.md`, where:
13+
- `date` is in `YYYY-MM-DD` for easy sorting of files in directory listings,
14+
also used for sorting of the entries displayed on the timeline page.
15+
- `name` is an arbitrary slug in `kebab-case`, used for linking to individual
16+
timeline entries on the page, which will be set in the `id` attribute for each
17+
timeline item.
1918

2019
Each file contains:
21-
- YAML frontmatter. This defines some metadata shown next to each entry in
20+
- A YAML frontmatter, which defines some metadata shown next to each entry in
2221
the timeline, including:
23-
- Date: User-facing date label.
24-
- Icon: The CSS class to be used for the icon. Set to `pydis` to use the
25-
pydis logo image.
26-
- Icon color: The CSS class that sets the background color of the icon. Leave
27-
empty if the pydis logo is used.
22+
- `date`: User-facing date label.
23+
- `icon`: The CSS class used for the icon, e.g. "fa fa-snowflake". Set to
24+
`pydis` to use the pydis logo image.
25+
- `icon_color`: The CSS class that sets the background color of the icon, e.g.
26+
"pastel-red". List of available colors can be found in [the CSS
27+
file](../../static/css/timeline/timeline.css). This can be omitted if the
28+
pydis logo is used.
2829
- Markdown content.
2930

3031

3132
## Directory structure
3233

33-
The app has a single view in `views.py` that takes care of reading the `.md`
34-
files in the `entires` directory. This is a standard Django view, mounted in
35-
`urls.py` as usual.
34+
The app has a single view in `views.py` that renders the template using the list
35+
of parsed entries from `apps.py`, which reads the markdown files on startup.
36+
This is a standard Django view, mounted in `urls.py` as usual.
3637

37-
The `tests` directory validates that our redirects and helper functions work as
38-
expected. If you made changes to the app and are looking for guidance on adding
39-
new tests, the [Django tutorial introducing automated
38+
The `tests` directory validates that the page renders successfully as expected.
39+
If you made changes to the app and are looking for guidance on adding new tests,
40+
the [Django tutorial introducing automated
4041
testing](https://docs.djangoproject.com/en/dev/intro/tutorial05/) is a good
4142
place to start.
4243

0 commit comments

Comments
 (0)