metaist / inkfill

multi-document template engine
https://metaist.github.io/inkfill/
Other
0 stars 0 forks source link

change: Refs.up to call .define #30

Closed metaist closed 10 months ago

metaist commented 10 months ago

I consistently forget to call .define() on section headings, so I expect others will too.

For the usage pattern where you save off the reference during declaration, you can just call .current right after the section starts.

For the benefit of being able to search for all definitions, just search for .up().

metaist commented 10 months ago

This definitely feels less "functional" because we're doing two things: incrementing the counter and rendering the anchor, so maybe it would be better if .up was treated as a short-hand for .inc().define() or something. But I don't have a lot of need for .inc() except in testing. Maybe I'll come back to this when I need to deal with Figure and Table like things.