Changes

Jump to navigation Jump to search
907 bytes added ,  10:38, 1 July 2020
The ConTeXt source browser at [http://source.contextgarden.net http://source.contextgarden.net] has recently been replaced by a Lua implementation that uses Hans Hagen's SciTE lexers for syntax highlighting and a search index that is built up using a Lua script.
 
''Note:'' for some of the really large files (for example <code>char-def.lua</code>), syntax highlighting is disabled.
= Browsing the installed files =
This installation is not always completely in sync with the latest ConTeXt distribution, because setting up the installation on the server is quite elaborate (as various auxiliary databases need to be updated as well).
 
When viewing a file, on top of the highlighted source the file name is displayed. This is also a download link. It also shows the file size and a modification time (but that is the creation time of the ConTeXt distribution, so not particularly useful).
= Searching the sources =
''Note:'' At the moment, you cannot do AND/OR searches or search for multiple words at the same time.
There are four option checkboxes immediately below the search input, and two separate options, to control the search. Each of these are optional, with irrelevant values. The script only looks at the existence of the option, it never checks the actual values except for the value of the <code>search field uses Lua patterns by default</code> parameter itself.
Quick start== Optional search index: Lua patterns have roughly the same list of special characters as simple regular expressions, but they use the <code>%</code> character for escaping those. See the [https://www.lua.org/manual/5.3/manual.html#6.4.1 Patterns section] of the Lua manual for details.Comments ==
There are four option checkboxes below the search input. Each of these are optional, with irrelevant values. The script only looks at the existence of the option, it never checks the actual values except for the value of the <code>search</code> parameter itself.Name: '''comments'''Default: '''OFF'''
== ignore comments ==This includes the index of everything that is marked as 'comment' by the SciTE lexers.
Name== Optional search index: '''igncomments'''Default: '''ON'''Docs ==
Name: '''docs'''
Default: '''OFF'''
This skips everything that is marked as 'comment' by includes the SciTE lexersindex of all files in the <code>doc/</code> subtree.
== ignore doc tree Optional search index: MkII ==
Name: '''igndocsmkii'''Default: '''ONOFF'''
This skips all includes the index of MkII files in the <code>doc/</code> subtree.
== whole Optional search index: Data == Name: '''data'''Default: '''OFF''' This includes the index of Data files (<code>data/</code> subtree, <code>interface/</code> subtree, <code>scripts/</code> subtree, sample files, test files, et cetera). == Whole words only ==
Name: '''wholewords'''
Modifies the search pattern by anchoring it to the begin and end of the search index keys, as if it was enclosed in <code>^</code>...<code>$</code>
== plain text Lua string pattern matches ==
Name: '''ppat'''
Default: '''OFF'''
Treats the input as a lua string pattern instead of plain text instead . Quick start: Lua patterns have roughly the same list of a special characters as simple regular expressions, but they use the <code>%</code> character for escaping those. See the [https://www.lua pattern.org/manual/5.3/manual.html#6.4.1 Patterns section] of the Lua manual for details.
= Highlighting of search terms =
<nowiki>{{src|context.mkiv?search{{=}}lang-}}</nowiki>
<nowiki>{{src|context.mkiv?search{{=}}lang-&ppat{{=}}1}}</nowiki>
<nowiki>{{src|context.mkiv#l107}}</nowiki>
{{src|context.mkiv?search{{=}}lang-}}
{{src|context.mkiv?search{{=}}lang-&ppat{{=}}1}}
{{src|context.mkiv#l107}}
''Note that you have to write the equals sign as <nowiki>{{=}}</nowiki>inside wiki templates.''
= A note about the search index =
* Only words longer than three letters are indexed.
* Lua language keywords and matches that occur more than 1000 times (approx.) are not indexed.
* All of the files in the <code>patterns/</code> subtree and the top-level <code>fonts/</code> tree are skipped.
If you find a problem that is not caused by one of the aforementioned limitations, please report it to [[User:taco]] by sending an email to [mailto:gardeners@contextgarden.net gardeners@contextgarden.net].
 
[[Category:Development]]

Navigation menu