|
From: Schimon J. <sc...@fe...> - 2025-10-10 11:59:05
|
Günter. Good afternoon. I have just had a new realization, consequent to your mention of CSV. On Fri, 10 Oct 2025 10:20:51 -0000 (UTC) Guenter Milde via Docutils-users <doc...@li...> wrote: > On 2025-10-10, Schimon Jehudah via Docutils-users wrote: > > >> > > >> >> The preamble [...] looks confusingly similar to > >> > > >> >> reStructuredtext directives. > > > Then, do you imply, by that statement, that it be a preferable > > practice for preambles to differ from reStructuredtext directives? > > I would have chosen a different syntax. > > However, considering the actual situation, I suggest keeping the > current syntax (maybe even reverting to use a semicolon). > I have changed preambles in accordance with The Atom Syndication Format, which the publishing project software "Rivista Voyager" focuses at. Applying CSV tables to preambles with multiple values would further allow, due to the built-in "csv" module of Python, to have a single function to handle different preambles, which would further allow to care for new attributes if needed. .. author: name,uri Schimon Jehudah Zachary , xmpp:sc...@pi...?message .. links: title,href,rel Metalinker.org - Why Metalink? , https://metalinker.org/why.html , related Metalinker: Integrating HTTP, FTP and P2P , https://torrentfreak.com/metalinker-integrating-http-ftp-and-p2p/ , related Metalink @ Packages Resources , http://metalink.packages.ro , related Shareaza Wiki , https://shareaza.sourceforge.net/mediawiki/Main_Page , related Gnutella2 Developer Network , https://g2.doxu.org , related Instead of spliting and counting and guessing of types of values of those preambles, those could be handled by this shorter code. import csv lines = csv_string.strip().split('\n') for i in csv.DictReader(lines): i Though, I would later solve how to retain values that include commas. "Quotation marks" do not solve this. Nevertheless, incorporating CSV is significantly better. > Günter > Schimon |