[NTG-context] [m-database] How to properly add module arguments?

Paul Mazaitis paul at mazaitis.org
Sat Mar 4 18:14:17 CET 2023


On 26 Feb 2023, at 5:36, Max Chernoff via ntg-context wrote:

> I'd recommend completely ignoring the interface i-*.xml files. They
> don't do anything particularly useful for a third-party module.

It's good to know there's no dependency there (but I do like to keep things updated :) ).

> This line is your issue. Inside \unprotect...\protect, "!" is treated as
> a letter, so you're trying to expand the value of the macro
> "\c!skipheader". The problem is that that macro isn't defined anywhere.

A ha! Many thanks; I've gotten it working, along with this hint:

>       skipheader=\v!no, % <-- HERE

...so I think I'm okay.

(I don't mind doing the translations, but that's probably outside the scope of this project.)

> Backing up a little further, the \c!... commands are all string
> *C*onstants. If you see a command with a name like \c!blah, it almost
> certain expands to exactly the string "blah". Why is this useful? Well,
> if you run ConTeXt in another language, then the \c!... commands will
> instead contain that string but in the other language. So something like
> \c!left would be "left" in English, "gauche" in French, "links" in
> German, "vlevo" in Czech, etc.

This, too, was useful - as per the Scratch Variables page in the System Macros section of the garden (https://wiki.contextgarden.net/System_Macros/Scratch_Variables) I've updated my tree-sitter parser (https://github.com/pmazaitis/tree-sitter-context_en) to put these in the parse tree; I don't know how useful that is, but it seems to me that being able to call these out might help.

> As a more general suggestion, it is usually a really bad idea to modify the
> standard ConTeXt files since any changes will be overwritten on updates.
> Probably the best solution is to make a new file called "t-xdatabase.mkiv"
> stored in your texmf-local/, start the file with "\usemodule[database]"
> then add any changes after that. Or, just copy and paste the original file
> into your new file. (Maybe you were doing this already though)

Oh! Indeed: my working ConTeXt environment is under version control;  experimental nonsense like this gets safely tucked away in a branch (my thinking is that I want to try to change as few new variables as possible - still learning!).

> Hope this helps,

Absolutely; many thanks!

> -- Max

	-Paul



More information about the ntg-context mailing list