ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Max Chernoff via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Max Chernoff <mseven@telus.net>
Subject: Re: [m-database] How to properly add module arguments?
Date: Sun, 26 Feb 2023 03:36:05 -0700	[thread overview]
Message-ID: <331dd11559b2327ba709bfc72aeeac9aa2610210.camel@telus.net> (raw)
In-Reply-To: <5839E740-556F-41A4-A9C3-5447AFDE84BA@mazaitis.org>

Hi Paul,

> I added a stanza to the appropriate interface file:
> 
> --- begin stanza added to i-database.xml ---
> 
> I modeled that after the stanza for the argument `strip`. I think
> that's the only thing I need to do in the interface file.

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

>    \c!skipheader=\v!no, % <- Added, following the pattern with strip

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. 

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. 

You could define \c!skipheader to just be "skipheader", or you could
give it a translated value for 10 or so languages. But the easier
solution is to just use the string "skipheader" directly:

   \setupdatabase
     [\c!separator={,},
      \c!quotechar=,
      \c!commentchar=,
      \c!strip=\v!no,
      skipheader=\v!no, % <-- HERE
      \c!before=,
      \c!after=,
      \c!first=,
      \c!last=,
      \c!left=,
      \c!right=]
   
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)
   
Hope this helps,
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-02-26 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-26  0:52 Paul Mazaitis via ntg-context
2023-02-26 10:36 ` Max Chernoff via ntg-context [this message]
2023-03-04 17:14   ` Paul Mazaitis via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=331dd11559b2327ba709bfc72aeeac9aa2610210.camel@telus.net \
    --to=ntg-context@ntg.nl \
    --cc=mseven@telus.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).