On 10/12/11 16:07, Lex Trotman wrote:
On Sat, Dec 10, 2011 at 1:03 PM, Dag Wieers<[email protected]> wrote:
On Sat, 10 Dec 2011, Lex Trotman wrote:
On Sat, Dec 10, 2011 at 12:35 PM, Dag Wieers<[email protected]> wrote:
On Sat, 10 Dec 2011, Dag Wieers wrote:
Now I am going to start implementing the new comment/annotation
proposal.
Using a comment-block instead of a listingblock !
I get the following error I do not understand:
asciidoc: WARNING: test-odt.txt: line 257: missing section: [comment]
While I am using the following in odt.conf:
[blockdef-comment]
delimiter=^/{4,}$
options=skip
The above makes it a real comment, ie not output. This option should
be part of the default style definition so only that gets skipped, ie
a real comment. (I think, I havn't had a chance to try it).
I tried this too (which I liked more), but to no avail:
[blockdef-comment]
delimiter=^/{4,}$
options=sectionbody
posattrs=style,name,date
default-style=options="skip"
annotation-style=template="annotationblock"
comment-style=template="commentblock"
But it spawns the same error:
asciidoc: WARNING: test-odt.txt: line 257: missing section: [comment]
So I have been trying a lot of other stuff. But I rather understand what
this error means. And why defining a [comment] section fixes both this error
and the same error for [annotation] while only showing DUH! once :-(
Unfortunately I think there is some internal hardcoded processing of
blocks called "comment" in asciidoc.py. The following works fine:
[blockdef-fred]
delimiter=^%{4,}$
posattrs=style,name,date
style=default
default-style=template="skipcomment",options=("skip",)
annotation-style=template="annotationblock"
comment-style=template="commentblock"
[annotationblock]
{hideannotations%}<text:p
text:style-name="empty"><office:annotation><dc:creator>{name=AsciiDoc}</dc:creator><dc:date>{date=}</dc:date><text:p>|</text:p></office:annotation></text:p>
[commentblock]
{showcomments#}<text:p text:style-name="comment">|</text:p>
[skipcomment]
{empty}
If the block name is [blockdef-comment] it doesn't work.
(had to change the delimeter otherwise the standard comment is
recognised first and it never gets to this, but the point is that if
the block name is different its ok)
I don't think Stuart has made the fix yet to allow his suggested:
[style]
////
a styled comment
////
syntax.
Correct! The devil is always in the details. asciidoc does not consume attribute
lists that precede comments. I'm working on the complete annotation block
comment patch, but here's the diff:
8<-----------------------------
diff -r 480a633f0fb7 asciidoc.conf
--- a/asciidoc.conf»····Sun Dec 04 12:31:25 2011 +1300
+++ b/asciidoc.conf»····Sat Dec 10 17:23:24 2011 +1300
@@ -288,6 +288,8 @@
[blockdef-comment]
delimiter=^/{4,}$
options=skip
+posattrs=style
+annotation-style=template="commentblock",options=(),subs=["verbatim"]
·
[blockdef-sidebar]
delimiter=^\*{4,}$
diff -r 480a633f0fb7 asciidoc.py
--- a/asciidoc.py»······Sun Dec 04 12:31:25 2011 +1300
+++ b/asciidoc.py»······Sat Dec 10 17:23:24 2011 +1300
@@ -3030,9 +3030,8 @@
AbstractBlock.translate(self)
reader.read() # Discard delimiter.
attrs = {}
- if self.short_name() != 'comment':
- BlockTitle.consume(attrs)
- AttributeList.consume(attrs)
+ BlockTitle.consume(attrs)
+ AttributeList.consume(attrs)
self.merge_attributes(attrs)
self.push_blockname()
options = self.parameters.options
8<---------------------------
Cheers, Stuart
Cheers
Lex
--
-- dag wieers, [email protected], http://dag.wieers.com/
-- dagit linux solutions, [email protected], http://dagit.net/
[Any errors in spelling, tact or fact are transmission errors]
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.