emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Jan Ulrich Hasecke <juh@mailbox.org>
Cc: Org-Mode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Tutorials on creating pdfs with org-babel and sqlite
Date: Sun, 13 Nov 2022 05:39:13 +0300	[thread overview]
Message-ID: <Y3BY0cg8lnavGulf@protected.localdomain> (raw)
In-Reply-To: <Y2/gshDHsN1MAnXV@odysseus>

[-- Attachment #1: Type: text/plain, Size: 7173 bytes --]

* 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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2022-11-13  4:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 18:06 Tutorials on creating pdfs with org-babel and sqlite Jan Ulrich Hasecke
2022-11-13  0:57 ` Christopher M. Miles
2022-11-13  1:57 ` Vikas Rawal
2022-11-13  2:08   ` Vikas Rawal
2022-11-13  2:39 ` Jean Louis [this message]
2022-11-13 12:05   ` juh

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3BY0cg8lnavGulf@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=emacs-orgmode@gnu.org \
    --cc=juh@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).