Typesetting Markdown - Part 8
Hi folks! Second last part in the series. The project, product, component, and environment relations were a bit finicky. Those willing to point out improvements that can be made---Hans, Taco, Wolfgang, Aditya, and others---would be very much appreciated. Specifically, it seems that some project environment settings can be overruled inside products, but other project settings cannot. It's not really clear to me whether this is due to dependency order or that definitions cannot be redefined across environments. Thoughts? https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdown-part-8/ Stay safe!
Hi Dave, Am 28.04.20 um 04:00 schrieb Thangalin:
Hi folks!
Second last part in the series. The project, product, component, and environment relations were a bit finicky. Those willing to point out improvements that can be made---Hans, Taco, Wolfgang, Aditya, and others---would be very much appreciated.
Specifically, it seems that some project environment settings can be overruled inside products, but other project settings cannot. It's not really clear to me whether this is due to dependency order or that definitions cannot be redefined across environments. Thoughts?
https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdown-part-8/
thank you very much. I really appreciate your series. There is so much in it that suits to my needs that I have to read it carefully later. But I have some short remarks anyway. Some topics are especially of interest to me: 1. Nameing and organizing the project, product and environments files. I am currently reorganising the files for my cooperative. I think that besides some nameing conventions it is more or less up to me how I organise our print work. Any recommendations welcome. 2. The "Deutsches Text Archiv" has prepared a text corpus of German texts up to 1900 in TEI PS XML, so we could use them directly to typeset books. What I am looking for is a script to extract all XML tags/tokens from their files to have a complete list of things that should be handled in a ConTeXt style file. Five years ago I tried to create such a style file by hand, but I gave up. https://github.com/juh2/tei-style-dta-context The tokens/tags differ from text to text and I think the structure too so that it was beyond my knowledge to generate a general style file for all texts. 3. Being a writer I think that Markdown --> ConTeXt is the best way to achieve what I want: easy writing and professional looking books. Up to now I used Pablos way via pandoc and XHTML described here: http://www.from-pandoc-to-context.tk/ The problem with pandoc is that it does not generate a perfect ConTeXt source to build the file as some things are missing. Annotations and eg. your classify.lua might be a second approach to achieve what I want. So thanks a lot for your work. @all: Feel free to comment on my three topics any hints are welcome. Ciao! juh
Am 28.04.2020 um 08:32 schrieb Jan U. Hasecke
: 1. Nameing and organizing the project, product and environments files. I am currently reorganising the files for my cooperative. I think that besides some nameing conventions it is more or less up to me how I organise our print work. Any recommendations welcome.
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 Probably I should switch to .mkiv extensions, since I also have LaTeX projects now.
2. The "Deutsches Text Archiv" has prepared a text corpus of German texts up to 1900 in TEI PS XML, so we could use them directly to typeset books. ... The tokens/tags differ from text to text and I think the structure too so that it was beyond my knowledge to generate a general style file for all texts.
And it’s probably impossible. Like with HTML and ePub export, the mapping of structures is very individual. Best, Hraban
Is there a running example ? I’m not sure how to fill in the commandline
28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm
: 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 https://github.com/fiee/tools/blob/master/contextproject.py
Am 28.04.2020 um 16:12 schrieb Jan-Erik Hägglöf
: 28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm
: 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
That was clarifying. Thanks a lot and good work done by you! Take Care Best wishes, Janne
28 apr. 2020 kl. 16:39 skrev Henning Hraban Ramm
: Am 28.04.2020 um 16:12 schrieb Jan-Erik Hägglöf
: 28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm
: 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 ___________________________________________________________________________________
Am 28.04.2020 um 16:39 schrieb Henning Hraban Ramm
: 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.
Ok, new version: fixed the bugs, modernized the code and added a few more useless cryptic options for Thangalin. Enjoy! HR
Jan-Erik, after you have installed all the required software (and
fonts!) and unzipped the book.zip and themes.zip archives, you can
build a book using:
cd $HOME/dev/writing/book
./build -V -c -y -i jekyll-hyde -d standard-ebooks/jekyll-hyde \
-b robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde
This is noted at the bottom of the preamble section.
Enjoy!
On Tue, Apr 28, 2020 at 7:12 AM Jan-Erik Hägglöf
Is there a running example ? I’m not sure how to fill in the commandline
28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm
: 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
___________________________________________________________________________________ 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 ___________________________________________________________________________________
Perfect, I will get in to it. Many thanks and Best wishes, Janne
28 apr. 2020 kl. 17:33 skrev Thangalin
: Jan-Erik, after you have installed all the required software (and fonts!) and unzipped the book.zip and themes.zip archives, you can build a book using:
cd $HOME/dev/writing/book ./build -V -c -y -i jekyll-hyde -d standard-ebooks/jekyll-hyde \ -b robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde
This is noted at the bottom of the preamble section.
Enjoy!
On Tue, Apr 28, 2020 at 7:12 AM Jan-Erik Hägglöf
wrote: Is there a running example ? I’m not sure how to fill in the commandline
28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm
: 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
___________________________________________________________________________________ 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 ___________________________________________________________________________________
___________________________________________________________________________________ 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 ___________________________________________________________________________________
Don’t forget, what’s already included in ConTeXt: \usemodule[visual] \useMPlibrary[dum] \starttext \simplethesis \stoptext
Am 28.04.2020 um 17:33 schrieb Thangalin
: Jan-Erik, after you have installed all the required software (and fonts!) and unzipped the book.zip and themes.zip archives, you can build a book using:
cd $HOME/dev/writing/book ./build -V -c -y -i jekyll-hyde -d standard-ebooks/jekyll-hyde \ -b robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde
This is noted at the bottom of the preamble section.
Enjoy!
On Tue, Apr 28, 2020 at 7:12 AM Jan-Erik Hägglöf
wrote: Is there a running example ? I’m not sure how to fill in the commandline
28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm
: 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
Sorry, I took your message for irony. Should have read your blog posts to know better. Hraban
Am 28.04.2020 um 18:07 schrieb Henning Hraban Ramm
: Don’t forget, what’s already included in ConTeXt:
\usemodule[visual] \useMPlibrary[dum]
\starttext \simplethesis \stoptext
Am 28.04.2020 um 17:33 schrieb Thangalin
: Jan-Erik, after you have installed all the required software (and fonts!) and unzipped the book.zip and themes.zip archives, you can build a book using:
cd $HOME/dev/writing/book ./build -V -c -y -i jekyll-hyde -d standard-ebooks/jekyll-hyde \ -b robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde
This is noted at the bottom of the preamble section.
Enjoy!
On Tue, Apr 28, 2020 at 7:12 AM Jan-Erik Hägglöf
wrote: Is there a running example ? I’m not sure how to fill in the commandline
28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm
: 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
___________________________________________________________________________________ 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 ___________________________________________________________________________________
On Tue, 28 Apr 2020 08:32:57 +0200
"Jan U. Hasecke"
3. Being a writer I think that Markdown --> ConTeXt is the best way to achieve what I want: easy writing and professional looking books.
I've the same opinion!
Up to now I used Pablos way via pandoc and XHTML described here: http://www.from-pandoc-to-context.tk/
What do you use now?
The problem with pandoc is that it does not generate a perfect ConTeXt source to build the file as some things are missing.
You mean Pablos pandoc --> from-pandoc-to-context or direct pandoc --> ConTeXt export ? Sincerely, Gour -- As a lamp in a windless place does not waver, so the transcendentalist, whose mind is controlled, remains always steady in his meditation on the transcendent self.
Am 28.04.20 um 10:35 schrieb Saša Janiška:
On Tue, 28 Apr 2020 08:32:57 +0200 "Jan U. Hasecke"
wrote: 3. Being a writer I think that Markdown --> ConTeXt is the best way to achieve what I want: easy writing and professional looking books.
I've the same opinion!
Up to now I used Pablos way via pandoc and XHTML described here: http://www.from-pandoc-to-context.tk/
What do you use now?
Oh I still use it. But Daves posts might offer an alternative for me.
The problem with pandoc is that it does not generate a perfect ConTeXt source to build the file as some things are missing.
You mean Pablos pandoc --> from-pandoc-to-context or
Yes. juh
Hi Jan,
1. Nameing and organizing the project, product and environments files. I am currently reorganising the files for my cooperative. I think that besides some nameing conventions it is more or less up to me how I organise our print work. Any recommendations welcome.
Download "themes.zip" from the blog post. It shows some naming conventions and relationships between projects, products, environments, and components.
books. What I am looking for is a script to extract all XML tags/tokens from their files to have a complete list of things that should be handled in a ConTeXt style file. Five years ago I tried to create such a style file by hand, but I gave up.
XSL was designed specifically to parse XML. ConTeXt has facilities for mapping XML tokens, as you've used. Depending on the complexity of what you're trying to accomplish, take a look at "book.zip" from the blog post. Inside you'll find "se2md.xsl"; a similar approach could work for TEI: put the complexity of parsing TEI into XSL, then use ConTeXt to typeset the resulting document.
participants (5)
-
Henning Hraban Ramm
-
Jan U. Hasecke
-
Jan-Erik Hägglöf
-
Saša Janiška
-
Thangalin