emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Tutorials on creating pdfs with org-babel and sqlite
@ 2022-11-12 18:06 Jan Ulrich Hasecke
  2022-11-13  0:57 ` Christopher M. Miles
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jan Ulrich Hasecke @ 2022-11-12 18:06 UTC (permalink / raw)
  To: Org-Mode Mailinglist

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

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?

TIA
juh




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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tutorials on creating pdfs with org-babel and sqlite
  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:39 ` Jean Louis
  2 siblings, 0 replies; 6+ messages in thread
From: Christopher M. Miles @ 2022-11-13  0:57 UTC (permalink / raw)
  To: Jan Ulrich Hasecke; +Cc: emacs-orgmode

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


You can check out http://www.howardism.org/Technical/Emacs/literate-database.html

This is very great.

Jan Ulrich Hasecke <juh@mailbox.org> writes:

> [[PGP Signed Part:Undecided]]
> 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?
>
> TIA
> juh
>
>
>
> [[End of PGP Signed Part]]


-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tutorials on creating pdfs with org-babel and sqlite
  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
  2 siblings, 1 reply; 6+ messages in thread
From: Vikas Rawal @ 2022-11-13  1:57 UTC (permalink / raw)
  To: Jan Ulrich Hasecke; +Cc: Org-Mode Mailinglist

> interested in publishing use cases. Has anybody wrote a book or a report
> with org-mode, org-babel and sqlite?

Many years ago, I wrote this book with orgmode: https://www.fao.org/3/a-i4921e.pdf

The source files are here: https://github.com/vikasrawal/endingmalnutrition

Much has changed in orgmode since then though.

Over the years, all these documents have also been published using orgmode: http://indianstatistics.org/ssermonographs.html

The source files for most of these are not public. But if you are looking for a recent sample, I would be happy to share it.

Vikas


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tutorials on creating pdfs with org-babel and sqlite
  2022-11-13  1:57 ` Vikas Rawal
@ 2022-11-13  2:08   ` Vikas Rawal
  0 siblings, 0 replies; 6+ messages in thread
From: Vikas Rawal @ 2022-11-13  2:08 UTC (permalink / raw)
  To: Jan Ulrich Hasecke, Org-Mode Mailinglist

> interested in publishing use cases. Has anybody wrote a book or a report
> with org-mode, org-babel and sqlite?

Many years ago, I wrote this book with orgmode: https://www.fao.org/3/a-i4921e.pdf

The source files are here: https://github.com/vikasrawal/endingmalnutrition

Much has changed in orgmode since then though.

Over the years, all these documents have also been published using orgmode: http://indianstatistics.org/ssermonographs.html

The source files for most of these are not public. But if you are looking for a recent sample, I would be happy to share it.

Vikas


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tutorials on creating pdfs with org-babel and sqlite
  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:39 ` Jean Louis
  2022-11-13 12:05   ` juh
  2 siblings, 1 reply; 6+ messages in thread
From: Jean Louis @ 2022-11-13  2:39 UTC (permalink / raw)
  To: Jan Ulrich Hasecke; +Cc: Org-Mode Mailinglist

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tutorials on creating pdfs with org-babel and sqlite
  2022-11-13  2:39 ` Jean Louis
@ 2022-11-13 12:05   ` juh
  0 siblings, 0 replies; 6+ messages in thread
From: juh @ 2022-11-13 12:05 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Jan Ulrich Hasecke

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

Hi Jean,

thank you very much for your answer,

Am Sun, Nov 13, 2022 at 05:39:13AM +0300 schrieb Jean Louis:
> - 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.

I agree with this. I my work we always use it, but this project of mine
is very small, in fact it is nothing more than a collection of song
texts.

Perhaps I'll do a little language analysis with NLTK and Python, but
nothing very fancy. 

> - Separate lightweight markup language LWM from publishing objects
>   table. Make the publishing available for any kind of LWM!

This sound very interesting, but goes way beyond my knowledge.

Am I write that this is a tool to reformat the output of a sql query
into the listed LWN? Meaing that if I export the org file to md the
table output eg. is converted to md? I thought that this is done by the
org export mechanism?


juh


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-13 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-11-13 12:05   ` juh

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).