From: Gerben Wierda via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Gerben Wierda <gerben.wierda@rna.nl>
Subject: Can I simplify this to some sort of logic so it scales better?
Date: Mon, 6 Jun 2022 13:34:22 +0200 [thread overview]
Message-ID: <5E55F07E-0E20-4D95-ACF5-35CB4A3F6D72@rna.nl> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1140 bytes --]
I have this:
\definemode[EN,FR,RU,PT][keep]
\doifmodeelse{EN}
{
\disablemode[FR]
\disablemode[RU]
\disablemode[PT]
}
{
\doifmodeelse{FR}
{
\disablemode[EN]
\disablemode[RU]
\disablemode[PT]
}
{
\doifmodeelse{RU}
{
\disablemode[EN]
\disablemode[FR]
\disablemode[PT]
}
{
\doifmodeelse{PT}
{
\disablemode[EN]
\disablemode[FR]
\disablemode[RU]
}
{
\enablemode[EN]
}
}
}
}
But for every language added this becomes more and more complex. I was wondering what would be a good approach to simplify it.
I want to make sure that one and only one of these modes is active and that if no mode is entered on the command line the mode is EN.
Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R&A IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>
[-- Attachment #1.2: Type: text/html, Size: 8356 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2022-06-06 11:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 11:34 Gerben Wierda via ntg-context [this message]
2022-06-06 12:18 ` Wolfgang Schuster 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=5E55F07E-0E20-4D95-ACF5-35CB4A3F6D72@rna.nl \
--to=ntg-context@ntg.nl \
--cc=gerben.wierda@rna.nl \
/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).