Soupault 4.10.0 release

Estimated reading time: less than a minute.

Date:

Soupault 4.10.0 is available for download from my own server and from GitHub releases. It fixes the complete_page_selector option that unfortunately was broken in recent releases. It also fixes a few bugs with TOML parsing that affected Windows users and adds a new option to the delete_element widget that allows deleting elements only if they don't have certain children inside.

New features

Deleting only elements that do not have certain children

The delete_element widget has a new option: when_no_child.

For example, suppose you have footnotes container in your template that looks like this: <div id="footnotes"> <hr class="footnotes-separator"> </div>. If a page has footnotes, it would contain something like <p class="footnote">.... If not, it would only have the <hr> element in it.

Deleting it from pages that don’t have any footnotes cannot be done with only_if_empty because the container has that auxilliary element in it.

However, with the new option you can make the widget delete the container only if nothing inside it matches the selector of actual footnotes.

[widgets.clean-up-footnote-containers]
  after = "footnotes"
  widget = "delete_element"
  selector = "div#footnotes"
  when_no_child = "p.footnote"

Bug fixes