Skip to content

v0.4.0

Compare
Choose a tag to compare
@mDuo13 mDuo13 released this 05 Apr 12:30
· 136 commits to master since this release

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 a link_subs map in the target definition.
  • #4 See the examples in this repo.
  • #15 - The pdf_template field at the global level has been renamed default_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 the callout_class config option. Additionally, you can define custom callout types by adding a callout_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(), and filter_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) and demote_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 the sidebar 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"