Oddball formats

57 views
Skip to first unread message

Rob

unread,
Aug 10, 2018, 11:49:25 AM8/10/18
to leo-editor
Perhaps this has been covered before, but I haven't been able to find relevant information in the docs or here on the forum (maybe not asking the right questions). Anyway, I sometimes will create and edit plain text data files using a defined syntax for data and delimiters. These formats are pretty obscure and likely of not enough interest for the Leo developers to create custom importers or syntax coloring files. Is there a relatively simple way to define the structures in @settings or a by-file directive? A few notable examples (there are others):

GIFT (a plain text format to create quiz questions to import into Moodle, an LMS)
ChordPro (a plain text music/lyric/tabs format)
M3U (music playlist)
Currently, I just use the @language plain directive, which sort of works, but isn't ideal. Ideas?

Rob...

Terry Brown

unread,
Aug 10, 2018, 12:31:32 PM8/10/18
to leo-e...@googlegroups.com
On Fri, 10 Aug 2018 08:49:25 -0700 (PDT)
Rob <lar...@gmail.com> wrote:

> Perhaps this has been covered before, but I haven't been able to find
> relevant information in the docs or here on the forum (maybe not
> asking the right questions). Anyway, I sometimes will create and edit
> plain text data files using a defined syntax for data and delimiters.
> These formats are pretty obscure and likely of not enough interest
> for the Leo developers to create custom importers or syntax coloring
> files. Is there a relatively simple way to define the structures in
> @settings or a by-file directive? A few notable examples (there are
> others):
>
> GIFT <https://docs.moodle.org/33/en/GIFT_format> (a plain text format
> to create quiz questions to import into Moodle, an LMS)
> ChordPro
> <https://www.chordpro.org/chordpro/ChordPro-File-Format-Specification.html>
> (a plain text music/lyric/tabs format)
> M3U <http://n4k3d.com/the-m3u-file-format/> (music playlist)
> Currently, I just use the @language plain directive, which sort of
> works, but isn't ideal. Ideas?
>
> Rob...

There's a mechanism for defining @auto-oddball @<file> readers and
writers. It *should* be in the docs. Can't find it there, but see

leo/plugins/importers/howto.txt

I assume that code's still working. I use a script for importing
reveal.js flavored markdown, where blank lines indicate outline level,
but it just runs on an @edit node and builds a @clean node from its
content.

Cheers -Terry

Edward K. Ream

unread,
Aug 21, 2018, 6:22:42 AM8/21/18
to leo-editor
On Fri, Aug 10, 2018 at 11:31 AM Terry Brown <terry...@gmail.com> wrote:

There's a mechanism for defining @auto-oddball @<file> readers and
writers.  It *should* be in the docs.  Can't find it there, but see

leo/plugins/importers
/howto.txt

I assume that code's still working. 

Yes, the code is about right, perhaps just a little out-of-date. The most important part of
/howto.txt is the part where it asks you to ask for help if needed ;-)

The importer;; abbreviation creates an outline (set of nodes) for a new importer.  The abbreviation asks you to fill in various <|xxx|> fields with the name of the language, etc.

Edward
Reply all
Reply to author
Forward
0 new messages