Commit graph

107 commits

Author SHA1 Message Date
Valentin Gagarin 0642aef7e9 remove old template garbage 2024-11-07 09:58:26 +01:00
Valentin Gagarin 166dc5058a override page template for articles 2024-11-07 05:11:58 +01:00
Valentin Gagarin 6437ee43dc make page templates granularly overridable 2024-11-07 05:11:54 +01:00
Valentin Gagarin 71dc57b7d5 add resulting Nix value to default.nix outputs
this is practical for debugging and demonstration purposes
2024-11-07 03:17:09 +01:00
Valentin Gagarin 2ddd94faa5 move things to more appropriate places 2024-11-07 01:51:51 +01:00
Valentin Gagarin 38379f8a8f unify template parameters 2024-11-07 01:31:11 +01:00
Valentin Gagarin bcd432d0c2 further prettify output 2024-11-07 01:11:45 +01:00
Valentin Gagarin 2119b4e462 fix indentation in output 2024-11-07 01:11:45 +01:00
Valentin Gagarin 42dfa74e16 reiterate on mandatory headings in sections 2024-11-07 01:11:45 +01:00
Valentin Gagarin 0dfd649736 ensure the section hierarchy is spec-compliant
- automatically assign heading levels
- check that the maximum nesting depth is not exceeded
2024-11-07 01:11:34 +01:00
Valentin Gagarin 2d405c354c 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-06 11:30:24 +01:00
Valentin Gagarin 3c94809129 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-06 04:04:46 +01:00
Valentin Gagarin dba0ad4550 fix module for <link> and <base> 2024-11-06 03:54:11 +01:00
Valentin Gagarin 08fb421413 fix attrs printing 2024-11-06 03:16:58 +01:00
Valentin Gagarin c3c68f88d6 add README 2024-11-05 13:31:37 +01:00
Valentin Gagarin 42e20c02d0 render content via structured DOM representation 2024-11-05 12:52:43 +01:00
Valentin Gagarin 9329351c6c formatting 2024-11-05 12:49:40 +01:00
Valentin Gagarin f4d40fdadf 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-05 12:45:56 +01:00
Valentin Gagarin 38c6ba6536 add more string processing helpers 2024-11-05 12:38:42 +01:00
Valentin Gagarin 3689353603 add type for list of unique elements 2024-11-03 17:52:36 +01:00
Valentin Gagarin c6f44d5f8e 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-10-16 18:23:55 +02:00
Valentin Gagarin c25cd72ee9 let navigation have its own template 2024-10-16 18:20:48 +02:00
Valentin Gagarin 0d5db72310 make a proper link 2024-10-16 18:19:41 +02:00
Valentin Gagarin 7581ed9368 move more content 2024-10-16 17:53:02 +02:00
Valentin Gagarin bdc7fb0c34 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-10-16 17:41:44 +02:00
Valentin Gagarin 7800a70df5 allow prefixing output paths of collection items 2024-10-16 17:28:38 +02:00
Valentin Gagarin 7c464be268 delete obsolete page 2024-10-16 01:18:40 +02:00
Valentin Gagarin e0bb83610f allow menu entries to be subtypes of page
with an example
2024-10-16 01:16:56 +02:00
Valentin Gagarin 2371eb11a5 split content types into separate files 2024-10-16 00:56:14 +02:00
Valentin Gagarin 79c502671c extract importing Nix files 2024-10-16 00:18:30 +02:00
Valentin Gagarin 6efd5059a5 implement correct-by-construction relative links 2024-10-16 00:08:59 +02:00
Valentin Gagarin 6012c399c1 smarter indent
this allows writing the beginning of the indented string at the desired
indentation
2024-10-15 23:58:06 +02:00
Valentin Gagarin c1dd3bdfab stricter type for articles 2024-10-15 19:40:36 +02:00
Valentin Gagarin 3ea6d362c2 separate templating from file system outputs 2024-10-15 18:52:36 +02:00
Valentin Gagarin 765e34754b extract generic document type 2024-10-15 13:40:08 +02:00
Valentin Gagarin e962f92db8 add note 2024-10-14 17:26:17 +02:00
Valentin Gagarin 2e2bf6307b implement navigation 2024-10-14 17:26:17 +02:00
Valentin Gagarin 656fd790a2 split out template library 2024-10-14 13:18:20 +02:00
Valentin Gagarin 5303997e9a add TODO 2024-10-14 10:10:33 +02:00
Valentin Gagarin 6fc4ad6293 extract presentation module 2024-10-13 11:40:41 +02:00
Valentin Gagarin 2ce52f9530 add some documentation 2024-10-13 11:36:54 +02:00
Valentin Gagarin 61709abeb5 split content types into module 2024-10-12 11:38:03 +02:00
Valentin Gagarin 2d1fa43c67 move custom type into custom lib 2024-10-12 11:27:51 +02:00
Valentin Gagarin 72fe2e9639 more scalable imports
that directory will only grow
2024-10-12 01:49:27 +02:00
Valentin Gagarin a007c5ff7d add TODOs 2024-10-12 01:49:18 +02:00
Valentin Gagarin 61726ab328 clean up artefacts 2024-10-12 01:21:48 +02:00
Valentin Gagarin b2b104e1e4 sort news by date 2024-10-12 01:17:38 +02:00
Valentin Gagarin 6fce43f880 migrate news entries 2024-10-12 01:12:21 +02:00
Valentin Gagarin e6fb3278c6 implement collections 2024-10-12 01:12:21 +02:00
Valentin Gagarin 732ee62eed put partners in a directory 2024-10-11 18:27:05 +02:00