[Standards] Syntax Highlighting in XEPs

Tobias M tmarkmann at googlemail.com
Sat Jan 28 16:00:31 UTC 2017


> On 28 Jan 2017, at 16:50, Sam Whited <sam at samwhited.com> wrote:
> 
> Currently there are several XEPs that contain examples of a round trip
> between the client and the server that delineate client sent packets
> and server sent packets with some text similar to this:
> 
> ```
> Client:
> <iq/>
> 
> Server:
> <iq type='result'/>
> ```
> 
> This leads to strange results in the syntax highlighting of the example.
> My initial thought was to replace them with comments (possibly noting
> that the comments were for example only and not valid in an XMPP
> stream if it wasn't obvious from the context):
> 
> ```
> <!-- Client -->
> <iq/>
> 
> <!-- Server -->
> <iq type='result'/>
> ```
> 
> but someone else told me they weren't a fan of that approach. Does
> anyone have opinions on why we should or should not use comments? Any
> alternative ideas?

Instead of :
>       <example caption='Focus updates payload information for a channel'>
>         <![CDATA[
> SEND: <iq to='garden.montague.lit' from='romeo at montague.lit/orchard' 
>           type='set' id='74s'>
>>       </iq>
> ]]></example>

You could have:
>  <protocol-example caption='Focus updates payload information for a channel’>
> 	<send-example>
>         <![CDATA[
> 	<iq to='garden.montague.lit' from='romeo at montague.lit/orchard' 
>           type='set' id='74s'>
>>       </iq>]]>
> 	</send-example>
> </protocol-example>

The same thing for the receiving part, so you could have multiple send-example/recv-example in a protocol-example element. I think the changes to our XSL for HTML/PDF generation should be minimal to support that.

Cheers,
Tobi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20170128/7418ca96/attachment.html>


More information about the Standards mailing list