[NTG-context] Re: upload

2023-08-10 Thread Hans Hagen

On 8/11/2023 3:31 AM, Thangalin wrote:

Did arguments regress in 2023.08.10 02:59?

$ cat u.tex
\starttext
Feisty arguments
\stoptext
$ context u.tex
$  ls -la *.pdf
-rw-r--r-- 1 username username 6279 Aug 10 18:28 u.pdf
$ context --arguments=x=y u.tex | grep error
tex error   > tex error on line 13 in file : Use of \getrawparameters
doesn't match its definition
mtx-context | fatal error: return code: 1

This was working with the previous release.

line 802 in core-env should be:

\permanent\tolerant\protected\def\setupenv
  {\syst_variables_set\getrawparameters[\s!environment]}

(seems i forgot that one when doing some cleanup)

Hans

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: upload

2023-08-10 Thread Thangalin
Did arguments regress in 2023.08.10 02:59?

$ cat u.tex
\starttext
Feisty arguments
\stoptext
$ context u.tex
$  ls -la *.pdf
-rw-r--r-- 1 username username 6279 Aug 10 18:28 u.pdf
$ context --arguments=x=y u.tex | grep error
tex error   > tex error on line 13 in file : Use of \getrawparameters
doesn't match its definition
mtx-context | fatal error: return code: 1

This was working with the previous release.

On Wed, Aug 9, 2023 at 8:43 AM Hans Hagen  wrote:

> Hi,
>
> I uploaded a new lmtx. There are some new features that wil be revealed
> in the future (likely after the meeting) but here is one:
>
> \starttext
>
>  \defineoverlay
>[test]
>[\color
>   [blue]
>   {TEST
>\inframed
>  [foregroundcolor=red]
>  {xxx}
>TEST}]
>
>  \framed
>[background=test,
> foregroundstyle=\switchtobodyfont[small]]
>{test}
>
> \stoptext
>
>  From now on many commands accept (properly) nested [] inside commands
> that use [] as fences (like the setup commands) where it makes sense. It
> is up to the user to decide to use {} (as before) or not but it is less
> error prone.
>
> It is now also possible to nest setups as in
>
> \starttext
>
> \startsetups one
>  \startsetups [three]
>  HERE
>  \stopsetups
> \stopsetups
>
> \startsetups two
>  \startsetups [three]
>  THERE
>  \stopsetups
> \stopsetups
>
> \setups[one] \setups[three]
>
> \setups[two] \setups[three]
>
> \stoptext
>
> As part of the ongoing improvements on math rendering we added some
> classic lm/cm kerns (between upperacse and periods / commas) in the
> goodie files.
>
> Some lowlevel manuals have been extended, explaining experimental 'named
> cross macro nesting parameter referencing' and 'constrained cq. retained
> assignments', but that is only relevant for those interested in
> overcoming some limitations in the traditional engines.
>
> Hans
>
>
> -
>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 /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: xml: matches always child of other element

2023-08-10 Thread Hans Hagen via ntg-context

Hi Denis,


Ok, after a bit of more testing I can now come up with another example.

The version using startstop works, but with the normal command, I'm always 
getting back the content of the first element. I thought it might be an 
expansion issue, but \expanded and also expansion=yes or expansion=xml on 
\definedescription have no effect. Perhaps most interestingly, adding using the 
startstop variant together with the command variant gives correct results for 
the command as well (xml:index-entry-term-3).

I have now found a way to proceed with my project (I'll just use the startstop 
variant), but I'd still be interested in understanding what is happening here. 
Does anyone know? Or is there anything I'm doing wrong here?


This is kind of tricky but here is a variant test

\startxmlsetups xml:index-entry-term-1 % does not work
\indexentry{1: \xmlflush{#1}}
% test \par
\indexentry{2: \xmlflush{#1}}
3: \xmlflush{#1}
\par
\stopxmlsetups

it has to do with the fact that when you don't use a start / stop the 
next paragraph is sees as description content so then you grab the same 
entry (sort of) nested


you can uncomment the "test \par" to see the side effects (twice one 
versus 1/2)


it's kind of hard to debug this, i admit,

Hans



%%
\startxmlsetups xml:test
   \xmlsetsetup{#1}{*}{-}
   \xmlsetsetup{#1}{index}{xml:*}
   \xmlsetsetup{#1}{index-entry}{xml:index-entry}
   %\xmlsetsetup{#1}{term}{xml:index-entry-term}
   \xmlsetsetup{#1}{term}{xml:index-entry-term-2}
   \xmlsetsetup{#1}{term}{xml:index-entry-term-3}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

% Index

\startxmlsetups xml:book-back
   \xmlflush{#1}
\stopxmlsetups

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

\definedescription[indexentry][]
%\definedescription[indexentry][expansion=yes] % has no effect
%\definedescription[indexentry][expansion=xml] % has no effect


\startxmlsetups xml:index-entry
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term % does not work
   \expanded{\indexentry{\xmlflush{#1}}}
   \indexentry{\xmlflush{#1}}
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term-2 % works
\startindexentry{\xmlflush{#1}}
\xmlflush{#1}
\stopindexentry
\stopxmlsetups

\startxmlsetups xml:index-entry-term-3 % works
\expanded{\indexentry{\xmlflush{#1}}}
\indexentry{\xmlflush{#1}}
\startindexentry{\xmlflush{#1}}
\xmlflush{#1}
\stopindexentry
\stopxmlsetups


\startbuffer[test]



One


Two


Three


\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext
%%

Von: denis.ma...@unibe.ch 
Gesendet: Montag, 24. Juli 2023 15:57
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: xml: matches always child of other element

Interestingly, we should be in the right subtree as this modified example is 
supposed to demonstrate (we're getting the correct numbers under each 
index-entry-term, just the terms are incorrect in all but the first case):

\startxmlsetups xml:test
 \xmlsetsetup{#1}{*}{-}
 \xmlsetsetup{#1}{index}{xml:*}
 \xmlsetsetup{#1}{index-entry}{xml:index-entry}
 %\xmlsetsetup{#1}{index-entry}{xml:index-entry-2}
 \xmlsetsetup{#1}{term}{xml:index-entry-term}
 \xmlsetsetup{#1}{nav-pointer-group}{xml:*}
 \xmlsetsetup{#1}{nav-pointer}{xml:nav-pointer}
 \xmlsetsetup{#1}{nav-pointer/ext-link}{xml:nav-pointer-link}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

% Index

\startxmlsetups xml:book-back
 \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index
   
\startsectionlevel[title={\xmlfilter{#1}{/index-title-group/title/command(xml:index-title)}},]
 \xmlflush{#1}
   \stopsectionlevel
\stopxmlsetups

\startxmlsetups xml:index-title
 \xmlflush{#1}
\stopxmlsetups

\definedescription[indexentry]
 [alternative=top,
 headstyle=normal,
 headcommand=\hskip-1cm,
 margin=1cm,
 inbetween=,
 ]

\startxmlsetups xml:index-entry
 \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-2
 \xmlfilter{#1}{/term/command(xml:index-entry-term)}%
 \xmlverbatim{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term
 \indexentry{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-group
 \xmlconcat{#1}{/nav-pointer}{, }
\stopxmlsetups

\startxmlsetups xml:nav-pointer
 \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-link
 \xmlflush{#1}
\stopxmlsetups

\startbuffer[test]


   
 Index
   
   
 First
 
   
 1
   
   

[NTG-context] Re: upload

2023-08-10 Thread Henning Hraban Ramm

Am 10.08.23 um 17:02 schrieb Wolfgang Schuster:
indeed that was the issue, seems like i generated the update but 
didn't push it, can you check again?


It works now as expected.


Confirmed.
Thank you!

Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: upload

2023-08-10 Thread Wolfgang Schuster

Hans Hagen via ntg-context schrieb am 10.08.2023 um 16:41:

On 8/10/2023 3:52 PM, Wolfgang Schuster wrote:

Henning Hraban Ramm schrieb am 10.08.2023 um 15:33:

I was already on the latest, and the problem persists. Here’s a MWE:

"""
\setupreferencing[left=,right=,]

\starttext

\about[something]

\stoptext
"""


It's unrelated to \about. Using nothing as argument to the last key 
doesn't work, e.g. in the following example "b" keeps \endgroup as 
value when I wrote "b=".


\starttext

\getdummyparameters[a=\begingroup,b=\endgroup]

\dummyparameter{a}
\dummyparameter{b}

% b is still \endgroup

\getdummyparameters[a=,b=]

\dummyparameter{a}
\dummyparameter{b}

\stoptext
indeed that was the issue, seems like i generated the update but 
didn't push it, can you check again?


It works now as expected.

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2023-08-10 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 
 sent 175,487 bytes  received 38,024,206 bytes  3,321,712.43 bytes/sec
 total size is 562,337,758  speedup is 14.72


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2023-08-10.17
233660520   
/var/www/aanhet.net/context//htdocs/archives/context-2023-08-10.17/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2023-08-10.17/current
360409933   
/var/www/aanhet.net/context//htdocs/archives/context-2023-08-10.17
360409933   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: upload

2023-08-10 Thread Hans Hagen via ntg-context

On 8/10/2023 3:52 PM, Wolfgang Schuster wrote:

Henning Hraban Ramm schrieb am 10.08.2023 um 15:33:

I was already on the latest, and the problem persists. Here’s a MWE:

"""
\setupreferencing[left=,right=,]

\starttext

\about[something]

\stoptext
"""


It's unrelated to \about. Using nothing as argument to the last key 
doesn't work, e.g. in the following example "b" keeps \endgroup as value 
when I wrote "b=".


\starttext

\getdummyparameters[a=\begingroup,b=\endgroup]

\dummyparameter{a}
\dummyparameter{b}

% b is still \endgroup

\getdummyparameters[a=,b=]

\dummyparameter{a}
\dummyparameter{b}

\stoptext
indeed that was the issue, seems like i generated the update but didn't 
push it, can you check again?


Hans

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: your opinion about list structures

2023-08-10 Thread Keith McKay

Hi Hraban

Here are my thoughts on your ConTeXt Book.

[TOC] Definitely only show Chapters and Appendices. A list of sections 
could go under the Chapter Title, it would more useful there. I don't 
think there is also a need include sub-sections, (if you have them) it 
could make the list inordinately long.


[Registers] My own preference would be a command and a topic index if 
only for convenience sake.


[Glossary] I don't think an index of abbreviations is necessary if they 
are already in the index.


[Other Lists] I don't think a list of colours is necessary, you could 
just point them to the wiki.


Just my thoughts, and I look forward to read the English version of your 
book. (smiling)


Best Wishes

Keith McKay

p.s. It's been so long since I worked with technical books that I would 
have to blow the dust off them.


On 10/08/2023 14:21, Henning Hraban Ramm wrote:

Hi, this is about my ConTeXt book again…

[ToC]

At the moment, my table of contents has chapters and sections and is 8 
pages long. I would probably hardly use it.


Maybe it would be better to show only chapters (29 content + 12 
appendix = 2 pages) and include a list of sections after the chapter 
title (or not at all).


[Registers]

I split between command and topic index (9 pages each), because I find 
it annoying to have the commands between the topics.
I also include the topics that are mentioned in titles in the index, 
because I hate it if I must look in two places.

(Otherwise I wouldn’t think about omitting the sections from the ToC.)

At the moment there‘s also an index of todo items, but that will 
disappear before print.


[Glossary]

There’s a short dictionary of technical terms in the appendix (8.5 
p.). Each lemma is also included in the index.


Should I add a list of abbreviations? (TDS, TEI, OCG, RAL, PDF, SVG…?)
They’re in the index and explained where they matter – I don’t think 
the meaning of many abbreviations like file types is important.


[Other lists]

Should I include a list of colors, like the output of 
\showcolor[crayola]? (I think it would only bloat the book, and 
everyone can create the list themselves.)


I have lists of supported languages (should get checked), fonts in the 
distribution and all math fonts, because these are not easily 
reproducible (AFAIK).



So, what do you think, and how do you like to work with technical books?
What kind of information (about ConTeXt or documents/printing in 
general) do you find hard to find?


Hraban
___ 

If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: upload

2023-08-10 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 10.08.2023 um 15:33:

I was already on the latest, and the problem persists. Here’s a MWE:

"""
\setupreferencing[left=,right=,]

\starttext

\about[something]

\stoptext
"""


It's unrelated to \about. Using nothing as argument to the last key 
doesn't work, e.g. in the following example "b" keeps \endgroup as value 
when I wrote "b=".


\starttext

\getdummyparameters[a=\begingroup,b=\endgroup]

\dummyparameter{a}
\dummyparameter{b}

% b is still \endgroup

\getdummyparameters[a=,b=]

\dummyparameter{a}
\dummyparameter{b}

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: upload

2023-08-10 Thread Henning Hraban Ramm

Am 10.08.23 um 15:03 schrieb Hans Hagen:

On 8/10/2023 2:57 PM, Henning Hraban Ramm wrote:

Am 09.08.23 um 23:11 schrieb Hans Hagen:

On 8/9/2023 9:29 PM, Rik Kabel wrote:
Two problems with this upload. First, page number suppression no 
longer works. Second, table captions are not displayed.


indeed, probably a fix tomorrow


I don’t know if that’s the same problem, but the current version gives 
a parsing error at

\quotation{\about[kap:example]}

(2023.07.29 still works.)

there was a new upload


I was already on the latest, and the problem persists. Here’s a MWE:

"""
\setupreferencing[left=,right=,]

\starttext

\about[something]

\stoptext
"""

tex error   > tex error on line 5 in file referencetest.tex: Extra 
}, or forgotten \endgroup



\egroup
 \about
...ways \let \\\space \postponenotes \referencingparameter \c!left 
\doifelsereferencefound {#1} {\goto {\limitatetext 
\currentreferencetitle {\referencingparameter \c!width }\unknown 
}[#1]}{}\flushnotes \referencingparameter \c!right

\endgroup

\about[something]

1 \setupreferencing[left=,right=,]
2
3 \starttext
4
5 >>  \about[something]
6
7 \stoptext
8
I've deleted a group-closing symbol because it seems to be spurious, as in
'$x}$'. But perhaps the } is legitimate and you forgot something else, as in
'\hbox{$x}'.
mtx-context | fatal error: return code: 1

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] your opinion about list structures

2023-08-10 Thread Henning Hraban Ramm

Hi, this is about my ConTeXt book again…

[ToC]

At the moment, my table of contents has chapters and sections and is 8 
pages long. I would probably hardly use it.


Maybe it would be better to show only chapters (29 content + 12 appendix 
= 2 pages) and include a list of sections after the chapter title (or 
not at all).


[Registers]

I split between command and topic index (9 pages each), because I find 
it annoying to have the commands between the topics.
I also include the topics that are mentioned in titles in the index, 
because I hate it if I must look in two places.

(Otherwise I wouldn’t think about omitting the sections from the ToC.)

At the moment there‘s also an index of todo items, but that will 
disappear before print.


[Glossary]

There’s a short dictionary of technical terms in the appendix (8.5 p.). 
Each lemma is also included in the index.


Should I add a list of abbreviations? (TDS, TEI, OCG, RAL, PDF, SVG…?)
They’re in the index and explained where they matter – I don’t think the 
meaning of many abbreviations like file types is important.


[Other lists]

Should I include a list of colors, like the output of 
\showcolor[crayola]? (I think it would only bloat the book, and everyone 
can create the list themselves.)


I have lists of supported languages (should get checked), fonts in the 
distribution and all math fonts, because these are not easily 
reproducible (AFAIK).



So, what do you think, and how do you like to work with technical books?
What kind of information (about ConTeXt or documents/printing in 
general) do you find hard to find?


Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: upload

2023-08-10 Thread Hans Hagen

On 8/10/2023 2:57 PM, Henning Hraban Ramm wrote:

Am 09.08.23 um 23:11 schrieb Hans Hagen:

On 8/9/2023 9:29 PM, Rik Kabel wrote:
Two problems with this upload. First, page number suppression no 
longer works. Second, table captions are not displayed.


indeed, probably a fix tomorrow


I don’t know if that’s the same problem, but the current version gives a 
parsing error at

\quotation{\about[kap:example]}

(2023.07.29 still works.)

there was a new upload

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: upload

2023-08-10 Thread Henning Hraban Ramm

Am 09.08.23 um 23:11 schrieb Hans Hagen:

On 8/9/2023 9:29 PM, Rik Kabel wrote:
Two problems with this upload. First, page number suppression no 
longer works. Second, table captions are not displayed.


indeed, probably a fix tomorrow


I don’t know if that’s the same problem, but the current version gives a 
parsing error at

\quotation{\about[kap:example]}

(2023.07.29 still works.)

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Map XML attributes to variables, dynamically

2023-08-10 Thread Hans Hagen via ntg-context

On 8/10/2023 10:50 AM, Hans Hagen via ntg-context wrote:

On 8/10/2023 10:37 AM, Hans Hagen wrote:

On 8/10/2023 10:14 AM, Thangalin wrote:

Here's an MWE:

attached the more final version


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
% follow up on mail discussion with T

\startbuffer[demo]



Text Goes Here


Different Text Goes Here



\stopbuffer

\startxmlsetups xml:xhtml
\xmlsetsetup{\xmldocument}{*}{-}
\xmlsetsetup{\xmldocument}{html|body|div}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

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

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

\startxmlsetups xml:div
\setupstartstop
[\xmlatt{#1}{class}]
[title=\xmlatt{#1}{data-title}]%
\start[\xmlatt{#1}{class}]%
\xmlflush{#1}
\stop
\blank
used wherever needed: \namedstartstopparameter{concurrent}{title}
\blank
\stopxmlsetups

\definestartstop
   [concurrent]
   [before=\startsection[title={TITLE: 
\namedstartstopparameter{concurrent}{title}}],
after=\stopsection]%

\starttext
\xmlprocessbuffer{main}{demo}{}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Map XML attributes to variables, dynamically

2023-08-10 Thread Hans Hagen via ntg-context

On 8/10/2023 10:37 AM, Hans Hagen wrote:

On 8/10/2023 10:14 AM, Thangalin wrote:

Here's an MWE:

% SOT
\startbuffer[demo]



Text Goes Here


Different Text Goes Here



\stopbuffer

\startxmlsetups xml:xhtml
   \xmlsetsetup{\xmldocument}{*}{-}
   \xmlsetsetup{\xmldocument}{html|body}{xml:*}
   \xmlsetsetup{\xmldocument}{div}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

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

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

\startxmlsetups xml:div
   \setvariable{div}{\xmlatt{#1}{class}}{#1}
   \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

\definestartstop[concurrent][
   before={TITLE: \xmlatt{\getvariable {div} {concurrent} {title}}},
]

\starttext
   \xmlprocessbuffer{main}{demo}{}
\stoptext
% EOT

It doesn't look like the variables are taking, regardless of whether
{title} or {data-title} are used.


\startxmlsetups xml:div
   \setvariable{div}{\xmlatt{#1}{class}}{#1}
   \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

\definestartstop
   [concurrent]
   [before={TITLE: \xmlatt{\getvariable{div}{concurrent}}{data-title}}]

-- watch the braces
-- use data-title and not title

Hans

You can actually do this:

\startxmlsetups xml:div
  \setupstartstop
[\xmlatt{#1}{class}]
[before={TITLE: \xmlatt{#1}{data-title}}]%
  \start[\xmlatt{#1}{class}]%
\xmlflush{#1}
  \stop
\stopxmlsetups

\definestartstop
  [concurrent]

and you then can also do

\namedstartstopparameter{concurrent}{before}

when needed, which save you the intermediate variable because it's 
already in before, so from that it's a natural step to


\startxmlsetups xml:div
  \setupstartstop
[\xmlatt{#1}{class}]
[title=\xmlatt{#1}{data-title},
 before={TITLE: \namedstartstopparameter{concurrent}{title}}]%
  \start[\xmlatt{#1}{class}]%
\xmlflush{#1}
  \stop
\stopxmlsetups

\definestartstop
  [concurrent]

and then with:

\namedstartstopparameter{concurrent}{title}

(i'll add this example to the test suite as demo)

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Map XML attributes to variables, dynamically

2023-08-10 Thread Hans Hagen

On 8/10/2023 10:14 AM, Thangalin wrote:

Here's an MWE:

% SOT
\startbuffer[demo]



Text Goes Here


Different Text Goes Here



\stopbuffer

\startxmlsetups xml:xhtml
   \xmlsetsetup{\xmldocument}{*}{-}
   \xmlsetsetup{\xmldocument}{html|body}{xml:*}
   \xmlsetsetup{\xmldocument}{div}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

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

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

\startxmlsetups xml:div
   \setvariable{div}{\xmlatt{#1}{class}}{#1}
   \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

\definestartstop[concurrent][
   before={TITLE: \xmlatt{\getvariable {div} {concurrent} {title}}},
]

\starttext
   \xmlprocessbuffer{main}{demo}{}
\stoptext
% EOT

It doesn't look like the variables are taking, regardless of whether
{title} or {data-title} are used.


\startxmlsetups xml:div
  \setvariable{div}{\xmlatt{#1}{class}}{#1}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

\definestartstop
  [concurrent]
  [before={TITLE: \xmlatt{\getvariable{div}{concurrent}}{data-title}}]

-- watch the braces
-- use data-title and not title

Hans

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Map XML attributes to variables, dynamically

2023-08-10 Thread Thangalin
Here's an MWE:

% SOT
\startbuffer[demo]



Text Goes Here


Different Text Goes Here



\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|body}{xml:*}
  \xmlsetsetup{\xmldocument}{div}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

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

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

\startxmlsetups xml:div
  \setvariable{div}{\xmlatt{#1}{class}}{#1}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

\definestartstop[concurrent][
  before={TITLE: \xmlatt{\getvariable {div} {concurrent} {title}}},
]

\starttext
  \xmlprocessbuffer{main}{demo}{}
\stoptext
% EOT

It doesn't look like the variables are taking, regardless of whether
{title} or {data-title} are used.

On Thu, Aug 10, 2023 at 12:44 AM Hans Hagen  wrote:

> On 8/10/2023 9:10 AM, Thangalin wrote:
>
> > Environments for the DIV element gets translated using:
> >
> > \startxmlsetups xml:div
>
> \setvariable {div} {\xmlatt{#1}{class}} {#1}
>
> >\start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
> > \stopxmlsetups
> > \setMPtext{1}{\usermap[concurrent.title]}
> > \setMPtext{2}{\usermap[concurrent.location]}
>
> \setMPtext{1}{%
>\xmlatt {\getvariable {div} {concurrent} {title}%
> }
>
> > I can verify the attribute values exist by exporting them to the
> document:
> something like that .. untested as no mwe
>
> Hans
>
> -
>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 /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Map XML attributes to variables, dynamically

2023-08-10 Thread Hans Hagen

On 8/10/2023 9:10 AM, Thangalin wrote:


Environments for the DIV element gets translated using:

\startxmlsetups xml:div


\setvariable {div} {\xmlatt{#1}{class}} {#1}


   \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups
\setMPtext{1}{\usermap[concurrent.title]}
\setMPtext{2}{\usermap[concurrent.location]}


\setMPtext{1}{%
  \xmlatt {\getvariable {div} {concurrent} {title}%
}


I can verify the attribute values exist by exporting them to the document:

something like that .. untested as no mwe

Hans

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Map XML attributes to variables, dynamically

2023-08-10 Thread Thangalin
Hello!

A Markdown document resembles the following:

::: {.concurrent title="Berth 5" location="San Diego"}
Text Goes Here
:::

::: {.concurrent title="Road" location="Beale AFB"}
Different Text Goes Here
:::

The XHTML generated from that document resembles:


Text Goes Here


Different Text Goes Here


Environments for the DIV element gets translated using:

\startxmlsetups xml:div
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

This creates "\startconcurrent" and "\stopconcurrent", which are later
defined using "\definestartstop[concurrent]".

I'd like to dynamically define all the data- attributes to make key/value
pairs accessible from the document. For example, I have this:

\definestartstop[concurrent][
  before={%
\blank[big]%
\setMPtext{1}{Berth 5}%
\startTextConcurrentFrame},
  after={\stopTextConcurrentFrame\blank[big]},
]

I'd like to replace \setMPText calls with a reference to a dynamically
created variable reference. For example:

\setMPtext{1}{\usermap[concurrent.title]}
\setMPtext{2}{\usermap[concurrent.location]}

I can verify the attribute values exist by exporting them to the document:

\startxmlsetups xml:div
  title:\xmlatt{#1}{data-title} location:\xmlatt{#1}{data-location}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

How would you change the xml:div setup to create a map of its attributes as
key/value pairs?

Thank you!
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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