macana

Static site generator for Obsidian Vault

Use helper for HTML class generation instead of simple `const enum` Manual naming using `const enum` works fine. It's definitely better than using bare string literals. However it's error-prone and difficult to maintain short class names: even if I take care on unique prefix constraint, class names would collide inside a namespace if the file have many class names. This problem became noticable when I authored the `from_mdast/code.tsx`, which defines every class names for Prism tokens. This patch frees mental overhead of carefully defining actuall class names, and (hopefully) helps compression algorithms (e.g. gzip) to work better because of repeated patterns after prefixes.

Changes

13 changed files (+326/-354)