texlive[55718] Master/texmf-dist: context-filter (1jul20)

commits+karl at tug.org commits+karl at tug.org
Wed Jul 1 22:49:27 CEST 2020


Revision: 55718
          http://tug.org/svn/texlive?view=revision&revision=55718
Author:   karl
Date:     2020-07-01 22:49:27 +0200 (Wed, 01 Jul 2020)
Log Message:
-----------
context-filter (1jul20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/context/third/filter/VERSION
    trunk/Master/texmf-dist/doc/context/third/filter/filter.txt
    trunk/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv

Modified: trunk/Master/texmf-dist/doc/context/third/filter/VERSION
===================================================================
--- trunk/Master/texmf-dist/doc/context/third/filter/VERSION	2020-07-01 20:48:59 UTC (rev 55717)
+++ trunk/Master/texmf-dist/doc/context/third/filter/VERSION	2020-07-01 20:49:27 UTC (rev 55718)
@@ -1 +1 @@
-2020.04.25
+2020.06.29

Modified: trunk/Master/texmf-dist/doc/context/third/filter/filter.txt
===================================================================
--- trunk/Master/texmf-dist/doc/context/third/filter/filter.txt	2020-07-01 20:48:59 UTC (rev 55717)
+++ trunk/Master/texmf-dist/doc/context/third/filter/filter.txt	2020-07-01 20:49:27 UTC (rev 55718)
@@ -4,9 +4,6 @@
 The filter module
 =================
 
-History
--------
-
 This module started with a simple idea. I wanted an environment
     
     \startmarkdown
@@ -31,6 +28,38 @@
 in the R-module; what I needed was a R-module _template_ so that I could fill in
 the blanks with the appropriate values. And so, the filter module was born.
 
+Table of Contents
+=================
+
+* [Compatibility](#compatibility)
+* [Installation](#installation)
+* [Basic Usage](#basic-usage)
+* [Inheriting setup from other commands](#inheriting-setup-from-other-commands)
+* [Dealing with slow filters](#dealing-with-slow-filters)
+* [Reading the input](#reading-the-input)
+* [Space around the environment](#space-around-the-environment)
+* [Stripping leading whitespace (MkIV only)](#stripping-leading-whitespace-mkiv-only)
+* [Names of temporary files](#names-of-temporary-files)
+* [Output Directory](#output-directory)
+* [Disabling filters](#disabling-filters)
+* [Deleting temporary files](#deleting-temporary-files)
+* [Standard options](#standard-options)
+* [Options to a specific environment](#options-to-a-specific-environment)
+* [A setup to control them all](#a-setup-to-control-them-all)
+* [Passing options to filters](#passing-options-to-filters)
+* [Macro variant](#macro-variant)
+* [Processing existing Files](#processing-existing-files)
+* [Processing remote files](#processing-remote-files)
+* [Processing existing buffers](#processing-existing-buffers)
+* [Prepend and append text](#prepend-and-append-text)
+* [XML export](#xml-export)
+* [Special use case:  \write18 with caching](#special-use-case--write18-with-caching)
+* [Dealing with expansion](#dealing-with-expansion)
+* [Limitations](#limitations)
+* [Messages and Tracing](#messages-and-tracing)
+* [Version History](#version-history)
+
+
 Compatibility
 ------------
 
@@ -47,7 +76,7 @@
 Depending on your TeX distribution, you may already have the module.
 To verify, check if
 
-    kpsewhich t-filter.mkii
+    luatools t-filter.mkiv
 
 returns a meaningful path. If not, you have to manually install the module.
 
@@ -55,22 +84,22 @@
 [http://modules.contextgarden.net/filter](http://modules.contextgarden.net/filter)
 and unzip it either `$TEXMFHOME` or `$TEXMFLOCAL`. Run
 
-    mktexlsr
+    mtxrun --generate
 
 and
 
-    mtxrun --generate
+    mktexlsr
 
-to refresh the TeX file database (for MkII and MkIV, respectively). If
+to refresh the TeX file database (for MkIV and MkII, respectively). If
 everything went well
 
-    kpsewhich t-filter.mkii
+    luatools t-filter.mkiv
 
 will return the path where you stored the file.
 
 Unfortunately, that is not enough. For the module to work, TeX must be able to
 call an external program. This feature is a potential security risk and is
-disabled by default on most TeX distributions. To enable this feature, set
+disabled by default on most TeX distributions. To enable this feature in MkII, set
 
     shell_escape=t
 
@@ -726,6 +755,43 @@
 
 to get a chess board.
 
+XML export
+----------
+
+The filter module provides a basic support for XML export. If the
+user-document contains
+
+    \setupbackend[export=yes]
+
+or other valid options to `export` such as `export=xml`, then the filter
+environment is exported as well. For example, both
+
+    \startmarkdown
+      ...
+    \stopmarkdown
+
+and
+    \processmarkdownfile{...}
+
+are exported (in `\jobname-export/\jobname.xml`) as
+
+    <externalfilter detail="markdown">
+      ...
+    </externalfilter>
+
+Moreover, 
+
+    \inlinemarkdown{...}
+
+is exported as 
+
+    <inlineexternalfilter detail="markdown">....</inlineexternalfilter>
+
+
+Note that it is the responsibility of the filter to generate properly tagged
+content. For example, `pandoc` used in the `markdown` examples in this
+document converts `**bold**` to `{\bf bold}`, which is not exported. 
+
 Special use case:  `\write18` with caching
 ------------------------------------------
 

Modified: trunk/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv	2020-07-01 20:48:59 UTC (rev 55717)
+++ trunk/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv	2020-07-01 20:49:27 UTC (rev 55718)
@@ -1,6 +1,6 @@
 %D \module
 %D   [     file=t-filter,
-%D      version=2020.04.25,
+%D      version=2020.06.29,
 %D        title=\CONTEXT\ User Module,
 %D     subtitle=Filter,
 %D       author=Aditya Mahajan,
@@ -9,7 +9,7 @@
 %D        email=adityam <at> ieee <dot> org,
 %D      license=Simplified BSD License]
 
-\writestatus{loading}{Filter (ver: 2020.04.25)}
+\writestatus{loading}{Filter (ver: 2020.06.29)}
 
 \startmodule [filter]
 \usemodule   [module-catcodes]
@@ -35,6 +35,7 @@
     \setinterfaceconstant {write}            {write}
     \setinterfaceconstant {readcommand}      {readcommand}
     \setinterfaceconstant {taglabel}         {taglabel}
+    \setinterfaceconstant {tagdetail}        {tagdetail}
 \stopinterface
 
 
@@ -66,6 +67,10 @@
     \setuevalue{process\currentexternalfilter file}{\externalfilter at process_file[\currentexternalfilter]}%
     \setuevalue{process\currentexternalfilter buffer}{\externalfilter at process_buffer[\currentexternalfilter]}%
     \setuevalue{inline\currentexternalfilter}{\externalfilter at inline[\currentexternalfilter]}%
+    \setelementbackendtag[\externalfilterparameter\c!taglabel]
+    \setelementnature    [\externalfilterparameter\c!taglabel][display]
+    \setelementbackendtag[inline\externalfilterparameter\c!taglabel]
+    \setelementnature    [inline\externalfilterparameter\c!taglabel][inline]
 \to \everydefineexternalfilter
 
 % For backward compatibility
@@ -479,16 +484,17 @@
    \doifelse{\externalfilterparameter\c!location}\v!paragraph
      {\blank[\externalfilterparameter\c!spacebefore]
       \usealignparameter\externalfilterparameter
-      \externalfilterparameter\c!before}
-     {\externalfilterparameter\c!left}
+      \externalfilterparameter\c!before
+      \dostarttagged{\externalfilterparameter\c!taglabel}{\externalfilterparameter\c!tagdetail}}
+     {\externalfilterparameter\c!left
+      \dostarttagged{inline\externalfilterparameter\c!taglabel}{\externalfilterparameter\c!tagdetail}}
 
    \begingroup
-   \dostarttagged{\externalfilterparameter\c!taglabel}\currentexternalfilter
    \useexternalfilterstyleandcolor\c!style\c!color
    \processcommacommand[\externalfilterparameter\c!setups]\directsetup
    \externalfilterparameter\c!readcommand\externalfilter at output_file
+   \endgroup
    \dostoptagged
-   \endgroup
 
    \doifelse{\externalfilterparameter\c!location}\v!paragraph
      {\externalfilterparameter\c!after
@@ -526,6 +532,7 @@
    \c!buffer\c!before=,
    \c!buffer\c!after=,
    \c!taglabel=\externalfilter at id,
+   \c!tagdetail=\currentexternalfilter,
  ]
 
 \def\externalfilterbasefile  {\externalfilter at base_file}



More information about the tex-live-commits mailing list.