Changes

Jump to navigation Jump to search
3,411 bytes added ,  14:54, 23 February 2017
m
Corrected broken link to Wolfgang Schuster's explanation of \definenamespace
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. Should be the same as the identifier of the module’s namespace.
|-
|<tt>nametype</tt> || <tt>module</tt>: creates the namespace prefixed with quadruple ''string@'': The identifier that will ; other values are planned to be used to reference setups and parametersadded in the future for internal purposes.
|-
|<tt>parentsetup</tt> || <tt>list</tt> or ''stringboolean'': initiates the creation of a namespace identifiersetup 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][..,..=. Can reference itself. Functionality not yet known,..]</tt>);
|-
|<tt>typelist</tt> || first argument of the setup accepts a comma separated list (<tt>module\setupNS[one,two,three][..,..=..,..]</tt>: intended use?? Not yet known).|}
|-
|align="right" |<tt>command</tt> || <tt>list</tt> or ''boolean'': functionality not yet knowncreates 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 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 first argument of <tt>\defineNS</tt> will take comma separated values.
|-
|<tt>setupcomment</tt> || Defines a setup command; <tt>list</tt>''string'': ??. Further functionality not yet disclosedmeta-information, see [[#Related Commands|related commands]] below.
|-
|<tt>commentversion</tt> || ''stringnumber'': nonmeta-functional information that will be stored along with the namespace??, see [[#Related Commands|related commands]].
|-
|<tt>versionstyle</tt> || ''numberboolean'': versioning information?? Functionality not yet knownenables 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]
4

edits

Navigation menu