From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: ConTeXt users <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: [NTG-context] command to process CSV file (database module)
Date: Sun, 5 Nov 2023 13:56:50 +0100 [thread overview]
Message-ID: <3fea5631-1466-69c5-e2fe-be95e0599786@gmx.es> (raw)
Dear list,
These are the following first four lines of a CSV file:
,,
"About \LuaTeX\ and
\ConTeXt","about.pdf","https://www.pragma-ade.com/general/manuals/about.pdf"
"l2r, r2l: A Few
Tips","bidi.pdf","https://www.pragma-ade.com/general/manuals/bidi.pdf"
"Flowcharts","charts-mkiv.pdf",
Faking a command such as \cA, \cB and \cC (for contents of columns A, B
or C) I would like to create a source document with an enumeration that
contains:
\doiftext{\cB}
{\item {\em\cA}\attachment[file=\cB]%
\doiftext{\cC}{ (also available at \cC)}.}
I would like to do that with the "database" module.
So far I have adapted the itemize environment, but I don't get the
contents for items right:
\usemodule[database]
\starttext
\def\ItemContents#1#2#3{\doiftext{#2}
{\item {\em #1}\attachment[file=#2]%
\doiftext{#3}{ (also available at #3)}.}}
\defineseparatedlist
[test]
[separator={,}, % tab
quotechar={"}, % tab
before={\startitemize[n]},after={\stopitemize},
first={\ItemContents},last={.},
left={\{},right={\}}]
\processdatabasefile[test][context-documents.csv]
\stoptext
I get an error about an unexpected symbol near "\" in the line of
"\processdatabasefile".
Could anyone enlighten me about what I am missing here?
Many thanks for your help,
Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2023-11-05 13:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-05 12:56 Pablo Rodriguez via ntg-context [this message]
2023-11-05 18:00 ` [NTG-context] " Pablo Rodriguez 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=3fea5631-1466-69c5-e2fe-be95e0599786@gmx.es \
--to=ntg-context@ntg.nl \
--cc=oinos@gmx.es \
/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).