On 04/12/11 03:16, Dag Wieers wrote:
Hi,

I am now implementing comments in ODF using annotations. This works well, but
multi-line comments are considered by AsciiDoc to be separate comments, even
when trailing th line with a plus (+).

For example:

// FIXME: Insert the various features from the Release Notes +
// include the information from the presentations +
// and optionally the rescue creation and recovery workflow

Will create three different annotations instead of one :-/


Also, ODF annotations keep track of the author and a timestamp. Would it be
possible to e.g. map the content of the comment to something that can be used ?

Ideally something like this should work:

// FIXME: Insert the various features from the Release Notes +
// include the information from the presentations +
// (by dag on 2011-12-03)

this would then generate:

<text:p text:style-name="empty"><office:annotation>
<dc:creator>dag</dc:creator>
<dc:date>2011-12-03T00:00:00</dc:date>
<text:p>{passtext}</text:p>
</office:annotation></text:p>

Format could be english-agnostic like (dag/2011-12-03).

How could this be done ? Can we improve the syntax for this ?


The single line comments are implemented as block macros which are not multi-line. The easiest solution would be to define a delimited comment block that generates output. The current delimited comment block does not generate output, which is very useful, but not what you want.

For example, it would be easy to implement a 'comment' style listing block:

[comment,dag,2011-12-03]
---------------------------------------------------------
FIXME: Insert the various features from the Release Notes
         include the information from the presentations
---------------------------------------------------------

You would need something like this in the odt.comf:

[+blockdef-listing]
comment-style=template="commentblock"

[commentblock]
<text:p text:style-name="empty"><office:annotation>
<dc:creator>{2}</dc:creator>
<dc:date>{3}</dc:date>
<text:p>
|
</text:p>
</office:annotation></text:p>


I've included annotation creator and date as the 2nd and 3rd positional 
parameters.

When I tested this I discovered a glaring bug in the append section name syntax feature, so you will need to use the latest version of the trunk:
http://code.google.com/p/asciidoc/source/detail?r=480a633f0fb7c1e098483b7198edaebe091a29c1


Cheers, Stuart

--
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.

Reply via email to