Re: [twdev] How to transform HTML nodes to tiddler's tree?

2018-08-18 Thread bimlas
Thanks for the advice. I just found a way to transform HTML to node tree 
(?), now the plugin works nicely 
(screenshot: https://i.imgur.com/VMyePPW.png). I'll have to do some makeup, 
but basically everything seems to be OK. How should I do a pull request: 
using the plugins/tiddlywiki/asciidoctor is right or should I move under my 
own "namespace" (plugins/bimlas/asciidoctor)? Should I keep on my own repo 
without sending a PR, will you merge by yourself if you like the plugin?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/a7abd9cb-703e-4dfc-a8c3-9dccf27773b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] How to transform HTML nodes to tiddler's tree?

2018-08-17 Thread Jeremy Ruston
Hi Bimlas

> I'm working on a parser plugin to render Asciidoctor formated text.

Great!

> The plugin is using Asciidoctor.js 
> (https://github.com/asciidoctor/asciidoctor.js) and basically works, but the 
> content of the tiddler is the HTML code itself instead of the correctly 
> rendered text. For example if I creating a new tiddler with the content
> 
>   *bold* _italic_
> 
> then it's transforming to
> 
>bold italic 
> 
> when I save the tiddler. (screenshot: https://i.imgur.com/aHtHneJ.png)
> 
> As I looked in to the Markdown parser plugin, it seems that the Markdown.js 
> returns a HTML tree (thanks to JsonML). I assume my plugin should do the 
> same, but there is no option for this in Asciidoctor.js. How can I achieve 
> this? Is there a builtin method to transform HTML nodes to HTML tree or 
> should I use JsonML?

Your parser can return raw HTML by returning an object like this:

{type: "raw", html: }

The downside of returning raw HTML is that it makes it harder to support 
features like native TW links.

Best wishes

Jeremy

> 
> To try out:
> 
> * Clone https://github.com/bimlas/tiddlyWiki5/ and check out 
> `asciidoctor-plugin` branch, or simply download 
> https://github.com/bimlas/TiddlyWiki5/archive/asciidoctor-plugin.zip
> * Run `bin/serve.sh editions/full`
> * Press the second Markdown icon in the right panel (move the mouse over it, 
> the tooltip should be related to Asciidoctor)
> * Write `*bold* _italic_` in it and save the tiddler
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to tiddlywikidev+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywikidev@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywikidev 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywikidev/e223b36a-353e-43c2-aaef-72b72de34d92%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/D3F7DC53-7CCC-42C1-80BA-58E49361F27C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] How to transform HTML nodes to tiddler's tree?

2018-08-16 Thread bimlas
I'm working on a parser plugin to render Asciidoctor formated text.

The plugin is using Asciidoctor.js 
(https://github.com/asciidoctor/asciidoctor.js) and basically works, but 
the content of the tiddler is the HTML code itself instead of the correctly 
rendered text. For example if I creating a new tiddler with the content

  *bold* _italic_

then it's transforming to

   bold italic 


when I save the tiddler. (screenshot: https://i.imgur.com/aHtHneJ.png)

As I looked in to the Markdown parser plugin, it seems that the Markdown.js 
returns a HTML tree (thanks to JsonML). I assume my plugin should do the 
same, but there is no option for this in Asciidoctor.js. How can I achieve 
this? Is there a builtin method to transform HTML nodes to HTML tree or 
should I use JsonML?

To try out:

* Clone https://github.com/bimlas/tiddlyWiki5/ and check out 
`asciidoctor-plugin` branch, or simply download 
https://github.com/bimlas/TiddlyWiki5/archive/asciidoctor-plugin.zip
* Run `bin/serve.sh editions/full`
* Press the second Markdown icon in the right panel (move the mouse over 
it, the tooltip should be related to Asciidoctor)
* Write `*bold* _italic_` in it and save the tiddler

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/e223b36a-353e-43c2-aaef-72b72de34d92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.