On 08/01/2017 04:27 PM, Hans Hagen wrote:
> On 7/31/2017 7:16 PM, Pablo Rodriguez wrote:
>> [...]
>> Would it be possible to have a new \typebufferinline that behaves such
>> as \type above (and has the same options in \setuptype)?
>>
>> The most important part isn’t the suppression of line breaks inside, but
>> avoiding the addition of line breaks after and before the typed buffer.
>>
>> I have been reading buff-ver.mkiv, but I’m afraid I cannot contribute
>> such a patch.
>>
>> This is essential to have \xmlprettyprintinline and
>> \xmlprettyprintinlinetext in order to handle inline code in XML.
> 
> \startbuffer[foo]
> foo \bar{crap}
> \stopbuffer
> 
> \starttext
>      \typebuffer[foo]
> \stoptext

Many thanks for your reply, Hans.

I’m afraid this isn’t what I was looking for.

As shown in the following sample, I need \xmlprettyprinttext for code
inside a paragraph, not building its own paragraph.

    \startbuffer[demo]
    <doc>
    <p>I can use colored code blocks:</p>
    <div class="sourceCode"><pre class="sourceCode tex"><code
class="sourceCode latex"><span class="fu">\starttext</span>
    <span class="fu">\ConTeXt\ </span>is awesome!
    <span class="fu">\stoptext</span></code></pre></div>
    <p>But I’m afraid I cannot use <code class="sourceCode latex"><span
class="fu">\xmlprettyprinttext</span></code> inline.</p>
    </doc>
    \stopbuffer

    \startxmlsetups xml:initialize
         \xmlsetsetup{#1}{doc|p|code}{xml:*}
         \xmlsetsetup{#1}{pre/code}{xml:pre:code}
    \stopxmlsetups

    \xmlregistersetup{xml:initialize}

    \startxmlsetups xml:doc
         \xmlflush{#1}
    \stopxmlsetups

    \startxmlsetups xml:p
         \startpar\xmlflush{#1}\stoppar
    \stopxmlsetups

    \startxmlsetups xml:pre:code
         \xmlprettyprinttext{#1}{tex}
    \stopxmlsetups

    \startxmlsetups xml:code
        \begingroup\xmlprettyprinttext{#1}{tex}\endgroup
    \stopxmlsetups

    \starttext

    \subject{Dealing with XML}

         \xmlprocessbuffer{main}{demo}{}

    \subject{In standard \ConTeXt}

    \setuptyping[option=TEX]
    \setuptype[option=TEX]

    I can use colored code blocks:

    \starttyping
    \starttext
    \ConTeXt\ is awesome!
    \stoptext
    \stoptyping

    But I'm afraid I cannot use \type{\xmlprettyprinttext} inline.
    \stoptext

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to