From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Request to add tomelr package to GNU ELPA Date: Tue, 3 May 2022 06:57:12 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008f592305de195f04" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9096"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 03 13:09:35 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlqPP-0002Bd-N6 for ged-emacs-devel@m.gmane-mx.org; Tue, 03 May 2022 13:09:35 +0200 Original-Received: from localhost ([::1]:38108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlqPO-0000Qb-HP for ged-emacs-devel@m.gmane-mx.org; Tue, 03 May 2022 07:09:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqDg-0008Md-OG for emacs-devel@gnu.org; Tue, 03 May 2022 06:57:29 -0400 Original-Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:53185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlqDe-0001Oo-De for emacs-devel@gnu.org; Tue, 03 May 2022 06:57:28 -0400 Original-Received: by mail-pj1-x1032.google.com with SMTP id e24so15003560pjt.2 for ; Tue, 03 May 2022 03:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=Xm8i0pyNc5R7c4K9bocXk5VAqa6C9xMT7Wtwa3pYWEg=; b=ArUMprLtWPgfK7QAnRacsJU2bvmDWniYG7ogFfWJ0cD1o+C5kG2LE670FHw+EDmJHZ +ml13asCUObo9G18o54z8HTD2UP2VKbR+JNC93CoeXyDYGmia1ggpin+0EdI65LRaBZ1 B+UjXDqu0JP8vXJE3VghUbIRz+BE1A0n7qVS2TJLP0QU2j6+KLApX7Y8DNg7eP1uiqy4 FPwTcdG5Rr0EZ1vUAoLk8LGrHF6zv9ArvzKswi2RZenP6vIKjpxB3ji2SEVYu4dYhRlN vY+6Z4rxG+WBspj+F85strs7oVRwIeg5EQiR1gK++LsMmrw0zwo5eJycZvSBkDTqHhzk a8zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Xm8i0pyNc5R7c4K9bocXk5VAqa6C9xMT7Wtwa3pYWEg=; b=NzQMMbJSmAOCvV//SS+jrju1LeqhA0jluUe8wgNez0/v119bWB/YjpBeQY36l0PjaV gZOYcXosDvzTl9bjw9FJ74nbk6UvHf7b6exs4EdPzUgmVVWNLTCcLDH3VtLiO5pRW2gx 6mKDnQRAySW/yBYosN9eBW+8FRhmrflqYi16jFmMhF8FF8DkcP7l1NbUsHMjur9/l1Ue OIkiFf/4nYqGiZU9FknVgiFL7VU0AZPZGrfXKIuNg/bZP5lyGCTgwoH7MuIGCUO+5JUL qaeeUlo3A6dTkrj8s+xi1fzdeJjSJH0yfMdhdFomlfQ9toIOC+ryaDJovHkCx05hq0Li J6bg== X-Gm-Message-State: AOAM5322UtYVaV1QozuGxXDhRZhTpA26gTTBz3IahqMkQyvZCFVWhPuT SBMs7HKlgsKt+iSMbNMm849089Q5wBQqqsD/uQtKgYV6 X-Google-Smtp-Source: ABdhPJzrIMFsZ9uey5XNTB7ZMyeU1tl8/1xBlqJL7kraCrtxNNaI1zILtdoUQ64zaIfoCbMoSBzR3jUwv/oEZf5a2GE= X-Received: by 2002:a17:902:e012:b0:15d:53:61ff with SMTP id o18-20020a170902e01200b0015d005361ffmr15867795plo.73.1651575442330; Tue, 03 May 2022 03:57:22 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=kaushal.modi@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289099 Archived-At: --0000000000008f592305de195f04 Content-Type: text/plain; charset="UTF-8" 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 --0000000000008f592305de195f04 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I hav= e been working on a small library very much inspired and reused from the co= re library json.el.=C2=A0

The library is called tomelr, and it does just one job: convert the input= lisp S-exp (alist or plist) to a TOML (see htt= ps://toml.io) config string.=C2=A0

Purpose: I plan to replace a lot of custom logic for TOML ge= neration in my ox-hugo package (Org mode to Markdown exporter for Hugo stat= ic site generator) with this dedicated and fully tested TOML generation lib= rary.=C2=A0

The source c= ode is at=C2=A0https://gi= thub.com/kaushalmodi/tomelr.


The README.org on the repo has a lot more details, bu= t here's a short example of what this library does:

** Alist data

'((title . "Some Title") ;String
<= div dir=3D"auto">=C2=A0 (author . ("fn ln")) ;List
=C2=A0 (description . "some long description\nthat spans mu= ltiple\nlines") ;Multi-line string
=C2=A0 (date= . 2022-03-14T01:49:00-04:00) ;RFC 3339 date format
=C2=A0 (tags . ("tag1" "tag2"))
=C2=A0 (draft . "false") ;Boolean
=C2=A0 (versions . ((emacs . "28.1.50") (org . &qu= ot;release_9.5-532-gf6813d"))) ;Map or TOML Table
=C2=A0 (org_logbook . (((timestamp . 2022-04-08T14:53:00-04:00) ;Array o= f maps or TOML Tables
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(note . "This note addition p= rompt 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).&= quot;))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 ((timestamp . 2018-09-06T11:45:00-04:00)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(note . "Another note **bold** _italics_."))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((= timestamp . 2018-09-06T11:37:00-04:00)
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(note . "A not= e `mono`.")))))

** = Plist data

'(:title = "Some Title" ;String
=C2=A0 :author ("= ;fn ln") ;List
=C2=A0 :description "some= long description\nthat spans multiple\nlines" ;Multi-line string
=C2=A0 :date 2022-03-14T01:49:00-04:00 ;RFC 3339 date= format
=C2=A0 :tags ("tag1" "tag2&qu= ot;)
=C2=A0 :draft "false" = ;Boolean
=C2=A0 :versions (:emacs "28.1.50= " :org "release_9.5-532-gf6813d") ;Map or TOML Table
=C2=A0 :org_logbook ((:timestamp 2022-04-08T14:53:00-04:00 = ;Array of maps or TOML Tables
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:note "This note addition pro= mpt shows up on typing the `C-c C-z` binding.\nSee [org#Drawers](htt= ps://www.gnu.org/software/emacs/manual/html_mono/org.html#Drawers).&quo= t;)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (:timestamp 2018-09-06T11:45:00-04:00
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:note "Another= note **bold** _italics_.")
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:timestamp 2018-09-06T11:37:00-04:0= 0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0:note "A note `mono`.")))
** TOML Output

You will get the below TOML output for either of the above = input data.

title =3D &q= uot;Some Title"
author =3D ["fn ln"]<= /div>
description =3D """
some long description
that spans multiple
lines"""
date =3D = 2022-03-14T01:49:00-04:00
tags =3D ["tag1"= , "tag2"]
draft =3D false
[versions]
=C2=A0 emacs =3D "28.1.50&quo= t;
=C2=A0 org =3D "release_9.5-532-gf6813d"= ;
[[org_logbook]]
=C2=A0 time= stamp =3D 2022-04-08T14:53:00-04:00
=C2=A0 note =3D = """
This note addition prompt shows u= p on typing the `C-c C-z` binding.
[[org_logbook]]
=C2=A0 timestamp =3D 2018-09-06T11:45:00-04:00
=C2=A0 note =3D "Another note **bold** _italics_."
[[org_logbook]]
=C2=A0 timestamp = =3D 2018-09-06T11:37:00-04:00
=C2=A0 note =3D "= A note `mono`."

Thanks!

--
Kaushal Modi
--0000000000008f592305de195f04--