ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <texml@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: contextproject script (was: Typesetting Markdown - Part 8)
Date: Tue, 28 Apr 2020 16:39:31 +0200	[thread overview]
Message-ID: <6D6824E0-F8C7-48F9-A1AE-4F562F3CAB2F@fiee.net> (raw)
In-Reply-To: <2BE5ABDC-7C66-48A9-8452-E1B8415C801A@bahnhof.se>


> Am 28.04.2020 um 16:12 schrieb Jan-Erik Hägglöf <janerik.hagglof@bahnhof.se>:
> 
>> 28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm <texml@fiee.net>:
>> 
>> Yes, the naming is completely up to you.
>> 
>> I use:
>> 
>> project_something.tex
>> env_something.tex
>> prd_oneissue.tex
>> c_onechapter.tex
>> 
>> That’s also what my script supports as default:
>> https://github.com/fiee/tools/blob/master/contextproject.py

> Is there a running example ? I’m not sure how to fill in the commandline


1) Have a look at https://wiki.contextgarden.net/Project_structure

2) To avoid the whole name, I set:
alias mkprj='python3 ~/workspace/tools/contextproject.py'

3) 
$ mkprj --help
Usage: contextproject.py [options]
(env > prj > prd > cmp)
Provide all names without prefix and suffix!

ConTeXt project management  (c) 2009-2019 by Henning Hraban Ramm, fiëé
visuëlle

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -m FILETYPE, --mode=FILETYPE
                        create which type of file?
  -c NAME, --component=NAME, --cmp=NAME
                        create component file
  -p NAME, --product=NAME, --prd=NAME
                        create or set product file
  -j NAME, --project=NAME, --prj=NAME
                        create or set project file
  -e NAME, --environment=NAME, --env=NAME
                        create or set environment file
  -i FILENAME, --template=FILENAME, --ini=FILENAME
                        use non-default initial template file
  -d DIRNAME, --directory=DIRNAME, --dir=DIRNAME
                        project path
  -C DIRNAME, --component_directory=DIRNAME, --cmpdir=DIRNAME
                        path for component files below project path

4) Create files in the order environment, project, product, component(s)
i.e.
# Create empty environment (it lacks the project name; I do this manually, copying from another project):
$ mkprj -e something
# Create the project file:
$ mkprj -e something -j something
# Create a product and insert it in project:
$ mkprj -j something -p first
# Create a component dir for product "first" and add a component:
$ mkprj -j something -p first -C first -c author

If there’s a component.ini, product.ini etc. it will get used as a template for that level.

There are a few bugs in the output, e.g. in the first call you can’t set the project name, and in the second it won’t create an environment if it’s missing. If you leave out the project when you create a component, the name gets an additional prefix. -m is mostly useless, and I never use -d.
I should fix that, but these are just minor annoyances.

Have fun!

Hraban


___________________________________________________________________________________
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:[~2020-04-28 14:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28  2:00 Typesetting Markdown - Part 8 Thangalin
2020-04-28  6:32 ` Jan U. Hasecke
2020-04-28  7:33   ` Henning Hraban Ramm
2020-04-28 14:12     ` Jan-Erik Hägglöf
2020-04-28 14:39       ` Henning Hraban Ramm [this message]
2020-04-28 15:29         ` contextproject script (was: Typesetting Markdown - Part 8) Jan-Erik Hägglöf
2020-04-28 16:47         ` Henning Hraban Ramm
2020-04-28 15:33       ` Typesetting Markdown - Part 8 Thangalin
2020-04-28 15:41         ` Jan-Erik Hägglöf
2020-04-28 16:07         ` Henning Hraban Ramm
2020-04-28 21:16           ` Henning Hraban Ramm
2020-04-28  8:35   ` Saša Janiška
2020-04-28 13:57     ` Jan U. Hasecke
2020-04-28 19:57   ` Thangalin

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=6D6824E0-F8C7-48F9-A1AE-4F562F3CAB2F@fiee.net \
    --to=texml@fiee.net \
    --cc=ntg-context@ntg.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).