ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* (again) \typebufferinline for XML inline code
@ 2017-07-31 17:16 Pablo Rodriguez
  2017-08-01 14:27 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2017-07-31 17:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) \typebufferinline for XML inline code
  2017-07-31 17:16 (again) \typebufferinline for XML inline code Pablo Rodriguez
@ 2017-08-01 14:27 ` Hans Hagen
  2017-08-01 19:12   ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2017-08-01 14:27 UTC (permalink / raw)
  To: Pablo Rodriguez, mailing list for ConTeXt users

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) \typebufferinline for XML inline code
  2017-08-01 14:27 ` Hans Hagen
@ 2017-08-01 19:12   ` Pablo Rodriguez
  2017-08-02  9:21     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2017-08-01 19:12 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) \typebufferinline for XML inline code
  2017-08-01 19:12   ` Pablo Rodriguez
@ 2017-08-02  9:21     ` Hans Hagen
  2017-08-02 15:58       ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2017-08-02  9:21 UTC (permalink / raw)
  To: ntg-context

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) \typebufferinline for XML inline code
  2017-08-02  9:21     ` Hans Hagen
@ 2017-08-02 15:58       ` Pablo Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2017-08-02 15:58 UTC (permalink / raw)
  To: ntg-context

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-02 15:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-31 17:16 (again) \typebufferinline for XML inline code Pablo Rodriguez
2017-08-01 14:27 ` Hans Hagen
2017-08-01 19:12   ` Pablo Rodriguez
2017-08-02  9:21     ` Hans Hagen
2017-08-02 15:58       ` Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).