[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tutorials on creating pdfs with org-babel and sqlite
From: |
Jean Louis |
Subject: |
Re: Tutorials on creating pdfs with org-babel and sqlite |
Date: |
Sun, 13 Nov 2022 05:39:13 +0300 |
User-agent: |
Mutt/2.2.7+37 (a90f69b) (2022-09-02) |
* Jan Ulrich Hasecke <juh@mailbox.org> [2022-11-12 21:09]:
> Dear all,
>
> I am doing my first steps to do some database publishing with org-babel
> and sqlite. So far quite successful, but I am still very new to this, so
> I would appreciate if you can recommend a tutorial on this. I am mostly
> interested in publishing use cases. Has anybody wrote a book or a report
> with org-mode, org-babel and sqlite? What options I have to format the
> output so that I can export it to pdf via pandoc and context?
Let me say from my experience of 20+ years of publishing and using
database:
- use PostgreSQL and its rich features, forget SQLite. Single user
single computer database is good for you personally, but modifying
tables and developing new features is far harder with SQLite.
- Separate lightweight markup language LWM from publishing objects
table. Make the publishing available for any kind of LWM!
- For now I use following "Markup Types" in my `markuptypes' table:
1 Default (Text)
2 Markdown (Discount Markdown)
3 Markdown (Pandoc, espresso)
4 Asciidoc
5 Asciidoctor
6 Markdown (Discount) with Table of Content
7 HTML
8 Kotl
9 Org
10 Org Heading
11 Org Standalone
12 reStructuredText
13 txt2tags
14 Enriched
15 PDF
16 Text with lines joined
17 Org with Markdown TOC
18 PostgreSQL
My publishing object references foreign table of markuptypes. That way
it becomes known what LWM is used for the text of publishing object.
Then I use extra table `markupconversions':
Table
"public.markupconversions"
┌────────────────────────────────┬─────────────────────────────┬───────────┬──────────┬─────────────────────────────────────────────────────────────────┐
│ Column │ Type │ Collation │
Nullable │ Default │
├────────────────────────────────┼─────────────────────────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────┤
│ markupconversions_id │ integer │ │
not null │ nextval('markupconversions_markupconversions_id_seq'::regclass) │
│ markupconversions_datecreated │ timestamp without time zone │ │
not null │ CURRENT_TIMESTAMP │
│ markupconversions_datemodified │ timestamp without time zone │ │
│ │
│ markupconversions_usercreated │ text │ │
not null │ CURRENT_USER │
│ markupconversions_usermodified │ text │ │
not null │ CURRENT_USER │
│ markupconversions_name │ text │ │
not null │ │
│ markupconversions_markupinput │ integer │ │
not null │ │
│ markupconversions_markupoutput │ integer │ │
not null │ │
│ markupconversions_emacslisp │ text │ │
not null │ │
│ markupconversions_description │ text │ │
│ │
│ markupconversions_templates │ integer │ │
│ │
│ markupconversions_command │ text │ │
│ │
└────────────────────────────────┴─────────────────────────────┴───────────┴──────────┴─────────────────────────────────────────────────────────────────┘
That one says how to convert between input markup and output
markup. The conversion Lisp snippet I keep in the database
`markupconversions_emacslisp' as that way no need to change the
source, it remains user's option.
Each publishing object references the web `area`foreign table, meaning
domain. Each `area' references one main template, but each object can
reference separate template. And markup conversion may need separate
template before everything is expanded in the object's or area's
template.
Now we come back to question:
> What options I have to format the output so that I can export it to
> pdf via pandoc and context?
Maybe the above described design pattern may help you figure out how
to solve your problem.
- You can reference publishing objects to foreign table `website`, in
my case it is `area', which means specific domain;
- Specific domain can tell how to use default conversion from which
markup to which markup, how to publish by default. For example you
want by default Org to Markdown to Pandoc output?
- Each publishing object, like page, can have its separate reference
to markup conversion. Maybe you want Org to Asciidoctor? Reference
it from publishing object. If reference is NIL, use the default
website's conversion.
- Define for each markup type, like ConTeXt how to export it to HTML,
PDF, etc.
- Use markup conversion table to tell how to convert ConTeXt to PDF,
or to HTML or to what?
- Make additional table to add additional publishing commands, as
single page such as one with Org markup, may end up published as
Org, as HTML and as PDF.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
signature.asc
Description: PGP signature