Commit graph

54 commits

Author SHA1 Message Date
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 a98a8e7985 add README 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 7f6bc781fd formatting 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 e5381e6896 add more string processing helpers 2024-11-13 13:44:47 +01:00
Valentin Gagarin fa1ab84f2f add type for list of unique elements 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 2192b0ecf2 make a proper link 2024-11-13 13:44:47 +01:00
Valentin Gagarin 2bcc157785 move more content 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 44ac00e14d delete obsolete page 2024-11-13 13:44:47 +01:00
Valentin Gagarin 3fd7272b73 allow menu entries to be subtypes of page
with an example
2024-11-13 13:44:47 +01:00
Valentin Gagarin aace88f1d7 split content types into separate files 2024-11-13 13:44:47 +01:00
Valentin Gagarin 83e299dbdb extract importing Nix files 2024-11-13 13:44:47 +01:00
Valentin Gagarin 684658f694 implement correct-by-construction relative links 2024-11-13 13:44:47 +01:00
Valentin Gagarin 4f34b8e30b smarter indent
this allows writing the beginning of the indented string at the desired
indentation
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 5f95cb2ba6 extract generic document type 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 a9ea5775ce add TODO 2024-11-13 13:44:47 +01:00
Valentin Gagarin b2ce56d640 extract presentation module 2024-11-13 13:44:47 +01:00
Valentin Gagarin f628c5d7ce add some documentation 2024-11-13 13:44:47 +01:00
Valentin Gagarin 2a1c2a5902 split content types into module 2024-11-13 13:44:47 +01:00
Valentin Gagarin 1d75b30537 move custom type into custom lib 2024-11-13 13:44:47 +01:00
Valentin Gagarin df3e62c1c0 more scalable imports
that directory will only grow
2024-11-13 13:44:47 +01:00
Valentin Gagarin f7898e1775 add TODOs 2024-11-13 13:44:47 +01:00
Valentin Gagarin 3733e470dc clean up artefacts 2024-11-13 13:44:47 +01:00
Valentin Gagarin 5d393b36fc sort news by date 2024-11-13 13:44:47 +01:00
Valentin Gagarin b08dd2a00a migrate news entries 2024-11-13 13:44:47 +01:00
Valentin Gagarin a41577a52d implement collections 2024-11-13 13:44:47 +01:00
Valentin Gagarin b5236774eb put partners in a directory 2024-11-13 13:44:47 +01:00
Valentin Gagarin 9971fdec42 add back partners 2024-11-13 13:44:47 +01:00
Valentin Gagarin cbeec8f9d3 re-add fediversity page 2024-11-13 13:44:47 +01:00
Valentin Gagarin 570e83503f modularize 2024-11-13 13:44:47 +01:00
Valentin Gagarin d3a2c1bbde add partners 2024-11-13 13:44:47 +01:00
Valentin Gagarin d087fc9abb remove processed pages 2024-11-13 13:44:47 +01:00
Valentin Gagarin 350f6b3140 remove one layer 2024-11-13 13:44:47 +01:00
Valentin Gagarin 7158c972e8 rename 2024-11-13 13:44:47 +01:00
Valentin Gagarin 5b5b0565d2 uncle bob 2024-11-13 13:44:47 +01:00
Valentin Gagarin f15a52f4dc extract file processing 2024-11-13 13:44:47 +01:00
Valentin Gagarin 4ef8bbc7bf extract main document conversion 2024-11-13 13:44:47 +01:00
Valentin Gagarin 3b532b40c2 dir is a path 2024-11-13 13:44:47 +01:00