Commit graph

31 commits

Author SHA1 Message Date
Valentin Gagarin
9d5c07dbd0 fix <hgroup> rendering 2024-11-13 13:44:47 +01:00
Valentin Gagarin
3224f66eb4 add stylesheet with fonts 2024-11-13 13:44:47 +01:00
Valentin Gagarin
256dec05c4 implement raw assets
this allows adding files to the output as they are
2024-11-13 13:44:47 +01:00
Valentin Gagarin
9624138b45 move inline recursiveAttrs to lib.types 2024-11-13 13:44:47 +01:00
Valentin Gagarin
33124042a0 implement stylesheet links 2024-11-13 13:44:47 +01:00
Valentin Gagarin
645d74d486 add todo concerning palpable content 2024-11-13 13:44:47 +01:00
Valentin Gagarin
19d5b579f6 implement definition lists with dl, dt, dd 2024-11-13 13:44:47 +01:00
Valentin Gagarin
34f86d0632 override page template for articles 2024-11-13 13:44:47 +01:00
Valentin Gagarin
0614c7c9c7 make page templates granularly overridable 2024-11-13 13:44:47 +01:00
Valentin Gagarin
2dcc531374 move things to more appropriate places 2024-11-13 13:44:47 +01:00
Valentin Gagarin
1e9fad633c unify template parameters 2024-11-13 13:44:47 +01:00
Valentin Gagarin
e10995c4e0 further prettify output 2024-11-13 13:44:47 +01:00
Valentin Gagarin
c84e1763a9 fix indentation in output 2024-11-13 13:44:47 +01:00
Valentin Gagarin
8afdeacedb reiterate on mandatory headings in sections 2024-11-13 13:44:47 +01:00
Valentin Gagarin
925b7e9991 ensure the section hierarchy is spec-compliant
- automatically assign heading levels
- check that the maximum nesting depth is not exceeded
2024-11-13 13:44:47 +01:00
Valentin Gagarin
9555548c18 separate DOM mapping and generic templating
the templates collection will soon only be there for reusable snippets,
while the HTML representation of document types will be attached to
those types directly.
2024-11-13 13:44:47 +01:00
Valentin Gagarin
6a4ad72659 implement sectioning semantics
this was quite a beast to tame, but it now allows putting sections anywhere
in the tree without having to redundantly specify heading levels, which
will be computed automatically from the nesting depth.

the whole thing will also blow up if the maximum section nesting depth
is exceeded, just as the spec requires - albeit with an absolutely
impenetrable error message. this could in principle be improved with
lots of additional machinery, but this is by far not low-hanging fruit.

just don't nest your sections too much.
2024-11-13 13:44:47 +01:00
Valentin Gagarin
4850967bf5 fix module for <link> and <base> 2024-11-13 13:44:47 +01:00
Valentin Gagarin
5729f31be1 fix attrs printing 2024-11-13 13:44:47 +01:00
Valentin Gagarin
b959db0ae9 render content via structured DOM representation 2024-11-13 13:44:47 +01:00
Valentin Gagarin
af6bb43e07 implement a slice of the DOM spec as modules
this is roughly sufficient to recreate the website as it currently is

- elements:
  - document
  - html
  - head
  - title
  - base
  - link (variants that must be unique nested under `head` directly)
    - canonical
  - meta (same as for link):
    - charset
    - viewport
    - author (can be multiple, but still unique in aggregate for a document)
    - description

- global attributes:
  - class
  - hidden
  - id
  - lang
  - style
  - title

- element-specific attributes:
  - href
  - target

there's still a lot to do for a reasonably complete implementation, most
importantly everything concerning
- navigation
- top-level flow content (`div`, `article`, headings, `p`, ...)
- stylesheets

there's also some infrastructure to be arranged for easy but somewhat
safe switching between literal HTML and structured representations.
2024-11-13 13:44:47 +01:00
Valentin Gagarin
c21f6e3a90 don't use outPath any more
- links are constructed explicitly, relative to the current page's
location
- templates are called explicitly by output type
2024-11-13 13:44:47 +01:00
Valentin Gagarin
5dfaae73bf let navigation have its own template 2024-11-13 13:44:47 +01:00
Valentin Gagarin
0b0511f8f4 set a default location for documents
it turns out that setting a value appends to that.
the default only needs to be overridden when the symbolic name of the
document changes. while there's a chance people will inadvertently break
links that way, it's requires less up-front knowledge to work with.
2024-11-13 13:44:47 +01:00
Valentin Gagarin
cbfd4830cc allow prefixing output paths of collection items 2024-11-13 13:44:47 +01:00
Valentin Gagarin
4a7db7c5f2 stricter type for articles 2024-11-13 13:44:47 +01:00
Valentin Gagarin
1b91524b0c separate templating from file system outputs 2024-11-13 13:44:47 +01:00
Valentin Gagarin
0002d31d7d add note 2024-11-13 13:44:47 +01:00
Valentin Gagarin
61e32446dd implement navigation 2024-11-13 13:44:47 +01:00
Valentin Gagarin
e0d4d2c15a split out template library 2024-11-13 13:44:47 +01:00
Valentin Gagarin
b2ce56d640 extract presentation module 2024-11-13 13:44:47 +01:00