Skip to content

Feature request: optionally disable DW substitution in a whole code block #7

@mburnicki

Description

@mburnicki

I'm often prefering the codedoc plugin over the builtin DW <code> syntax because <codedoc code> supports highlighting of specific parts of the sample text. This is very helpful e.g. if you want to highlight a specific part of a command, or a specific piece of text of the output from a command.

However, usage can be a bit tricky because parts of the text can be unexpectedly changed by DW's substitution, which is often not even obvious.

For example, a long command line parameter like --version is displayed correctly in a <code> block, but shows up as -version (with a single dash) in a <codedoc code> block. You can only avoid this if you explicitly use a codedoc-specific syntax (~~codedoc:clean: ... ~~) to escape every single of such potential substitutions, and you can easily overlook places like -- being substituted by -.

Also, if the output text from a command contains an email address enclosed in angle brackets, you individually have to escape each of the angle brackets < and > to see the real output of the command.

Even though I find codedoc very useful, I've often stumbled across things like this and it takes quite some time to review the generated web page to see if the DW substitution hasn't unexpectedly changed something.

I've also set up a sample page that tries to explain this in more detail:
https://wiki.burnicki.net/miscellaneous_tips:00_dokuwiki:a_codedoc_plugin_test_page

So unless I'm missing something that already does this, it would be a great feature (IMO) to be able to disable DW substitution in specific code blocks, using syntax like

<codedoc code:raw>
</codedoc>

or similar. I have to admit that I'm not very familiar with the way DW and the plugins work in detail, if it comes to syntax parsing. So I can't tell if it's easily possible to implement this, but it would be great if all substitutions except the codedoc-specific things like

~~codedoc:<em>~~ ... </em>~~

could be disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions