v0.4.0
While still technically a "0." release, v0.4.0 is a major refactor of Dactyl's source code!
As part of the refactor, many unintuitive or weird details have been removed. A few things have been renamed to be more consistent and sensible.
Resolves:
- #1 - specify one or more
filter_paths
in config to be able to import custom filters. - #2 - The hard-to-explain link substitution filter from the Dactyl core has been removed. The new
link_replacement
filter covers the same functionality in a slightly different way. Instead of link replacements being part of page definitions, they're defined in alink_subs
map in the target definition. - #4 See the examples in this repo.
- #15 - The
pdf_template
field at the global level has been renameddefault_pdf_template
. The old name still works but gives a warning. - #16 - Callouts now use the
dactyl-callout
HTML class by default, but you can change it back or otherwise customize it using thecallout_class
config option. Additionally, you can define custom callout types by adding acallout_types
array to the config. (The default is still tip/note/caution/warning.) - #17 - Both the preprocessor and templates get new fields, with the preprocessor getting many more. See the readme for full tables.
Additionally:
- Filters get many more arguments, including access to global config, the Dactyl logger object, and categories. It's recommended that the
filter_markdown()
,filter_html()
, andfilter_soup()
functions in a filter take a **kwargs argument to maintain compatibility with future versions of Dactyl, which may add more keyword arguments. - Githubify mode has been removed and replaced by a similar Markdown export mode (
--md
). Markdown mode runs the preprocessor and markdown filters on the input files. It also builds every file by default. ("Githubify" mode didn't run filters, although it attempted link substitution, and it only worked on a single file.) - New
--only
option allows you to build only a single file from a target. (This is similar to how Githubify used to work, except now it can be used with HTML and PDF too.) Pass the input (*.md
) or output (*.html
) filename as the argument. - Output paths can now contain folders. Dactyl automatically creates folders as necessary.
- New built-in filters:
link_replacement
(replaces the removed link substitution functionality) anddemote_headers
(helps to adjust header levels to fit appropriately in your hierarchy without editing the markdown files directly; can be run only in PDF mode, too) - The
sidebar_content
template variable has been renamed (more semantically)page_toc
; the old name remains as an alias. Dactyl no longer sets thesidebar
field of a page automatically. - The preprocessor now runs even on markdown files that are remotely sourced via http/https
- The
buttonize
filter now removes the trailing>
that causes links to be "buttonized"