Flibbles,

Once again a fantastic effort on your part to open tiddlywiki to even more 
possibilities. 

I had not even thought of turning such a tool to parsing html, I actually 
this could be very helpful because HTML can be pasted from elsewhere then 
tiddlywiki can interrogate it. It could actually be used to refactor html 
for subsequent export allowing tiddlywiki to refactor content from 
elsewhere, perhaps one day "screen scrape" content.

*You say this tool you are trying to name uses css selectors, but as I read 
it also allows html tags which arguable are part of css selectors. If the 
html was not setting class could you still extract say `<li></li>` am I 
correct?*

If what I say *is correct* perhaps you could name it after htmltags or 
xhtml for extract html, the fact you can use css selectors to focus the 
xhtml exhtml or what ever you call it is simply more power?

If what I say* is not correct *would it be difficult for you extend this 
tool to parse HTML inside tiddlers,? because this could be a great feature 
eg;

   - Extract content from html tables
   - Generate tiddlers from items listed on a html page
   - Parse then regenerate HTML
   - Capture HTML and extract data where no other export mechanism is 
   available.
   - Perhaps even screen scrape from a url to extract fresh data and 
   process in tiddlywiki.


Impressive work
Regards
Tony


On Monday, May 11, 2020 at 2:41:11 PM UTC+10, Flibbles wrote:
>
>
> Hey everyone!
>
> I'm working hard on the release version of tw5-xml, but I was hoping for 
> some final feedback on one last thing.
>
> On top of an <$xpath> widget, which parses XML with XPAath, I made another 
> widget which parses XML/HTML with css queries, like "div .classname". 
> Currently, it's called <$css>, but I'm not sure that's the right name. 
> (Maybe <$query>, or <$cssquery>, or <$selector>. Not sure yet. Would love 
> your feedback).
>
> Does this widget seem useful? Parsing through HTML is not as needed as 
> parsing XML, but there are some neat uses for it. For one, you can use 
> <$css> on XML, and <$xpath> on html. And you can use them both at one time. 
> i.e.
>
> <$xpath for-each="/document/text">
>
>
> !!Document
>
>
> <$css for=each=".classname > p" variable="paragraph">
>
> <<paragraph>>
>
> </$css>
> </$xpath>
>
>
> Other than xhtml embedded in XML, or for SVG, there isn't much need to use 
> both at once, but I thought it was nifty.
>
> It was only about 20 lines of extra code once I got everything organized 
> right, but I'm concerned this is outside the scope, or no one would need 
> this. Are there any of you who could use a widget/filter like this?
>
> The demo site is better filled out, and has examples of this new widget. 
> <https://flibbles.github.io/tw5-xml/>
>
> -Flibbles
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a2dabcb1-c6b7-444a-86e9-214eb9b31b58%40googlegroups.com.

Reply via email to