Commit graph

271 commits

Author SHA1 Message Date
Valentin Gagarin 661158223a ensure the section hierarchy is spec-compliant
- automatically assign heading levels
- check that the maximum nesting depth is not exceeded
2024-11-13 15:47:12 +01:00
Valentin Gagarin 4aeb9579d6 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 15:47:12 +01:00
Valentin Gagarin 5ee1c8b006 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 15:47:12 +01:00
Valentin Gagarin 414aeb45ba fix module for <link> and <base> 2024-11-13 15:47:12 +01:00
Valentin Gagarin 153b761c8f fix attrs printing 2024-11-13 15:47:12 +01:00
Valentin Gagarin 36d1c9c433 add README 2024-11-13 15:47:12 +01:00
Valentin Gagarin 5bef87be1f render content via structured DOM representation 2024-11-13 15:47:12 +01:00
Valentin Gagarin e531e861ce formatting 2024-11-13 15:47:12 +01:00
Valentin Gagarin 2595511a38 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 15:47:12 +01:00
Valentin Gagarin 779eb8b192 add more string processing helpers 2024-11-13 15:47:12 +01:00
Valentin Gagarin e77b55e8e9 add type for list of unique elements 2024-11-13 15:47:12 +01:00
Valentin Gagarin c7a13f04c9 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 15:47:12 +01:00
Valentin Gagarin e2691f8469 let navigation have its own template 2024-11-13 15:47:12 +01:00
Valentin Gagarin 84f5d17e3e make a proper link 2024-11-13 15:47:12 +01:00
Valentin Gagarin cb715fb99d move more content 2024-11-13 15:47:12 +01:00
Valentin Gagarin 059ebc2291 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 15:47:12 +01:00
Valentin Gagarin 7efd5b8317 allow prefixing output paths of collection items 2024-11-13 15:47:12 +01:00
Valentin Gagarin 3505539499 delete obsolete page 2024-11-13 15:47:12 +01:00
Valentin Gagarin 6631c09803 allow menu entries to be subtypes of page
with an example
2024-11-13 15:47:12 +01:00
Valentin Gagarin 836ceb846a split content types into separate files 2024-11-13 15:47:12 +01:00
Valentin Gagarin 04fef22dc3 extract importing Nix files 2024-11-13 15:47:12 +01:00
Valentin Gagarin 6c84b9dae0 implement correct-by-construction relative links 2024-11-13 15:47:12 +01:00
Valentin Gagarin 29839f82d7 smarter indent
this allows writing the beginning of the indented string at the desired
indentation
2024-11-13 15:47:12 +01:00
Valentin Gagarin e38960661c stricter type for articles 2024-11-13 15:47:12 +01:00
Valentin Gagarin 829a796f16 separate templating from file system outputs 2024-11-13 15:47:12 +01:00
Valentin Gagarin 59a2fed5e2 extract generic document type 2024-11-13 15:47:12 +01:00
Valentin Gagarin 822ff6c1b4 add note 2024-11-13 15:47:12 +01:00
Valentin Gagarin ad8b758cee implement navigation 2024-11-13 15:47:12 +01:00
Valentin Gagarin 3a36a6cf29 split out template library 2024-11-13 15:47:12 +01:00
Valentin Gagarin 1469481829 add TODO 2024-11-13 15:47:12 +01:00
Valentin Gagarin 130222db57 extract presentation module 2024-11-13 15:47:12 +01:00
Valentin Gagarin 68bc592c88 add some documentation 2024-11-13 15:47:12 +01:00
Valentin Gagarin ea77a44d1a split content types into module 2024-11-13 15:47:12 +01:00
Valentin Gagarin 30249d2821 move custom type into custom lib 2024-11-13 15:47:12 +01:00
Valentin Gagarin 212b3647fd more scalable imports
that directory will only grow
2024-11-13 15:47:12 +01:00
Valentin Gagarin 2d7cc5c4cb add TODOs 2024-11-13 15:47:12 +01:00
Valentin Gagarin 0383c9ce3b clean up artefacts 2024-11-13 15:47:12 +01:00
Valentin Gagarin 80a0b1ea91 sort news by date 2024-11-13 15:47:12 +01:00
Valentin Gagarin 0e2c56b08e migrate news entries 2024-11-13 15:47:12 +01:00
Valentin Gagarin 141242a86d implement collections 2024-11-13 15:47:12 +01:00
Valentin Gagarin b435309994 put partners in a directory 2024-11-13 15:47:12 +01:00
Valentin Gagarin e17ba990ed add back partners 2024-11-13 15:47:12 +01:00
Valentin Gagarin d22bc5f3b1 re-add fediversity page 2024-11-13 15:47:12 +01:00
Valentin Gagarin ab56a0b5cc modularize 2024-11-13 15:47:12 +01:00
Valentin Gagarin 937d24eb09 add partners 2024-11-13 15:47:12 +01:00
Valentin Gagarin 7f7bd17700 remove processed pages 2024-11-13 15:47:12 +01:00
Valentin Gagarin c3c4143f53 remove one layer 2024-11-13 15:47:12 +01:00
Valentin Gagarin 149efe84e9 rename 2024-11-13 15:47:12 +01:00
Valentin Gagarin f41fc6ec34 uncle bob 2024-11-13 15:47:12 +01:00
Valentin Gagarin 4d48c552c8 extract file processing 2024-11-13 15:47:12 +01:00