diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-01-12 08:12:50 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-01-12 08:12:50 +0100 |
commit | d0edf3e90e8922d9c672f24ecdc5d44fe2716f31 (patch) | |
tree | 5b618b87aa5078a8c744c94bbf058d69cd7111b2 /tex/context/modules/mkiv/x-setups-basics.mkiv | |
parent | 409a95f63883bd3b91699d39645e39a8a761457c (diff) | |
download | context-d0edf3e90e8922d9c672f24ecdc5d44fe2716f31.tar.gz |
2018-01-08 23:11:00
Diffstat (limited to 'tex/context/modules/mkiv/x-setups-basics.mkiv')
-rw-r--r-- | tex/context/modules/mkiv/x-setups-basics.mkiv | 143 |
1 files changed, 90 insertions, 53 deletions
diff --git a/tex/context/modules/mkiv/x-setups-basics.mkiv b/tex/context/modules/mkiv/x-setups-basics.mkiv index 0836de76b..be96466b8 100644 --- a/tex/context/modules/mkiv/x-setups-basics.mkiv +++ b/tex/context/modules/mkiv/x-setups-basics.mkiv @@ -15,6 +15,14 @@ %D We can make this module a bit cleaner using more recent features or we go \LUA\ %D completely but as this style evolved over 15 years it's a waste of time. %D +%D +%D Thanks to Wolfgang these descriptions have become quite complete! In the process +%D of covering more commands and expecially different instances of the same command, +%D either or not generated, the supporting macros became more complex. I must admit +%D that it's not the nicest code base and whenever I have to add or patch something +%D I have to suppress the urge to rewrite this file. It needs watching a few +%D energetic videos (for instance with Simon Phillips drumming) to get going. +%D %D As we also have a help server we can make a common framework for this \unknown\ %D but even then, this file is also a test for the the \XML\ processor. %D @@ -25,21 +33,46 @@ %D Currently we load the \XML\ file and when not in the english interface we just %D remap the relevant words to their translation. -%D Todo: use lua instead of synonyms +%D \startbuffer +%D \usemodule[x-setups-basics] +%D +%D \loadsetups[context-en] +%D +%D \starttext +%D +%D \showsetup[starttyping:instance:LUA] +%D +%D \showsetup[starttyping:instance:typing] +%D +%D \showsetup[starttyping:instance:argument] +%D +%D \showsetup [completelistoffloats:instance:chemicals] \blank +%D \shortsetup[completelistoffloats:instance:chemicals] \blank +%D \basicsetup[completelistoffloats:instance:chemicals] \blank +%D +%D \cmdfullsetup [completelistoffloats:instance:chemicals] \blank +%D \cmdshortsetup[completelistoffloats:instance:chemicals] \blank +%D \cmdbasicsetup[completelistoffloats:instance:chemicals] \blank +%D +%D % \cmdinternal{...} +%D +%D \page \placeeverysetup \page +%D \page \placeeverysetupname \page +%D +%D \stoptext +%D \stopbuffer + +% Todo: use lua instead of synonyms \unprotect \defineregister [texmacro] -\unexpanded\def\texcommandmeaning#1{} -\unexpanded\def\texcommandusage #1{} - \definesorting [texcommand] [texcommands] - [\texcommandmeaning] - [\texcommandusage] + [\v!none] \setupsorting [texcommand] @@ -77,7 +110,6 @@ \unexpanded\def\setupalwcolor{} \unexpanded\def\setupoptcolor{darkgray} -% \unexpanded\def\setupvarword#1{{\sl\detokenize{#1}}} \unexpanded\def\setupvarword#1{\detokenize{#1}} \unexpanded\def\setupintword#1{\WORD{\detokenize{#1}}} \unexpanded\def\setuptxtword#1{\detokenize{#1}} @@ -150,16 +182,14 @@ \stopxmlsetups \startxmlsetups xml:setups:register -% \doif {\xmlatt{#1}{variant}} {instance} { - \doifcommon {\xmlatt{#1}{variant}} {instance,instance:assignment,instance:ownnumber} { + \doifcommon {\xmlatt{#1}{variant}} {instance,instance:assignment,instance:ownnumber,instance:argument} { \def\docommand##1{ \xmlsetup{#1}{xml:setups:assemblename:instance} -% \expanded{\texcommand[stp:x:\currentSETUPfullname:##1]{{#1}{##1}}}}% - \expanded{\texcommand[\currentSETUPfullname:##1]{{#1}{##1}}}}% + \expanded{\texcommand[\currentSETUPfullname:##1]{{#1}{##1}}} + }% \processcommacommand[\clf_getinstances{#1}]\docommand } \xmlsetup{#1}{xml:setups:assemblename} -% \expanded{\texcommand[stp:x:\currentSETUPfullname]{{#1}{}}} \expanded{\texcommand[\currentSETUPfullname]{{#1}{}}} \stopxmlsetups @@ -386,7 +416,6 @@ local t = { } local n = #entries for i=1,n do --- t[i] = gsub(entries[i].definition.tag,"^stp:x:","") t[i] = entries[i].definition.tag end table.sort(t) @@ -488,15 +517,12 @@ \fi} \def\cmd_show_setup_nop#1% this will trigger 'used' -% {\registersort[texcommand][stp:x:#1]% {\registersort[texcommand][#1]% \ifconditional\c_cmd_show_setup -% \writestatus{setup}{#1 / \rawsynonymname{texcommand}{stp:x:#1}}% \writestatus{setup}{#1 / \rawsynonymname{texcommand}{#1}}% \fi \startelement[setup][name=#1]% \startelement[noexport][comment={setup definition #1}]% -% \edef\cmd_id{\rawsynonymname{texcommand}{stp:x:#1}}% \edef\cmd_id{\rawsynonymname{texcommand}{#1}}% \ifx\cmd_id\empty missing: #1 @@ -517,6 +543,17 @@ \let\placeeverysetup\placeallsetups +\unexpanded\def\cmd_show_setup_list_basic#1#2#3% + {\NC\tttf#2\NC\basicsetup[#2]\NC\NR} + +\unexpanded\def\placeeverysetupname + {\placelistofsorts + [texcommand] + [\c!before={\starttabulate[|||]}, + \c!after=\stoptabulate, + \c!criterium=\v!all, + \c!command=\cmd_show_setup_list_basic]} + %D Typesetting: \startxmlsetups xml:setups:typeset @@ -758,24 +795,25 @@ \ignorespaces \stopxmlsetups +\startxmlsetups xml:setups:csname \show_setup_component{#1}{csname} \stopxmlsetups \startxmlsetups xml:setups:content \show_setup_component{#1}{content} \stopxmlsetups -\startxmlsetups xml:setups:displaymath \show_setup_component{#1}{displaymath}\stopxmlsetups -\startxmlsetups xml:setups:index \show_setup_component{#1}{index} \stopxmlsetups -\startxmlsetups xml:setups:math \show_setup_component{#1}{math} \stopxmlsetups -\startxmlsetups xml:setups:nothing \show_setup_component{#1}{nothing} \stopxmlsetups -\startxmlsetups xml:setups:file \show_setup_component{#1}{file} \stopxmlsetups \startxmlsetups xml:setups:position \show_setup_component{#1}{position} \stopxmlsetups -\startxmlsetups xml:setups:reference \show_setup_component{#1}{reference} \stopxmlsetups -\startxmlsetups xml:setups:csname \show_setup_component{#1}{csname} \stopxmlsetups -\startxmlsetups xml:setups:destination \show_setup_component{#1}{destination}\stopxmlsetups -\startxmlsetups xml:setups:triplet \show_setup_component{#1}{triplet} \stopxmlsetups -\startxmlsetups xml:setups:word \show_setup_component{#1}{word} \stopxmlsetups +\startxmlsetups xml:setups:index \show_setup_component{#1}{index} \stopxmlsetups +\startxmlsetups xml:setups:text \show_setup_component{#1}{text} \stopxmlsetups +\startxmlsetups xml:setups:apply \show_setup_component{#1}{apply} \stopxmlsetups \startxmlsetups xml:setups:template \show_setup_component{#1}{template} \stopxmlsetups +\startxmlsetups xml:setups:triplet \show_setup_component{#1}{triplet} \stopxmlsetups \startxmlsetups xml:setups:angles \show_setup_component{#1}{angles} \stopxmlsetups -\startxmlsetups xml:setups:apply \show_setup_component{#1}{apply} \stopxmlsetups -\startxmlsetups xml:setups:twowords \show_setup_component{#1}{twowords} \stopxmlsetups -\startxmlsetups xml:setups:threewords \show_setup_component{#1}{threewords} \stopxmlsetups -\startxmlsetups xml:setups:text \show_setup_component{#1}{text} \stopxmlsetups + +%startxmlsetups xml:setups:displaymath \show_setup_component{#1}{displaymath}\stopxmlsetups +%startxmlsetups xml:setups:math \show_setup_component{#1}{math} \stopxmlsetups +%startxmlsetups xml:setups:nothing \show_setup_component{#1}{nothing} \stopxmlsetups +%startxmlsetups xml:setups:file \show_setup_component{#1}{file} \stopxmlsetups +%startxmlsetups xml:setups:reference \show_setup_component{#1}{reference} \stopxmlsetups +%startxmlsetups xml:setups:destination \show_setup_component{#1}{destination}\stopxmlsetups +%startxmlsetups xml:setups:word \show_setup_component{#1}{word} \stopxmlsetups +%startxmlsetups xml:setups:twowords \show_setup_component{#1}{twowords} \stopxmlsetups +%startxmlsetups xml:setups:threewords \show_setup_component{#1}{threewords} \stopxmlsetups % todo: cd:par => \par % todo: cd:sep => \\ @@ -928,12 +966,12 @@ \stopxmlsetups \startxmlsetups xml:setups:inherit -% \cmd_column_two_start{}{} + % \cmd_column_two_start{}{} \rawsetupstring{cd:inherits}: \enspace \letterbackslash \xmlatt{#1}{name} -% \cmd_column_two_stop + % \cmd_column_two_stop \ignorespaces \stopxmlsetups @@ -941,7 +979,7 @@ {\cmd_column_one_start \cmd_internal_value{#1}% \cmd_column_one_stop -% \godown[.75\lineheight] + % \godown[.75\lineheight] \blank[\v!samepage,\v!medium] \ignorespaces} @@ -1013,26 +1051,25 @@ % arguments -\unexpanded\def\show_setup_displaymath#1{\show_setup_any {#1}{displaymath}} -\unexpanded\def\show_setup_index #1{\show_setup_any {#1}{index}} -\unexpanded\def\show_setup_math #1{\show_setup_any {#1}{math}} -\unexpanded\def\show_setup_nothing #1{\show_setup_any {#1}{nothing}} -\unexpanded\def\show_setup_file #1{\show_setup_any {#1}{file}} -\unexpanded\def\show_setup_position #1{\show_setup_any {#1}{position}} -\unexpanded\def\show_setup_template #1{\show_setup_any {#1}{template}} -\unexpanded\def\show_setup_angles #1{\show_setup_any {#1}{angle}} -\unexpanded\def\show_setup_reference #1{\show_setup_any {#1}{reference}} -\unexpanded\def\show_setup_apply #1{\show_setup_any {#1}{apply}} -\unexpanded\def\show_setup_twowords #1{\show_setup_any {#1}{twowords}} -\unexpanded\def\show_setup_threewords #1{\show_setup_any {#1}{threewords}} -\unexpanded\def\show_setup_csname #1{\show_setup_any {#1}{noargument}} -\unexpanded\def\show_setup_destination#1{\show_setup_any {#1}{destination}} -\unexpanded\def\show_setup_triplet #1{\show_setup_any {#1}{triplet}} -\unexpanded\def\show_setup_word #1{\show_setup_any {#1}{word}} -\unexpanded\def\show_setup_content #1{\show_setup_any {#1}{content}} -\unexpanded\def\show_setup_text #1{\show_setup_any {#1}{textual}} -\unexpanded\def\show_setup_to #1{\show_setup_line{#1}{to}} -\unexpanded\def\show_setup_macro #1{\show_setup_any {#1}{macro}} +\unexpanded\def\show_setup_csname #1{\show_setup_any{#1}{noargument}} +\unexpanded\def\show_setup_content #1{\show_setup_any{#1}{content}} +\unexpanded\def\show_setup_position #1{\show_setup_any{#1}{position}} +\unexpanded\def\show_setup_index #1{\show_setup_any{#1}{index}} +\unexpanded\def\show_setup_text #1{\show_setup_any{#1}{textual}} +\unexpanded\def\show_setup_apply #1{\show_setup_any{#1}{apply}} +\unexpanded\def\show_setup_template #1{\show_setup_any{#1}{template}} +\unexpanded\def\show_setup_triplet #1{\show_setup_any{#1}{triplet}} +\unexpanded\def\show_setup_angles #1{\show_setup_any{#1}{angle}} + +%unexpanded\def\show_setup_displaymath#1{\show_setup_any{#1}{displaymath}} +%unexpanded\def\show_setup_math #1{\show_setup_any{#1}{math}} +%unexpanded\def\show_setup_nothing #1{\show_setup_any{#1}{nothing}} +%unexpanded\def\show_setup_file #1{\show_setup_any{#1}{file}} +%unexpanded\def\show_setup_reference #1{\show_setup_any{#1}{reference}} +%unexpanded\def\show_setup_destination#1{\show_setup_any{#1}{destination}} +%unexpanded\def\show_setup_word #1{\show_setup_any{#1}{word}} +%unexpanded\def\show_setup_twowords #1{\show_setup_any{#1}{twowords}} +%unexpanded\def\show_setup_threewords #1{\show_setup_any{#1}{threewords}} % A prelude to a rewrite and some more: |