(again) \typebufferinline for XML inline code
Hans, sorry for asking for this again, but I really need it to write some documents about ConTeXt. I have the following sample: \startTEXpage[offset=1em] only \type{a b c} one line \stopTEXpage \stoptext \type 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. Many thanks for your help, Pablo -- http://www.ousia.tk
On 7/31/2017 7:16 PM, Pablo Rodriguez wrote:
Hans,
sorry for asking for this again, but I really need it to write some documents about ConTeXt.
I have the following sample:
\startTEXpage[offset=1em] only \type{a
b
c} one line \stopTEXpage \stoptext
\type
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 -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
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
On 8/1/2017 9:12 PM, Pablo Rodriguez wrote:
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.
i'll make \xmlinlineprettyprinttext but there is where this madness stops
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
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 08/02/2017 11:21 AM, Hans Hagen wrote:
On 8/1/2017 9:12 PM, Pablo Rodriguez wrote:
Many thanks for your reply, Hans.
I’m afraid this isn’t what I was looking for.
i'll make \xmlinlineprettyprinttext but there is where this madness stops
Many thanks for the implementation, Hans. Pablo -- http://www.ousia.tk
participants (2)
-
Hans Hagen
-
Pablo Rodriguez