Closed junaruga closed 8 years ago
Overall, this looks good. I think we should use the single-line conditional in the case of inline elements like phrase.
a
ifdef::condition[b]
c
Does that seem reasonable?
Hi, @mojavelinux Thanks for your checking.
Well, when I compared single line: ifdef , and multi line ifdef,
single line ifdef
:foo:
a
ifdef::foo[b]
c
multi line ifdef
:foo:
a
ifdef::foo[]
b
endif::foo[]
c
both cases will get below same result. I checked it by asciidoctor firefox plugin.
a b c
However, multi line ifdef looks better than single line ifdef. Because
For example of merit 1, in below case, user can expect to display the context (2 lines) with condition "foo".
<para condition="foo">
Today is Friday.
Tomorrow is Saturday.
</para>
But below actual generated result does not work.
:foo:
ifdef::foo[Today is Friday.
Tomorrow is Saturday.]
This actual result for html with asciidoctor firefox plugin, is ifdef::foo[Today is Friday. Tomorrow is Saturday.]
. because single-line ifdef is not recognized.
It seems that single-line ifdef exists for single line context.
I do not want to use below way that works in this case, because this looks more complicated.
ifdef::foo[Today is Friday.]
ifdef::foo[Tomorrow is Saturday.]
However below multi line ifdef works for this case, easily.
:foo:
ifdef::foo[]
Today is Friday.
Tomorrow is Saturday.
endif::foo[]
For example of merit 2 you can see in below case.
:foo:
a
ifdef::foo[b]c]
d
This actual result works. "a b]c d" is displayed. But When open the adoc file with vim, vim syntax highlight for adoc mode, fails to show correct highlight. So, this is the evidence that behavior of "]" in the single line ifdef context, is not clearly for users including vim itself.
So, I prefered "multi line ifdef" than single line ifdef in this time.
How do you think?
Hi, @mojavelinux How do you think? If you agree my opinion, and you like to use multi line ifdef, as I found conflicts between my pull-request and current master, I can solve the conflict, and can do rebase my branch for the pull-request, by myself.
Hi, @mojavelinux ( Cc: @mrietveld ) After my previous comment, 7 days has been passed. I would like you to merge this modification to master branch. Is there any problem for you?
Thanks.
@mrietveld Thanks!!
I added new feature about condition. https://github.com/asciidoctor/docbookrx/issues/43
The "condition" of DocBook XSL is converted to "ifdef".
There are several restriction for usage.
Could you check my code? Thanks.