Changes

Jump to navigation Jump to search
3,433 bytes added ,  17:36, 8 June 2020
m
no edit summary
should adhere to the following rules:
* Namespaces Namespace identifiers (their <tt>name</tt> parameter) should have more than two characters (at least yours [http://article.gmane.org/gmane.comp.tex.context/61939]),
* the namespace should be registered here for others to know.
! style="background:#addeff;" | Main file !! Description
|-
|<tt>fbalgorithmic</tt>| algorithmic| [https://bitbucket.org/wolfs/algorithmic t-algorithmic]| Write algorithms.|-| <tt>animation</tt>| animation| [https://bitbucket.org/wolfs/animation t-animation]| Interface for fieldstack based animation.|-| <tt>annotation</tt>| annotation| [https://bitbucket.org/wolfs/annotation t-annotation]| Annotate text blocks.|-| <tt>cyrnum</tt>| cyrnum| [https://bitbucket.org/phg/context-cyrillicnumbers t-cyrillicnumbers]| Cyrillic numerals, counters.|-| <tt>fancybreak </tt>|fancybreak| [httphttps://bitbucket.org/wolfs/fancybreak t-fancybreak] || Inserting thought breaks (transitions).|-| <tt>fx</tt>| fixme| [https://bitbucket.org/wolfs/fixme t-fixme]| Todo notes.|-| <tt>fullpage</tt>| fullpage| [https://bitbucket.org/wolfs/fullpage t-fullpage]| Set equal margin without \setuplayout.|-| <tt>letterspace</tt>| letterspace| [https://bitbucket.org/phg/t-letterspace t-letterspace]| Define letterspacing macros.|-| <tt>rb</tt>| ruby| [https://bitbucket.org/wolfs/ruby t-ruby]| Highlight text with ruby markup.|-|<tt>RST</tt>| RST| [https://bitbucket.org/phg/context-rst t-rst]| Convert/typeset reStructuredText.|-|<tt>TRL</tt>| transliterate| [https://bitbucket.org/phg/transliterator t-transliterator]| Transliteration from non-Latin scripts.|- | <tt>visualcounter</tt>| visualcounter || [http://github.com/adityam/visualcounter t-visualcounter] || Display counters using a graphic
|+ style="font-style:italic; font-size:83.3333%;" | Reserved module namespaces.
|}
=Generating a Namespace for Your Module=
Context provides the user command [[{{cmd:definenamespace|\definenamespace]] }}
that generates a valid namespace for variables and takes care
of defining a setup command as well.
determine what commands will be available.
At the time of this writing (2010-09-27), this is rather
new stuff and so far neither not guaranteed to stay in contextas it is nor fully documented (and implemented?).Therefore, the following table uses double questionmarksto designate information that was only inferred indirectlyunmodified.
{|cellpadding="10" style="border:2px solid #addeff" rules="rows"! style="background:#addeff;" | Option !! Parameters and their description(''NS'' is a namespace dummy)
|-
|<tt>name</tt> || ''string'': The identifier that will be used to reference setups and parameters; e.&nbsp;g. a value of ''NS'' causes the macros <tt>\defineNS</tt> and <tt>\setupNS</tt> to be created.
|-
|<tt>parent</tt> || ''string'': a namespace identifier. Can reference itself. Functionality not yet knownShould be the same as the identifier of the module’s namespace.
|-
|<tt>type</tt> || <tt>module</tt>: intended use?? Not yet knowncreates the namespace prefixed with quadruple ''@''; other values are planned to be added in the future for internal purposes.
|-
|<tt>commandsetup</tt> || <tt>list</tt> or ''boolean'': functionality not yet knowninitiates the creation of a setup according to the <tt>name</tt> argument, e.&nbsp;g. <tt>\setupNS</tt>. The specified value influences the behaviour of the setup:{||<tt>yes</tt> || first argument of the setup accepts one parameter (<tt>\setupNS[one][..,..=..,..]</tt>);
|-
|<tt>setuplist</tt> || Defines first argument of the setup accepts a setup command; comma separated list (<tt>list\setupNS[one,two,three][..,..=..,..]</tt>: ??. Further functionality not yet disclosed).|}
|-
|align="right" |<tt>commentcommand</tt> || <tt>list</tt> or ''stringboolean'': non-functional information that creates auxiliary macros and the proper command to define further commands within the new namespace (<tt>\defineNS</tt>).For a <tt>name</tt> parameter ''NS'', the values of the <tt>\setupNS</tt> command will be stored along retrievable via <tt>\NSparameter{parametername}</tt>. Additionally, access is provided by <tt>\namedNSparameter</tt> and <tt>\detokenizedNSparameter</tt>.The <tt>\defineNS[command][..,..=..,..]</tt> can be used to create instances of a generic macro with local setups. Works like ordinary Context <tt>\definesomething</tt> commands and allows for inheritance (<tt>\defineNS[command][othercommand]</tt>). Of course, if <tt>command</tt> is set to ''list'', the namespace??first argument of <tt>\defineNS</tt> will take comma separated values.
|-
|<tt>comment</tt> || ''string'': meta-information, see [[#Related Commands|related commands]] below.|-|<tt>version</tt> || ''number'': versioning meta-information?? Functionality not yet known, see [[#Related Commands|related commands]].|-|<tt>style</tt> || ''boolean'': enables special handling for text color and style attributes.If set to ''yes'', a macro <tt>\dosetNSattributes</tt> will be created. It receives the values for the <tt>style</tt> and <tt>color</tt> arguments as supplied to the <tt>\setupNS</tt> macro which itself gets created via the <tt>setup</tt> key (see above).
|+ Optional settings for module namespaces.
|}
=Related Commands=
==<tt>\listnamespaces</tt>==
Prints all namespaces defined in tabular form along
with additional information. Example:
 
<texcode>
\definenamespace[Newns][
name=Newns,
type=module,
setup=list,
parent=NS,
style=yes,
version=3.141,
comment=this space has been named,
]
 
\starttext
\listnamespaces
\stoptext
</texcode>
=Further Information=
* [[source:mult-aux.mkiv|Definition of <tt>\definenamespace</tt>]].
* [[System Macros]].
* Some of the functionality was explained by Wolfgang Schuster on the [https://mailman.ntg.nl/pipermail/ntg-context/2010/054307.html Context list]
 
[[Category:Modules]]

Navigation menu