From: Kaushal Modi <kaushal.modi@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Request to add tomelr package to GNU ELPA
Date: Tue, 3 May 2022 06:57:12 -0400 [thread overview]
Message-ID: <CAFyQvY3X5pJJPJgU1CWMKLhbLp8gPg9NarzUO=iek0phDuzvMQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3181 bytes --]
Hello,
I have been working on a small library very much inspired and reused from
the core library json.el.
The library is called tomelr, and it does just one job: convert the input
lisp S-exp (alist or plist) to a TOML (see https://toml.io) config string.
Purpose: I plan to replace a lot of custom logic for TOML generation in my
ox-hugo package (Org mode to Markdown exporter for Hugo static site
generator) with this dedicated and fully tested TOML generation library.
The source code is at https://github.com/kaushalmodi/tomelr.
Companion blog post: https://scripter.co/defining-tomelr/
The README.org on the repo has a lot more details, but here's a short
example of what this library does:
** Alist data
'((title . "Some Title") ;String
(author . ("fn ln")) ;List
(description . "some long description\nthat spans multiple\nlines")
;Multi-line string
(date . 2022-03-14T01:49:00-04:00) ;RFC 3339 date format
(tags . ("tag1" "tag2"))
(draft . "false") ;Boolean
(versions . ((emacs . "28.1.50") (org . "release_9.5-532-gf6813d"))) ;Map
or TOML Table
(org_logbook . (((timestamp . 2022-04-08T14:53:00-04:00) ;Array of maps
or TOML Tables
(note . "This note addition prompt shows up on typing
the `C-c C-z` binding.\nSee [org#Drawers](
https://www.gnu.org/software/emacs/manual/html_mono/org.html#Drawers)."))
((timestamp . 2018-09-06T11:45:00-04:00)
(note . "Another note **bold** _italics_."))
((timestamp . 2018-09-06T11:37:00-04:00)
(note . "A note `mono`.")))))
** Plist data
'(:title "Some Title" ;String
:author ("fn ln") ;List
:description "some long description\nthat spans multiple\nlines"
;Multi-line string
:date 2022-03-14T01:49:00-04:00 ;RFC 3339 date format
:tags ("tag1" "tag2")
:draft "false" ;Boolean
:versions (:emacs "28.1.50" :org "release_9.5-532-gf6813d") ;Map or TOML
Table
:org_logbook ((:timestamp 2022-04-08T14:53:00-04:00 ;Array of maps or
TOML Tables
:note "This note addition prompt shows up on typing the
`C-c C-z` binding.\nSee [org#Drawers](
https://www.gnu.org/software/emacs/manual/html_mono/org.html#Drawers).")
(:timestamp 2018-09-06T11:45:00-04:00
:note "Another note **bold** _italics_.")
(:timestamp 2018-09-06T11:37:00-04:00
:note "A note `mono`.")))
** TOML Output
You will get the below TOML output for either of the above input data.
title = "Some Title"
author = ["fn ln"]
description = """
some long description
that spans multiple
lines"""
date = 2022-03-14T01:49:00-04:00
tags = ["tag1", "tag2"]
draft = false
[versions]
emacs = "28.1.50"
org = "release_9.5-532-gf6813d"
[[org_logbook]]
timestamp = 2022-04-08T14:53:00-04:00
note = """
This note addition prompt shows up on typing the `C-c C-z` binding.
See [org#Drawers](
https://www.gnu.org/software/emacs/manual/html_mono/org.html#Drawers)."""
[[org_logbook]]
timestamp = 2018-09-06T11:45:00-04:00
note = "Another note **bold** _italics_."
[[org_logbook]]
timestamp = 2018-09-06T11:37:00-04:00
note = "A note `mono`."
Thanks!
--
Kaushal Modi
[-- Attachment #2: Type: text/html, Size: 5828 bytes --]
next reply other threads:[~2022-05-03 10:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 10:57 Kaushal Modi [this message]
2022-05-03 13:09 ` Request to add tomelr package to GNU ELPA Stefan Monnier
2022-05-03 14:29 ` Kaushal Modi
2022-05-03 14:38 ` Stefan Monnier
2022-05-04 7:10 ` Robert Pluim
2022-05-04 13:02 ` Stefan Monnier
2022-05-05 18:36 ` Richard Stallman
2022-05-05 21:16 ` Kaushal Modi
2022-05-03 14:31 ` tomas
2022-05-03 16:07 ` João Pedro
2022-05-03 16:45 ` Kaushal Modi
2022-05-03 17:41 ` Stefan Monnier
2022-05-03 17:51 ` Kaushal Modi
2022-05-03 18:01 ` João Pedro
2022-05-03 21:39 ` Kaushal Modi
2022-05-03 22:41 ` Stefan Monnier
2022-05-03 22:56 ` Kaushal Modi
2022-05-03 23:02 ` Stefan Monnier
2022-05-04 0:40 ` Kaushal Modi
2022-05-04 2:10 ` Stefan Monnier
2022-05-04 2:37 ` Kaushal Modi
2022-05-04 12:40 ` Unable to get .elpaignore to work [Was: Request to add tomelr package to GNU ELPA] Kaushal Modi
2022-05-04 12:52 ` Kaushal Modi
2022-05-04 13:06 ` Kaushal Modi
2022-05-04 13:18 ` Stefan Monnier
2022-05-04 15:03 ` Stefan Monnier
2022-05-04 15:06 ` Kaushal Modi
2022-05-04 15:11 ` Stefan Monnier
2022-05-04 21:14 ` Kaushal Modi
2022-05-04 22:47 ` Request to add tomelr package to GNU ELPA Richard Stallman
2022-05-05 21:05 ` Kaushal Modi
2022-05-06 23:19 ` Richard Stallman
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='CAFyQvY3X5pJJPJgU1CWMKLhbLp8gPg9NarzUO=iek0phDuzvMQ@mail.gmail.com' \
--to=kaushal.modi@gmail.com \
--cc=emacs-devel@gnu.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.