vscode-blockman icon indicating copy to clipboard operation
vscode-blockman copied to clipboard

Feature Request: Support if-directives from AsciiDoc

Open CWempe opened this issue 4 years ago • 1 comments

It would be great if ifdef and endif directives from AsciiDoc would be supported. These "blocks" are not defined by brackets or tags, but they should be considered as blocks, I think.

The blocks are defined from ifdef::foo[] (or ifndef:foo[]) to endif.

ifdef::foo[]
This content is for GitHub only.
endif::[]

Or endif::[] can include the same attribute as the beginning like endif::foo[].

ifdef::foo[]
Thius is some Text.
And some more Text.
endif::foo[]

There is also ifeval: You can use this to supports multiple languages in one document. And this is where blockman really would come in handy.

ifeval::["{lang}" == "de"]
Das ist mein Text.
endif::[]
ifeval::["{lang}" == "en"]
This is my text.
endif::[]
ifeval::["{lang}" == "es"]
Spanish text.
endif::[]

There are also one-liner, that I would not consider as blocks.

ifdef::foo[This is some text]

CWempe avatar Jun 19 '21 11:06 CWempe

I hope to try it in the near future.

leodevbro avatar Jun 20 '21 10:06 leodevbro