Releases: vito/booklit
v0.3.0: going out with style
breaking changes
- styled templates now execute with the
booklit.Styled
itself as.
, with
the unfortunate outcome being that any existing templates will cause an
infinite loop upon rendering. make sure to change them all to.Content
for
the previous behavior!
new features
-
you can now attach other
booklit.Content
to abooklit.Styled
via a
Partials
field. this allows for templates to be executed with multiple
pieces of content, e.g. aTitle
partial to accompany the primary content. -
when
\styled
is set on a section, it will also result in checking for a
(style name)-page.tmpl
in place of the normalpage.tmpl
when the section
is rendered at the top level
fixes
- improved error propagation when using plugins and/or running the server
v0.2.0: irasshaimase!
breaking changes
- removed the
PluginFactory
interface in favor of just using a function type
new features
-
the
booklit
command now supports serving the content and rebuilding when it
changes, by specifying-s PORT
-
added
\styled
which allows sections to set their own "style", which the
HTML renderer then uses to look up a template.
fixes
- when an extra closing brace is present, a parse error will be returned,
rather than blowing the heck up
misc
-
lots more documentation for booklit itself. pretty much everything should be
covered now. -
renamed 'sentence' to 'line' in a bunch of places internally; i found when
documenting the syntax that this terminology wasn't really appropriate
v0.1.0: it's pretty good now
this release packs quite a punch. in using booklit for https://concouse.ci, we
found a lot of room for improvement, and iterated quickly along the way to
where we are now.
there were also just a bunch of silly things missing. like comments.
so, all that seems to deserve at least a minor bump!
here are the changes grouped by section:
content
-
sections can now contain "partials", which are named bits of content that can
be set by the document, accessed by the template, and stored or accessed by
plugins.this introduces a much nicer way of developing websites with a lot of
non-prose content; portions can be written in the document, taking advantage
of booklit semantics, and plucked piece-by-piece into the template.plugins can also store data in partials, allowing them to communicate data to
their own templates.in general, this will reduce the number of lines of code in plugins just to
get things looking the right way, and instead allow templates, documents, and
plugins to do what they individually do best. -
styled content via
booklit.Styled
will now treat the style as an artbirary
string denoting a template to use. this was basically already how it worked,
but only with the pre-declared set of styles.with this change, plugins can use whatever templates they want to render any
content, greatly increasing flexibility. -
a section can declare
\single-page
, which will cause all\split-sections
calls to no longer result in sections being split, and instead only reset the
"page depth" (which is used for e.g. determining<h1-h6>
. this is useful
for having a single-page form of your otherwise many-paged documentation. -
added a
rawHTML
template function, which can be used for directly rendering
trusted HTML content. this is useful for e.g. using a syntax highlighter to
generate a bunch of styled HTML. -
added
\table
and\definitions
-
added
\omit-children-from-table-of-contents
, which modifies the section
to... omit its children from any table of contents. -
added
\aux{...}
, which is used to omit text from a title when referenced by
a link or by the table of contents.note that any custom templates must be changed to call
stripAux
before
passing the title torender
. -
added
\aside{...}
for adding side-notes and such. by default, it is
rendered as a<blockquote class="aside">
. -
added
\inset{...}
for rendering a block of content indented a bit. -
added
\image{path/to/file.png}
. -
added
booklit.Element
, which is likebooklit.Block
but for inline
(sentence) elements. it renders as a<span>
with the given class by
default.this is primarily useful for plugins.
compiler
-
added
--allow-broken-references
, which can be handy for quick local
iteration where expectations are lower. -
fixed
render
calls in templates not using user-provided templates when
recursing. -
fixed handling of
\split-sections
in sub-sections.
syntax
-
support for comments:
foo {- bar -}baz {- This is a block comment. {- This is a nested block comment. -} Bye! -}
-
plugin methods with no arguments can now be spliced in to words like so:
foo{\bar}baz
-
sentences in arguments can now be wrapped onto the next line; a single space
will be put in place of the linebreaksthis is a really really really \italic{really really really long sentence} here!
-
empty arguments like
\foo{bar}{}{baz}
are now supported, and act like empty
strings
v0.0.1: well that's a first
initial release!
still a bit rocky, and with pretty bad error messages, but you
get the idea.