AsciiDoc Attribute Usage#
AsciiDoc attributes are named variables declared once and referenced throughout documents as {attribute_name}. In this course repository, attributes centralise values that change per academic year — most importantly academic_year — so that a single edit propagates everywhere rather than requiring a manual search-and-replace across files.
Central definition: content/attributes.adoc#
All shared attributes are declared in content/attributes.adoc. The file covers two categories:
- Year-specific:
academic_year— currently set to2026/2027 - Rendering/config: Reveal.js settings (
revealjs_width,revealjs_height, etc.), syntax-highlighter config, icon shorthands, and path aliases
To update the course for a new year, only line 36 needs to change.
How attributes are loaded#
Entry-point documents include attributes.adoc explicitly, making all attributes available to every file they pull in via include:::
| Entry-point file | Include line | Usage of {academic_year} |
|---|---|---|
content/index.adoc | line 3 | line 6 — main presentation title slide |
content/index-examen.adoc | line 2 | line 5 — exam presentation title slide |
Chapter files (e.g., content/chapitres/reseaux.adoc) do not include attributes.adoc themselves — they inherit attributes from the parent entry-point document at include time .
The agent prompt for AI-assisted content authoring documents this structure explicitly: content/attributes.adoc is called out as "Configuration globale" and content/index.adoc as the "Point d'entrée" .
Non-compliant files (hardcoded strings)#
Two exam files bypass the attribute and embed the year as a literal string:
| File | Hardcoded value | Location |
|---|---|---|
content/chapitres/examen-final.adoc | Année 2025-2026 | line 5 |
content/chapitres/examen-final.adoc | 4 janvier 2026 (deadline) | line 36 |
content/examen-final-detaille.adoc | année universitaire 2025-2026 | line 32 |
content/examen-final-detaille.adoc | 4 janvier 2026 (deadline) | lines 23, 82 |
These files will not automatically reflect a year change when attributes.adoc is updated.
Note on format: The attribute value uses a slash separator (
2026/2027) while hardcoded strings use a hyphen (2025-2026). Standardise on one format when migrating.
How to fix a non-compliant file#
- Ensure the file is included (directly or transitively) from an entry-point that already pulls in
attributes.adoc— or addinclude::../attributes.adoc[]at the top of the standalone file. - Replace every hardcoded year string with
{academic_year}. - For deadline dates, consider adding a dedicated
:deadline:attribute tocontent/attributes.adocand applying the same pattern.
Syntax quick reference:
| Action | AsciiDoc |
|---|---|
| Define attribute | :attribute_name: value (in attributes.adoc) |
| Reference attribute | {attribute_name} (anywhere in an included file) |
| Include attributes file | include::./attributes.adoc[] (at top of entry-point) |