Documentation Example Macros

Hello I’ve noticed there’s a number of inconsistencies when it comes to code examples. For example on the regexp operator example tiddler it uses the .operator-example macro, but for the last example it uses the .wikitext-example-without-html macro. I dug around a bit and encountered the .example macro which gives nearly the same result and puts a “Try It” slider button that shows the result.

I don’t see any of these macros mentioned in Documentation Macros. Is there a particular reason to use one particular example macro over another? .example seems the most intuitive.

I understand we probably don’t want to remove any macro but trying to understand what is the existing precedent.

Yes indeed, it’s quite a problem. I try to keep an eye on things, but inconsistencies creep in, and then are surprisingly expensive to fix. The tricky tension is between discouraging contributors who have their contributions rejected for what can seem trivial reasons, and the compound effect of lots of little inconsistencies building up over the years.

Another peculiarity of the filter operator docs is that some of the docs tiddlers define fields that are not actually included in the view template that handles the common parts of the filter docs, but those fields are included in the big table of filter operators.

Stepping back, thinking about how we might address a systematic review of the docs, there is perhaps an opportunity arising from another long held goal of mine: to repackage the reference documentation as a plugin so that it can be installed from the plugin library, and people can opt to have the reference material integrated into their own wiki. We do actually already partially do this, but it doesn’t work properly because a lot of the docs macros are not designed to work with shadow tiddlers.

So, we could establish a new reference documentation plugin, and then systematically move content over to it as it is reviewed and refreshed. We might start with the filter operator docs, reviewing and codifying standards for how they are written, and then applying them to each in turn.

The idea would be that systematically lifting and shifting the documentation to a new location would make it easier to keep track of progress, and ensure that every fragment of documentation is reviewed.

1 Like