ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: juh <juh+ntg-context@mailbox.org>,
	mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: improve bad habits deduplicate redundant defined values
Date: Wed, 15 Sep 2021 08:59:17 +0200	[thread overview]
Message-ID: <343b489a-e3fb-50b9-56d6-3ec5d5bc9d3b@xs4all.nl> (raw)
In-Reply-To: <YUGVVf2bFaWtJmbE@sokrates>

On 9/15/2021 8:40 AM, juh via ntg-context wrote:
> Dear all,
> 
> these are quite general questions but here they come.
> 
> I defined modular styles for an organisation so that we can use
> different layouts with the same look and feel but still have many
> options to change things in a special document. I have styles for
> colors, fonts which are used everywhere but also styles for heads that
> are only used in legal context and other heads-styles used in other
> contexts.  This works brilliant. I can even overwrite styles for one
> document only.  I'd like to name this a cascading approach.
> 
> While doing this I learned a lot and changed the way the style files are
> organised from time to time.
> 
> Currently I start with colors and fonts. Then comes the page dimension
> definitions, makeups, headers and footers, headlines, the toc styles,
> lists and tables.

the order sounds ok to me

> Does anyone has a similar approach with a strong opinion how to organise
> the cascade?

if you use xml, that one comes last

> While working on this I often found that I defined something twice,
> because I forgot to delete a setup-command in a newly structured file.
> 
> Is there a way to test this? Can I grep for a warning in the log files
> to find these duplicates?
You can try this at the top:

%enabledirectives[overloadmode=warning]
\enabledirectives[overloadmode=error]

it's still sort of 'work in progress' (esp instances), so

\defineitemgroup[xxx]
\definehead[xxx]

will trigger an error (more commands will get the option to control what 
gets defined automatically)

you can work around warnings/errors with

\pushoverloadmode
   new definition
\popoverloadmode

bt keep in mind that some older settings can be persistent

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2021-09-15  6:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  6:40 juh via ntg-context
2021-09-15  6:59 ` Hans Hagen via ntg-context [this message]
2021-09-16  8:09 ` Denis Maier via ntg-context
2021-09-17  8:36   ` Jan Ulrich Hasecke via ntg-context
2021-09-18 12:57     ` Denis Maier via ntg-context
2021-09-18 13:52       ` Jan Ulrich Hasecke via ntg-context
2021-09-18 14:16       ` Hans Hagen via ntg-context
2021-09-18 17:48       ` Henning Hraban Ramm 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=343b489a-e3fb-50b9-56d6-3ec5d5bc9d3b@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.nl \
    --cc=juh+ntg-context@mailbox.org \
    /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).