Changes

Jump to navigation Jump to search
15,107 bytes added ,  11:39, 20 December 2023
Checkouts work now; hint about dev ML.
< [[The ConTeXt Way]]Modules are extensions to ConTeXt’s core functions.
Modules There are extensions to not as many modules for ConTeXt's as packages for LaTeX, because ConTeXt’s core functionsalready contains a lot that needs a package in LaTeX.
There are not as many modules for ConTeXt as packages for LaTeX, because a lot of LaTeX package features are in ConTeXt's core.=Installation=
==Installation== ===Basics===
The installation of extra files in TeX (called modules in ConTeXt) can be difficult
* texmf-project
but their existence depends on the TeX distribution; among these, texmf-local is the most common. ==Installation by hand== When you want to install a new single-file module, createthe subdirectories in the way described above and place the file there.
===Installation by hand===Most modules consist of several files though and are distributed as ZIP archives that contain the necessary TDS tree.These you can unzip in the top-level directory (e.g. texmf-local/), and all files should be in the correct place.
When you want to install a new module which is available as file only createAfter the subdirectories in the way described above and place the file therefiles are installed, formodules which are available as zip files with precreated subdorectories youmust update ConTeXt’s database to let it know where it can unzip the archive in find the top-level directory (e.g. texmf-local/) and allfiles are on the correct place.:
After the files are placed at the right place you have to update TeX's databaseto let it know where it can find the files, this is done for MkII with context --generate
mktexlsr (command name depends on the TeX distributionConTeXt doesn’t use `ls-R` files or `kpsewhich` any more.)
==Installation by script (LMTX)== Since 2023-05, there’s a script for `mtxrun` to list and install modules, usually from https://modules.contextgarden.net. Some modules, get special treatment: For the [[TikZ]] modules files are downloaded from CTAN and patches for MkIV withincompatibilities are applied. First, `cd` into the `tex` directory of your ConTeXt LMTX installation (above the texmf-* trees), the modules installer works only there.   mtxrun --script install-modules --list For the installation to work, you must change into the `tex` directory that contains the `texmf-*` trees.  mtxrun --script install-modules --install filter simpleslides If you list single modules to install, leave out the prefix (t-* or whatever)! But since there aren’t many, you can just install all modules:  mtxrun --script install-modules --install --all Previously, the ConTeXt LMTX distribution did not provide a built-in way to install or update modules. Here’s a method using `rsync`, to be run from the toplevel directory of the ConTeXt LMTX distribution, i.e. the directory that contains <tt>install.sh</tt>. Because the final <tt>tex/texmf-modules</tt> must contain the union of all individual module directories, the commands create and leave an intermediate <tt>modules</tt> directory that wastes less than 50 MB.  # Synchronize all modules from ConTeXt Garden in the 'modules' directory, which is created if it doesn’t exist. rsync --recursive --links --times --info=progress2,remove,symsafe,flist,del --human-readable --del rsync://contextgarden.net/minimals/current/modules/ modules # Create the union of all modules in tex/texmf-modules (the directory is created if it doesn’t exist). # If you have personal modules in tex/texmf-modules, they won’t be modified. mkdir -p tex rsync -rlt --exclude=/VERSION --del modules/*/ tex/texmf-modules # You may delete the 'modules' directory to reclaim some space or keep it to speed up the next update. # rm -rf modules # Update the ConTeXt file database. mtxrun --generate
context --generate
===ConTeXt standalone=Installation by script (MkIV) ==
Users of the ConTeXt MkIV standalone (formerly "minimals") distribution don't have to download the module files and unzipthem in the local directory, because they can use the <tt>first-setup</tt> script for this.to install modules:
To E.g. to install for example the simpleslides modules you write:
first-setup.sh --modules="t-simpleslides"
To install more modules at the same time write:
first-setup.sh --modules="t-simpleslides,t-french"
The complete list of availables modules in standalone is: * t-urwgaramond* t-account* t-algorithmic* t-animation* t-annotation* t-bnf* t-chromato* t-cmscbf* t-cmttbf* t-construction-plan* t-degrade* t-fancybreak* t-fixme* t-french* t-fullpage* t-games* t-gantt* t-gnuplot* t-layout* t-letter* t-lettrine* t-lilypond* t-mathsets* t-pgfplots* t-ruby* t-simplefonts* t-simpleslides* t-typearea* t-typescripts* t-urwgaramond* t-urwgothic* t-vim ===TeX Live===
{{Note | description required}}TeX Live is a large TeX distribution for most common operating systems. It provides binaries and many other files necessary to run TeX and its flavors. Many ConTeXt modules are included.
<!--
The following modules are available:
* context-french
* context-games
* context-gantt
* context-gnuplot
* context-letter
* context-typearea
* context-vim
-->
==Usage==
When you load a module with <code>\usemodule[modulename]</code> ConTeXt looks for a file with the following names:
* m-modulaname modulename (core module)
* p-modulename (private module)
* s-modulename (ConTeXt style file)
* x-modulename (XML module)
* t-modulename (Third "third party " contributed module)
* modulename
Once a file is found , ConTeXt stops the search and loads the found file (only once).
When you have two file files with the same name but different prefixes , you can tell ConTeXt which file it should load with
<code>\usemodule[<prefix>][modulename]</code>
=Included Modules=as of 2023-09-30 ==Included Macro modules:== * [[source:t{{code|x-bib.texasciimath}} ({{src|tx-bib]]asciimath.mkxl}} etc.): Support for [[Bibliography]http://asciimath.org/ ASCII math] input (maintained used by Taco[https://www.math4all.nl/ math4all])* [[source{{code|m-asymptote}} ({{src|m-asymptote.mkiv}}):Inclusion of Asymptote code* {{code|m-barcodes}} ({{src|m-arabtexbarcodes.texmkiv}} {{src|m-arabtex]]barcodes.mkxl}}): loading of Lagally's generate [[Arabian and HebrewBarcodes|ArabTeXbarcodes]]using PStricks (MkIV), redirects to `m-zint` in LMTX.* [[source{{code|x-calcmath}} ({{src|x-calcmath.mkxl}} {{src|x-calcmath.lmt}} etc.): calculator math syntax* {{code|x-cals}} ({{src|x-cals.mkiv}} {{src|x-cals.lua}}): XML cals table renderer* {{code|m-catchword}} ({{src|m-catchword.mkiv}}):show the first word of the next page in the footer (like in medieval manuscripts; Custode, Reklamante, Blatthüter)* {{code|m-chart}} ({{src|m-chart.texlua}} {{src|m-chart]].mkvi}}): [[Flow Charts]]* [[source:{{code|m-chemic.tex}} ({{src|m-chemic]].mkiv}}): dummy module, since [[Chemistry|PPCHTeX]] (chemical structure formulae)is now built in* {{code|x-chemml}} ({{src|x-.mkiv}} {{src|x-.lua}}): [[sourceChemML]] syntax support* {{code|m-circuitikz}} ({{src|m-circuitikz.mkiv}} {{src|m-circuitikz.mkxl}}): drawing circuits with [[TikZ]]* {{code|m-compatible}} ({{src|m-compatible.mkiv}}): compatibility for older versions (unattended since 2018)* {{code|m-crappyspec}} ({{src|m-crappyspec.mkxl}}): limit text to a certain number of characters per line* {{code|x-ct}} ({{src|x-ct.mkiv}} {{src|x-ct.lua}}):tabulate and combination structures in XML* {{code|m-cweb.tex}} ({{src|m-cweb]].mkiv}}): [[CWEB]] pretty printing* [[source:{{code|m-database}} ({{src|m-database.texlua}} {{src|m-database]].mkiv}}): creating simple tables (or forwarding data to user-defined commands) using [[m-database|comma/space/tab-separated values]]* . Wiki: [[source:mM-dratex|m-dratexdatabase]]: loading of DraTeX.* [[source:{{code|m-edtsnc.texdirectives}} ({{src|m-edtsnc]]directives.mkiv}}): support for editor synchronization, will replace m-pdfsyncjust calls {{cmd|showdirectives}}* [[source:{{code|m-educat.tex}} ({{src|m-educat]].mkiv}}): educational additions (for settings school tests or questionaires)* [[source{{code|x-entities}} ({{src|x-entities.mkiv}}): load character entities for HTML interpretation* {{code|m-escrito}} ({{src|m-escrito.mkiv}} {{src|m-escrito.lua}}): limited PostScript interpreter* {{code|m-examn}} ({{src|m-examn.mkiv}}):testing and examination in JavaScript (outdated)* {{code|m-fields}} ({{src|m-gammafields.texmkiv}}): fill-in form field with JS check* {{code|m-format}} ({{src|m-gamma]]format.mkiv}}): [[Alephfor formatting poetry (very old code)* {{code|x-foxet}} ({{src|Omega]] x-foxet.mkiv}}): supportfor formatting objects, not usable* [[source{{code|m-gimmicks}} ({{src|m-gimmicks.mkxl}}): “whatever comes up” (?)* {{code|m-gnuplot}} ({{src|m-gnuplot.mkxl}}):limited support for GNUplot via SVG* {{code|m-graph.tex}} ({{src|m-graph]].mkiv}} {{src|mp-grap.mpiv}}): support for [[MetaPost]] graph module* {{code|m-hemistich}} ({{src|m-hemistich.mkiv}}): hemistiches (half-line poetry)* {{code|x-html}} ({{src|x-html.mkiv}}): [[sourceHTML|HTML_to_ConTeXt]] setup* {{code|m-ipsum}} ({{src|m-ipsum.mkiv}}): lorem ipsum filler text with options* {{code|m-json}} ({{src|m-json.mkiv}} {{src|m-json.mkxl}} {{src|util-jsn.lua}}):activates Lua functions to interprete JSON* {{code|m-layout.tex}} ({{src|m-layout]].mkiv}}): defines some [[Layout]] presets* [[{{code|x-ldx}} ({{src|x-ldx.mkiv}} {{src|x-ldx.ctx}} {{src|x-ldx.lua}}): Lua sourcecode formatter* {{code|x-lmx-html}} ({{src|x-lmx-html.mkiv}} {{src|x-lmx-demo.mkiv}}): interpretation of filled-in HTML forms* {{code|m-logcategories}} ({{src|m-logcategories.mkiv}}):just calls {{cmd|showlogcategories}}* {{code|m-mathcrap}} ({{src|m-levelmathcrap.texmkiv}}): use Unicode super-/subscripts in math (not recommended)* {{code|m-mathfun}} ({{src|m-levelmathfun.mkxl}}): “weird stuff” (?)* {{code|x-mathml}} ({{src|x-mathml.mkxl}} {{src|x-mathml.lmt}} {{src|x-mathml.mkiv}} {{src|x-mathml.lua}} {{src|x-mathml-basics.mkiv}}): [[MathML]] syntax support* {{code|x-mathml-html}} ({{src|x-mathml-html.mkiv}}): [[MathML]] syntax, support for some HTML tags* {{code|x-math-svg}} ({{src|x-math-svg.mkiv}} {{src|x-math-svg.lua}}): convert [[MathML]] to [[SVG]]* {{code|m-oldmath}} ({{src|m-oldmath.mkxl}}): module support for catching nesting errorssome obsolete math commands like `\over`* {{code|m-matrix}} ({{src|m-matrix.mkiv}}): calculation and typsetting of [[sourceMatrix_in_maths|matrices]]* {{code|m-maybe}} ({{src|m-maybe.mkiv}}): experimental code* {{code|m-media}} ({{src|m-media.mkiv}}): support for SWF and U3D (deactivated)* {{code|m-mkii}} ({{src|m-mkii.mkiv}}): re-activate some MkII font switches (no general MkII compatibility)* {{code|m-mkivhacks}} ({{src|m-mkivhacks.mkiv}}):temporary hacks* {{code|m-morse}} ({{src|m-morse.mkvi}}): convert text to Morse code and back* {{code|m-narrowtt.tex}} ({{src|m-narrowtt]].mkiv}}): using a narrower [[Latin Modern]] font for verbatim* [[source:{{code|m-nodechart}} ({{src|m-newmatnodechart.texmkvi}} {{src|m-newmatnodechart.lua}}): extension for `m-chart` ([[Flow Charts]])* {{code|m-ntb-to-xtb}} ({{src|m-ntb-to-xtb.mkiv}}): support for some AMSmath features, is loaded by map [[Math with amsl|amslTABLE]], see to [[Math with newmatxtables]]* [[source{{code|m-obsolete}} ({{src|m-obsolete.mkiv}}):print obsolete module warning* {{code|m-pdfsncold-columnsets}} ({{src|m-old-columnsets.texmkiv}} {{src|mpage-pdfsncset.mkiv}}): activates old [[Columns|columsets]]: editor/PDF synchronization support (used by iTeXMac and TeXShop)code* [[source:{{code|m-old-multicolumns}} ({{src|m-pictexold-multicolumns.texmkiv}} {{src|mpage-pictex]]mul.mkiv}}): needed for activates old [[PicTeXColumns|multicolumn]] without eTeXcode* [[source:{{code|m-plus.texoldfun}} ({{src|m-plus]]oldfun.mkiv}}): loads some extra features old implementation of initials (drop caps) etc. (currently emptycurrent: {{cmd|setupinitial}})* [[source{{code|m-oldnum}} ({{src|m-oldnum.mkiv}}):old implementation of {{cmd|digit}}* {{code|m-pstricopenstreetmap}} ({{src|m-openstreetmap.texmkxl}} {{src|m-pstric]]openstreetmap.lmt}}): limited OSM XML renderer (no labels)* {{code|x-pandoc}} ({{src|x-pandoc.mkiv}}): connection macros for Pandoc [[PSTricksDocBook]] rendering (PostScript tricksmisleading name)* [[source:m{{code|x-pfs-r.tex01}} ({{src|mx-pfs-r]]01.mkiv}}): typing and executing [httphttps://www.r-projectpfsense.org/ Rpfsense] status rendering* {{code|x-physml}} ({{src|x-physml.mkiv}}): [[PhysML]] scriptssyntax support* {{code|m-pictex}} ({{src|m-pictex.mkiv}}): [[sourcePicTeX]] support for MkIV; not supported in LMTX any more* {{code|m-pipemode}} ({{src|m-pipemode.mkiv}}): disables directive `system.errorcontext` ({{cmd|disabledirective}})* {{code|m-polynomial}} ({{src|m-polynomial.mkxl}}):typesetting of polynomials* {{code|m-questpstricks}} ({{src|m-pstricks.texlua}} {{src|m-quest]]pstricks.mkiv}}): module PStricks support for fillMkIV; not supported in LMTX any more* {{code|m-in forms punk}} (dutch only{{src|m-punk.mkiv}}): support for the Punk metapost font* {{code|m-scite}} ({{src|m-scite.mkiv}}): syntax highlighting with [[sourceScite|SciTE]] lexers* {{code|x-setups}} ({{src|x-setups.mkiv}} etc.): load and typeset command syntax from interface files* {{code|m-simulate}} ({{src|m-simulate.mkiv}}): fake words, similar to `m-visual`’s {{cmd|fakewords}}* {{code|m-spreadsheet}} ({{src|m-spreadsheet.lua}} {{src|m-spreadsheet.mkiv}}): calculations in tables* {{code|m-sql}} ({{src|m-sql.mkiv}} {{src|util-sql.lua}}):access to SQL databases* {{code|m-steps}} ({{src|m-steps.texlua}} {{src|m-steps]].mkvi}} {{src|x-steps.mkiv}}): Step Charts, see [[XML]] step charts* [[source:{{code|m-subsub}} ({{src|m-streamssubsub.tex}}): Defines subsections up to level 12; obsolete, part of the core* {{code|m-svg}} ({{src|m-streamssvg.mkxl}}): auxiliary functions for [[SVG]]rendering via MetaPost* {{code|m-system-aliasing}} ({{src|m-system-aliasing.mkiv}}): Synchronised typesetting support for file aliases incl. globbing (?)* {{code|m-system-readers}} ({{src|m-system-readers.mkxl}}): reading from different sourcesfiles* [[source{{code|m-three}} ({{src|m-three.mkiv}} {{src|mp-tres.mpiv}}):support for pseudo-3D projections with Metapost module `tres`* {{code|m-subsubtikz}} ({{src|m-tikz.texmkiv}} {{src|m-subsubtikz.mkxl}}): [[TikZ]]: Defines 5 extra sectioning levelssupport* {{code|m-tikz-pgfplots}} ({{src|m-tikz-pgfplots.tex}}): [[source:TikZ]] support* {{code|m-tex4ht.textikz-pgfplotstable}} ({{src|m-tex4ht]]tikz-pgfplotstable.tex}}): convert a ConTeXt document to html, more about it on [[tex4htTikZ]]support* {{code|m-timing}} ({{src|m-timing.mkiv}} {{src|m-timing.mkxl}}): where does TeX spend its processing time?* [[source{{code|m-trackers}} ({{src|m-trackers.mkiv}}):just calls {{cmd|showtrackers}}* {{code|m-tryouttranslate}} ({{src|m-translate.texmkiv}}): text replacements* {{code|m-typesetting}} ({{src|m-tryout]]typesetting.mkiv}}): Contains temporary functions sample pages for testingdocumentation (?)* {{code|x-udhr}} ({{src|x-udhr.mkiv}}): typeset the declaration of human rights in several languages as Unicode test files ([[sourcehttp://unicode.org/udhr/ UDHR])* {{code|m-units.tex}} ({{src|m-units]].mkiv}}): Structured input of values with [[units]]; obsolete, part of the core* [[source:{{code|m-visual.tex}} ({{src|m-visual]].mkiv}}): [[Visual Debugging]] (described in [[This WayThis_Way_-_My_Way#ThisWay|ThisWay]] no.7 [[magazine:0007|Faking Text and More]])* {{code|x-xfdf}} ({{src|x-xfdf.mkiv}}): support for XFDF (XML Forms Data Format, PDF form exports) files* {{code|m-zint}} ({{src|m-zint.mkiv}}): Generate [[Barcodes|barcodes]] using [http://www.zint.org.uk zint] <!--* {{code|m-}} ({{src|m-.mkxl}}):* {{code|x-}} ({{src|x-.mkiv}} {{src|x-.lua}}): these are outdated or part of the core:* {{code|bibl-bib.lua}} ({{src|bibl-bib.mkiv}}): [[Bibliography]] (maintained by Taco)* {{code|m-arabtex}} ({{src|m-arabtex.mkii}}): loading of Lagally's [[Arabian and Hebrew|ArabTeX]]* {{code|m-datastrc}} ({{src|m-datastrc.tex}}):* {{code|m-dratex}} ({{src|m-dratex.mkii}}): loading of DraTeX* {{code|m-edtsnc}} ({{src|m-edtsnc.mkii}}): support for editor synchronization, will replace m-pdfsync* {{code|m-level}} ({{src|m-level.mkii}}): module for catching nesting errors* <strike>{{code|m-markdown}} ({{src|m-markdown.lua}} {{src|m-markdown.mkiv}}):</strike>* {{code|m-newmat}} ({{src|m-newmat.tex}}): support for some AMSmath features, is loaded by [[Math with amsl|amsl]], see [[Math with newmat]]* {{code|m-pdfsnc}} ({{src|m-pdfsnc.mkii}}): editor/PDF synchronization support (used by iTeXMac and TeXShop)* <strike>[[source:m-quest.tex|m-quest]]: module for fill-in forms* (dutch only)</strike>* {{code|m-r}} ({{src|m-r.tex}}): typing and executing [http://www.r-project.org/ R] scripts* {{code|m-streams}} ({{src|m-streams.tex}}): Synchronised typesetting from different sources* {{code|m-tex4ht}} ({{src|m-tex4ht.mkii}}): convert a ConTeXt document to html, more about it on [[tex4ht]]--> ==Style modules== in `texmf-context/tex/context/modules/common`:* {{code|s-cdr-00.tex}}: CD-ROM cover style* {{code|s-faq-00.tex}} to `-03`: FAQ styles* {{code|s-pre-00.tex}} to `-96`: Several old presentation styles (replaced by the following) in `texmf-context/tex/context/modules/mkiv`:* {{code|s-present-*.tex}}: Several presentation styles (examples in `texmf-context/doc/context/presentations/examples`) … many more …
==Contributed modules:=Modules=For a list of contributed modules see [http://tlcontrib.metatex.org/ tlcontrib] and/or [http://modules.contextgarden.net the modules section] on contextgarden.net.:
* [http://modules.contextgarden.net/account t-account] draw T-accounts* [http://modules.contextgarden.net/algorithmic t-algorithmic] like LaTeX algorithmic* [http://modules.contextgarden.net/animation t-animation] create animations* [http://modules.contextgarden.net/annotation t-annotation] todo lists* [http://modules.contextgarden.net/t-bnf t-bnf] BNF grammar* [http://modules.contextgarden.net/chromato t-chromato] chromatograms* [http://modules.contextgarden.net/cmscbf t-cmscbf] bold small caps* [http://modules.contextgarden.net/cmttbf t-cmttbf] bold typewriter* [http://modules.contextgarden.net/t-construction-plan t-construction-plan] figures with defined scale* [http://modules.contextgarden.net/t-degrade t-degrade] degrading JPEG images* [http://modules.contextgarden.net/fancybreak t-fancybreak] thought breaks* [http://modules.contextgarden.net/filter t-filter] run external programs on inline code* [http://modules.contextgarden.net/fixme t-fixme] like LaTeX fixme* [http://modules.contextgarden.net/t-french t-french]* [http://modules.contextgarden.net/fullpage t-fullpage]* [http://modules.contextgarden.net/games t-games] board games* [http://modules.contextgarden.net/gantt t-gantt] Gantt charts* [http://modules.contextgarden.net/gnuplot t-gnuplot] include GNUplot graphics* [http://modules.contextgarden.net/t-layout t-layout]* [http://modules.contextgarden.net/letter t-letter] formal letters AKA correspondence* [http://modules.contextgarden.net/t-lettrine t-lettrine] decorative paragraph starts (initials)* [http://ctan.org/pkg/markdown t-markdown] render markdown documents* [http://modules.contextgarden.net/mathsets t-mathsets] mathematical sets, probabilities etc.* [http://modules.contextgarden.net/pararef t-pararef] {{todocmd|startParagraph|list link=no}}, for paragraphs as ‘thought blocks’ that may contain more than one 'TeX paragraph'. These paragraphs are numbered and can be referenced. See [[Paragraph Referencing]].* [http://modules.contextgarden.net/ruby t-ruby] Ruby markup (for Chinese, not programming language)* [http://modules.contextgarden.net/simpleslides t-simpleslides] presentations* [http://modules.contextgarden.net/typearea t-typearea] like LaTeX/KoMa typearea (MkII)* [http://modules or none of them}}.contextgarden.net/vim t-vim] syntax highlighting using vim’s syntax files
<!--
* [[Extended description|xdesc]] (extended description, e.g. for epigrams)
* [[Math with nath|nath]] (natural math, see [[Math]])
* [[Math with amsl|amsl]] (AMSmath, see [[Math]])
* [[Gnuplot]]: support for direct inclusion of Gnuplot graphs out of the source (the module has been removed from the main distribution and will be included into third party modules again when ready)
* [[Gantt chartsModules/Karnaugh|Karnaugh]] (drawing Gantt charts): draws Karnaugh maps File names of included modules start with "m-", but third party (contributed) modules should start with "t-".>
In order to install a contributed module, copy its directory into <code>$TEXMF/tex/context/third</code> then run <code>luatools --generate</code>.
==Special Purpose Modules==
The following modules implement special formatting requirement for journals or magazines. These modules are distributed with ConTeXt, so you need not download anything.
* [[Modules/This Way - My Way#MyWay|MyWayMy Way]] , User documentation on ConTeXt* `cgj` Articles for ConTeXt Journal (proceedings of ConTeXt meetings)
* [[Modules/Pracjourn|pracjourn]] Articles for [http://tug.org/pracjourn/ The PracTeX Journal]
* [[Modules/Maps|maps]] Articles for [http://www.ntg.nl/maps.html MAPS], the publication of NTG (Nederlandstalige TeX Gebruikersgroep or Netherlands TeX Group)
==Modules Module writing guidelines==
'''Please don’t publish font support modules any more!''' They’re usually unnecessary. Instead publish [[Typescripts_examples|typescripts]] in the wiki instead. ==Module requirements== While a module usually consists of one main file with a name like <tt>t-modulename.[tex|ctx|mkiv|mkxl]</tt>, there can be many more files, and there should be some documentation. Please adhere to the filename conventions outlined in [#Usage]. Sort these files into folders according to TDS (TeX directory structure) – just have a look at the distribution to understand what goes where. * Module code and data files go into tex/context/third/modulename* Documentation files go into doc/context/third/modulename* You can also look at properly setup git repositories like that of [https://codeberg.org/fiee/context-simpleslides the simpleslides module]. === Module release file === * A release file is a ZIP archive that contains the necessary files in a TDS compliant structure.* The filename should be <code>t-modulename-version.zip</code>, where the version is usually a date like <tt>YYYY.MM.DD</tt> (but that’s up to you).* On the top level there must be a VERSION file that only contains your version string.* On the top level there should be a README(|.md|.txt) file with some metadata like a short description and author info.* On the top level there can be a LICENSE file containing the text of an open source license of your choice, if the license is not included in the README.* On the top level there must NOT be a folder with the module name, but only TDS folders like "doc" and "tex". The same applies for git/SVN repositories containing ConTeXt modules. VERSION and README files are important for publication on [https://ctan.org CTAN]. README is also displayed on git platforms like GitHub or Codeberg and should contain basic documentation. All top level files are ignored by the LMTX module installer. Instead of zip files, also tar.gz archives are possible, but the installer script can only handle zip – libzip is a necessary part of Lua(Meta)TeX, while other archive formats are not. ===Module requirementsmain file === All modules module files should start with a block containing ''meta information'' about that module.There is a [[module Module template]] available to help setting up that header correctly. === License ===
Do not forget to specify a ''license'' as the permitted modes of distribution
Including the full text of your license in your source repo is best practice.
In order to avoid ''conflicting macros'' it is essential for a module that it adhere adheres
to the [[Module_Namespaces|namespace convention]].
After releasing a module its namespace[s] should be registered in the [[Module_Namespaces#List_of_Module_Namespaces|list]] for other module authors to know.
===XML Interface file=== 
Each module should have an associated XML specification file
(as in [http://source.contextgarden.net/tex/context/interface/cont-en.xml /tex/context/interface/cont-en.xml]).
Its purpose is a comprehensive listing of the optional and non-optional
arguments that a macro accepted by macros defined in the module accepts
From the interface a good deal of documentation can be auto-generated,
as are for instance the [http://pragma-ade.comnl/general/qrcs/setup-en.pdf ConTeXt Quick Reference]
and the initial input of the [http://wiki.contextgarden.net/Category:Reference/en Command Reference],
which itself started as a wikification of the now obsolete ''TeXShowTeXshow''.
When documenting your module, you can use
<texcode>
\usemodule[intsetups-loadbasics] %Allow xml parsing \loadsetups[mt-name-of-your-module.xml] % to load the file with definitions
\setup{nameofyourcommand}
</texcode>
An example:
<context source="yes">
\setuppapersize[A5]\usemodule[intsetups-loadbasics]\loadsetups[i-framed]\setup{externalfiguresetupframed}
</context>
By default, this places a frame around the setup. If you want to get gray background, as in the context ConTeXt documentation, add the followinga setup like:
<texcode>
\setupframedtexts
[setuptext]
[background=screencolor, backgroundcolor=lightgray,
frame=off]
</texcode>
Apart from the existing XML files in the ConTeXt tree , there is little
documentation online, so feel free to relay your questions to
the [[ConTeXt_Mailing_ListsMailing list|mailing list]]. ==Self-documenting source code==
===Self-documenting source code===
Source files are supposed to contain explanatory comments that document
implementation details and other peculiarities the reader should be
aware of.
 
In <tt>.tex</tt> files (and other files containing primarily TeX code, e.g.
<tt>.mki[iv]</tt>) any line beginning with the comment leader <tt>%D</tt>
will be treated as such a docstring.
Formatting is done via ordinary TeX commands.
 
In Lua files (e.g. <tt>.cld</tt>) multi-line comments start with
<tt>--[[ldx--</tt> and end with <tt>--ldx]]--</tt>.
* [[source:x-ldx.ctx|<tt>x-ldx.ctx</tt>]] for Lua files, and
* [[source:s-mod.ctx|<tt>s-mod.ctx</tt>]] for TeX files.
 Thus, in order to generate the documentation for thehypothetical[https://bitbucket.org/wolfs/simplefonts/src ''simplefontssimple'']module you first have to `chdir ` to the <tt>files</tt> subdirectory of
your checkout.
 
Next you run the pretty printer on its main file
<pre>
context --ctx=s-mod t-simplefontssimple.tex
</pre>
to get a <tt>t-simplefontssimple.pdf</tt> which contains the &ndash; sparse
&ndash; annotations in serif and the actual code as colorful listing.
 
Likewise the processing of Lua code, e.g. <tt>[[source:font-def.lua|font-def.lua]]</tt> from
the main ConTeXt tree:
Which should generate a font-def.pdf in your current directory.
==Publication and maintenance== * Please upload your module(The autogenerated documentation of all s) to https://modules.contextgarden.net! Our server scripts handle distribution for ConTeXt sources and CTAN.* Register an account, then you can login to the “member section”.* If you lost your password, please ask Taco or Mojca (via the mailing list if you don’t know them).* Please read the help page (it’s mostly the same as here). * Create a '''new module''' entry with a distinct name (e.g. “simple”; this will become the internal ID) and fill in the metadata:** Title, e.g. “Simple” (This will get used in filenames!)** Short and longer description (the short one gets published e.g. in CTAN updates).** Home URL, if the module has beena homepage, e.g. a wiki page or git repository.** Keywords (for CTAN search)** Type: Macro or font (Please don’t publish font modules any more!)** Works with Mk... (please check)made available ** License (there are licenses missing, we need to fix that)** Check “Put in download section” (yes please, allows installation by Luigi at [httpscript)** Check “Put in ConTeXt distribution” (not sure if this works)** Check “Synch with CTAN” (yes please, makes it visible)** CTAN location://foundrye.supelecg.fr“<tt>/gfmacros/projectcontext/modulescontrib/context-simple</].tt>”Go there ** Comment: for examples of you or the outputserver admins* Create a '''new module version''' from a ZIP upload/download or checkout from SVN or git** Log message: short information about changes in this version** Version: usually YYYY.MM.)DD, but up to you** File upload / HTTP download URL: release file as ZIP, as outlined above** SVN/GIT URL: repository checkout, structured like the ZIP, as outlined above
===Legacy modules disclaimer===<!-- This info is obsolete, the section could be kicked outAs an module author, doesn’t it? -->Prior makes sense to subscribe to release ''2005the [https://mailman.05ntg.25'', ConTeXt silently truncated all file names in <cmd>usemodule<nl/mailman3/lists/cmd> commands to 8 characters long and lowercased them to "prevent cross platform problems with filenames"dev-context.ntg. Thus, module files that are to be used with older versions of ConTeXt must have filenames that fit those restrictions, or they will (somewhat cryptically) not be foundnl/ developers mailing list].

Navigation menu