Skip to content

Commit

Permalink
refactor: rely on Jekyll to number sections
Browse files Browse the repository at this point in the history
-   One less build step, one less Python script
  • Loading branch information
gvwilson committed Feb 5, 2024
1 parent 1f9da1a commit 3092aab
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 178 deletions.
14 changes: 11 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ All contributors will be acknowledged.
If you add a new example,
please add a corresponding rule in `Makefile`.

- Use `{% raw %}{% include h2_numbered.md title="words" %}{% endraw %}`
to create a numbered section
that includes a runnable code example.

- Use `{% raw %}{% include h2_unnumbered.md title="words" %}{% endraw %}`
to create an unnumbered section
that *doesn't* include a runnable code example.

- Use `{% raw %}{% include double.md stem="file" suffix="sql out" %}{% endraw %}`
in `index.md` to include `src/file.sql` and `out/file.out`.
(Any two suffixes can be provided, such as `"py out"`.)
Expand All @@ -43,6 +51,9 @@ All contributors will be acknowledged.
solid 1-point black lines,
and unfilled objects.

- All external links are written using `{% raw %}[box][notation]{% endraw %}` inline
and defined at the foot of the document.

## Logical Structure

- Introduction
Expand All @@ -64,9 +75,6 @@ All contributors will be acknowledged.
- Appendices
- A *glossary* that defines terms called out in the episodes.
- *Acknowledgments* that point at inspirations and thank contributors.
- Links
- All external links are written using `{% raw %}[box][notation]{% endraw %}` inline
and defined at the foot of the document.

## Physical Structure

Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ used:
freq:
@python bin/get_sql_features.py --report freq --files ${SQL_FILES}

## renumber: renumber headings
.PHONY: renumber
renumber:
@python bin/renumber_headings.py ${PAGE}

## run: re-run all examples
.PHONY: run
run: ${OUT_FILES}
Expand Down
1 change: 1 addition & 0 deletions _includes/h2_numbered.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## {% increment h2_counter %}: {{include.title}}
1 change: 1 addition & 0 deletions _includes/h2_unnumbered.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## ☆ {{include.title}}
6 changes: 6 additions & 0 deletions _includes/init_counters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{%- comment -%}
Initialize per-file counters.
- Needed so that first use yields 1 instead of 0.
- Must be included in the source file to ensure correct initialization order.
{%- endcomment %}
<!-- {% increment h2_counter %} -->
17 changes: 0 additions & 17 deletions bin/renumber_headings.py

This file was deleted.

Loading

0 comments on commit 3092aab

Please sign in to comment.