Tiddlywiki5: Feature Request: Import OPML file

Created on 31 May 2018  路  5Comments  路  Source: Jermolene/TiddlyWiki5

As mentioned here by @Jermolene, I think it would be incredibly useful to be able to import .opml files into TW.

Even if it just takes an outline and converts it to TW lists in one tiddler (as opposed to what @Jermolene recommended with separate tiddlers) I think it would be great!

Most helpful comment

The new version of the text-slicer plugin is intended to be a generic engine for cutting XML/XHTML documents into individual tiddlers. We should be able to use it to split any XML document: e.g BibTeX, OPML, RSS etc.

The existing text-slicer rulesets are all for parsing HTML but they give a general idea of the facilities:

https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/text-slicer/modules/rules

No doubt we'd encounter areas where text-slicer still needs to be extended, but I think it's a viable approach.

All 5 comments

On one hand perhaps the ability to convert it to JSON and become a data tiddler would be helpful, I am no expert but it looks quite simple,

on the other hand simply taking the text values it would be quite easy to convert it to tiddler titles with child tiddlers tagged by the parent tiddler, perhaps populating a parent field in the process (to avoid ambiguity with tags). This model could be reversed with a little more effort allowing common or standard "outlines" implemented in TiddlyWiki to export as basic OPML files (without bells and whistles)

Regards
Tony

Parsing OPML seems to be relatively simple: https://github.com/azu/opml-to-json The library code is small.

OPML spec: http://dev.opml.org/spec2.html

Creating OPML should already work out of the box with TW, since we are able to render HTML. OPML is just an other XML "subset". So is HTML. ... The only thing needed is a template, that creates the OPML output and a "parent"-"child" relation defined in tiddler fields. eg: https://wikilabs.github.io/editions/tocP/ Which creates a structure without the need for tags.

The new version of the text-slicer plugin is intended to be a generic engine for cutting XML/XHTML documents into individual tiddlers. We should be able to use it to split any XML document: e.g BibTeX, OPML, RSS etc.

The existing text-slicer rulesets are all for parsing HTML but they give a general idea of the facilities:

https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/text-slicer/modules/rules

No doubt we'd encounter areas where text-slicer still needs to be extended, but I think it's a viable approach.

@Jermolene, As this one and my previous bibtex issue should both be addressed by the changes to the text-slicer, do you think it would be useful to close both of them and open one centralized to the text-slicer improvements?

Was this page helpful?
0 / 5 - 0 ratings