emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Request to add tomelr package to GNU ELPA


From: Kaushal Modi
Subject: Request to add tomelr package to GNU ELPA
Date: Tue, 3 May 2022 06:57:12 -0400

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]