middleman / middleman-asciidoc

:beginner: AsciiDoc support for Middleman 4. (In Middleman 3, AsciiDoc support is provided by a core extension).
https://middlemanapp.com
Other
27 stars 12 forks source link

Provide a way to soft unset an AsciiDoc attribute value in the config #72

Closed mojavelinux closed 6 years ago

mojavelinux commented 6 years ago

This integration sets several implicit attribute values, such as imagesdir. It should be possible to unset these attributes, either globally or per page, while still allowing the attribute to be set in the document. We'll call this a "soft" unset.

mojavelinux commented 6 years ago

There are two proposals on the table.

The first proposal is to combine the negated attribute (!name) with the soft set flag, @.

'!name' => '@'

The problem with this proposal is that it's being considered for core as a way to unset implicit attributes in Asciidoctor itself. If we hijack it, then we may lose that ability.

The other is to use a subtraction syntax:

'-name' => ''

The latter is implemented in the Jekyll plugin. We could support the second syntax until the fate of the first syntax is resolved.

mojavelinux commented 6 years ago

As part of this change, custom attributes should be resolved after all implicit attributes (imagesdir, imagesoutdir, relfilesuffix, etc) are assigned by this extension.