# Re: [NTG-context] type and typing comments for TeX and Lua

On Thu, 21 Dec 2017, Pablo Rodriguez wrote:


On 12/21/2017 08:05 PM, Aditya Mahajan wrote:

On Thu, 21 Dec 2017, Pablo Rodriguez wrote:

[...]
I don’t remember which were the options in t-vim,  but I need the
options from \setuptyping and \setuptype.



Currently vim does not support these primarily because I don't use XML so I never thought of this.


Could you send me a minimal example showing how \xmlprettyprinttext is used and I can check how to create an interface for t-vim.


The goodie (as per lxml-ini.mkiv) reads as follow:

\def\xmltempbuffername{xml-temp}

\unexpanded\def\prettyprintbuffer#1#2% only used here
{\ifdefined\scitebuffer
\scitebuffer[#2][#1]%
\else
\typebuffer[#1][\c!option=#2]%
\fi}

%~ \unexpanded\def\xmlprettyprint#1#2%
%~ {\xmltobufferverbose{#1}{.}{\xmltempbuffername}%
%~ \prettyprintbuffer\xmltempbuffername{#2}}

\unexpanded\def\xmlprettyprinttext#1#2%
{\xmltobuffertextonly{#1}{.}{\xmltempbuffername}%
\prettyprintbuffer\xmltempbuffername{#2}}

\unexpanded\def\inlineprettyprintbuffer#1#2% only used here
{\ifdefined\sciteinlinebuffer
\sciteinlinebuffer[#2][#1]%
\else
\typeinlinebuffer[#1][\c!option=#2]%
\fi}

%~ \unexpanded\def\xmlinlineprettyprint#1#2%
%~ {\xmltobufferverbose{#1}{.}{\xmltempbuffername}%
%~ \inlineprettyprintbuffer\xmltempbuffername{#2}}

\unexpanded\def\xmlinlineprettyprinttext#1#2%
{\xmltobuffertextonly{#1}{.}{\xmltempbuffername}%
\inlineprettyprintbuffer\xmltempbuffername{#2}}

\xmltobuffertextonly is required to clean HTML hightlighted code, such
as in https://shorturl.at/pS124.

This is why only adapting both \xmlprettyprinttext and
\xmlinlineprettyprint gets the fuctionality for the other two commands.

The commands are invoked in this way:

\xmlinlineprettyprinttext{#1}{tex}

\xmlprettyprinttext{#1}{lua}

Maybe adapting \prettyprintbuffer and \inlineprettyprintbuffer to the
t-vim module works fine. (But this code is all Greek to me.)

Many thanks for your help again,



Can you post a minimal working example. I don't use XML so it is difficult for me to understand how these commands are used in practice.

Thanks,
Aditya
___________________________________________________________________________________
___________________________________________________________________________________