fabricate-site / fabricate

Next-generation static website generation for Clojure
https://fabricate.site
Eclipse Public License 1.0
57 stars 2 forks source link

Improve display of code + fabricate template examples #44

Open respatialized opened 2 years ago

respatialized commented 2 years ago

Some preliminary ideas:

  1. Syntax highlighting - this might just work "out of the box" with conventional Clojure syntax highlighters, or may require extending one
  2. Pretty-printing - inserting line breaks in the right places would probably be helpful as well; many Clojure source formatters could help with this
respatialized commented 2 years ago

Some notes on pretty-printing tools:

  1. zprint seems like the most complete, but introduces a fair number of dependencies. Importantly, operates on clojure data structures (as it was designed for REPL usage).
  2. glow seems all right (only really adding antlr on top of Fabricate's existing dependencies), but the default api assumes a clojure string -> html string roundtrip and it imposes the "themes" abstraction on the mapping of symbols to colors
  3. parinferish is similarly lightweight, and nicely just formats each tokenized item into a span with a descriptive class. still does a roundtrip to and from a string.
  4. rewrite-clj - pretty comprehensive, operates on clojure data, already has been used to write a helpful guide for syntax highlighting. Only introduces Clojure 1.8 as a dependency on top of tools.reader. Probably the best choice.
respatialized commented 2 years ago

Some functionality for this was introduced by 460cee1 and continues to be refined. See also #51.