Discussion:
[t2t] txt2tags and javascript
Forgeot Eric
2014-02-21 12:07:11 UTC
Permalink
Hello,

This message didn't reach the list last time I've sent it.Here is a new attempt.

There are some cool javascript tools out there, for example
http://epiceditor.com/, http://dillinger.io/ or http://lab.hakim.se/reveal-js (most of them are only markdown-friendly)

We would be able to use them if txt2tags had a javascript implementation like "Marked" for markdown: https://github.com/chjj/marked

I've tried to adapt some Creole js converter, but my javascript skills are quite limited.

Here are so far my tries:

https://github.com/farvardin/t2t.js
https://github.com/farvardin/jstxt2tags

Some syntax is missing, but since they are both based on very simple js code, it should be rather easy for someone fluent in js to finish the work.


Is someone here interested in working on this?
Little Girl
2014-02-22 02:04:41 UTC
Permalink
Hey there,
Post by Forgeot Eric
There are some cool javascript tools out there, for example
http://epiceditor.com/, http://dillinger.io/ or
http://lab.hakim.se/reveal-js (most of them are only
markdown-friendly)
We would be able to use them if txt2tags had a javascript
https://github.com/chjj/marked
I've tried to adapt some Creole js converter, but my javascript skills are quite limited.
https://github.com/farvardin/t2t.js
https://github.com/farvardin/jstxt2tags
Some syntax is missing, but since they are both based on very
simple js code, it should be rather easy for someone fluent in js
to finish the work.
Is someone here interested in working on this?
My JavaScript skills are not quite up to this, but I'd be happy to
test anything you or anyone else writes and give my feedback and
possibly be somewhat useful in debugging. (:
--
Little Girl

There is no spoon.
Florent Gallaire
2014-02-25 02:32:23 UTC
Permalink
Hello Eric,

I totally agree with you that a client-side rendering of txt2tags
would be great.
I don't think your two tries are really a base we could build on.

It seems to me that there is three "real" mardown implementation in javascript:
https://github.com/chjj/marked
https://github.com/evilstreak/markdown-js
https://github.com/coreyti/showdown

For different reasons the first looks clearly as the best.

Florent
Post by Little Girl
Hey there,
Post by Forgeot Eric
There are some cool javascript tools out there, for example
http://epiceditor.com/, http://dillinger.io/ or
http://lab.hakim.se/reveal-js (most of them are only
markdown-friendly)
We would be able to use them if txt2tags had a javascript
https://github.com/chjj/marked
I've tried to adapt some Creole js converter, but my javascript skills are quite limited.
https://github.com/farvardin/t2t.js
https://github.com/farvardin/jstxt2tags
Some syntax is missing, but since they are both based on very
simple js code, it should be rather easy for someone fluent in js
to finish the work.
Is someone here interested in working on this?
My JavaScript skills are not quite up to this, but I'd be happy to
test anything you or anyone else writes and give my feedback and
--
Little Girl
There is no spoon.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
--
FLOSS Engineer & Lawyer
Stephen Gibson
2014-02-25 03:33:59 UTC
Permalink
I hope not off-topic, but the application rednotebook
(http://rednotebook.sourceforge.net/) renders on screen using txt2tags.

Steve.
Post by Florent Gallaire
Hello Eric,
I totally agree with you that a client-side rendering of txt2tags
would be great.
I don't think your two tries are really a base we could build on.
https://github.com/chjj/marked
https://github.com/evilstreak/markdown-js
https://github.com/coreyti/showdown
For different reasons the first looks clearly as the best.
Florent
Post by Little Girl
Hey there,
Post by Forgeot Eric
There are some cool javascript tools out there, for example
http://epiceditor.com/, http://dillinger.io/ or
http://lab.hakim.se/reveal-js (most of them are only
markdown-friendly)
We would be able to use them if txt2tags had a javascript
https://github.com/chjj/marked
I've tried to adapt some Creole js converter, but my javascript
skills are quite limited.
https://github.com/farvardin/t2t.js
https://github.com/farvardin/jstxt2tags
Some syntax is missing, but since they are both based on very
simple js code, it should be rather easy for someone fluent in js
to finish the work.
Is someone here interested in working on this?
My JavaScript skills are not quite up to this, but I'd be happy to
test anything you or anyone else writes and give my feedback and
--
Little Girl
There is no spoon.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
Florent Gallaire
2014-02-25 12:05:27 UTC
Permalink
Hello Stephen,

The great RedNotebook is a heavyweight client, it uses txt2tags python
reference implementation.

Florent

On Tue, Feb 25, 2014 at 4:33 AM, Stephen Gibson
Post by Stephen Gibson
I hope not off-topic, but the application rednotebook
(http://rednotebook.sourceforge.net/) renders on screen using txt2tags.
Steve.
Post by Florent Gallaire
Hello Eric,
I totally agree with you that a client-side rendering of txt2tags
would be great.
I don't think your two tries are really a base we could build on.
https://github.com/chjj/marked
https://github.com/evilstreak/markdown-js
https://github.com/coreyti/showdown
For different reasons the first looks clearly as the best.
Florent
Post by Little Girl
Hey there,
Post by Forgeot Eric
There are some cool javascript tools out there, for example
http://epiceditor.com/, http://dillinger.io/ or
http://lab.hakim.se/reveal-js (most of them are only
markdown-friendly)
We would be able to use them if txt2tags had a javascript
https://github.com/chjj/marked
I've tried to adapt some Creole js converter, but my javascript
skills are quite limited.
https://github.com/farvardin/t2t.js
https://github.com/farvardin/jstxt2tags
Some syntax is missing, but since they are both based on very
simple js code, it should be rather easy for someone fluent in js
to finish the work.
Is someone here interested in working on this?
My JavaScript skills are not quite up to this, but I'd be happy to
test anything you or anyone else writes and give my feedback and
--
Little Girl
There is no spoon.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
--
FLOSS Engineer & Lawyer
Forgeot Eric
2014-02-25 20:07:38 UTC
Permalink
It seems marked is often choosen for rendering markdown, so I guess it's quite good. Yet, this library seems quite complicated. What is the reason? Is it for optimisation purposes?
Post by Florent Gallaire
I don't think your two tries are really a base we could build on.
https://github.com/farvardin/t2t.js/blob/master/t2t.js code is quite compact. Why wouldn't it be a good candidate?  It's only simple regex for parsing the code. 80 % of it is working, and I guess with some knowledge it could reach 100 % of the syntax.

This way, if it is released quickly, it would be able to adapt many markdown tools to our needs.

Being able to parse pre and postproc would be another matter. Of course it would be a nice addition too.








Le Mardi 25 février 2014 13h06, Florent Gallaire <***@gmail.com> a écrit :

Hello Stephen,

The great RedNotebook is a heavyweight client, it uses txt2tags python
reference implementation.

Florent

On Tue, Feb 25, 2014 at 4:33 AM, Stephen Gibson
Post by Florent Gallaire
I hope not off-topic, but the application  rednotebook
(http://rednotebook.sourceforge.net/) renders on screen using txt2tags.
Steve.
Post by Florent Gallaire
Hello Eric,
I totally agree with you that a client-side rendering of txt2tags
would be great.
I don't think your two tries are really a base we could build on.
https://github.com/chjj/marked
https://github.com/evilstreak/markdown-js
https://github.com/coreyti/showdown
For different reasons the first looks clearly as the best.
Florent
Post by Little Girl
Hey there,
Post by Forgeot Eric
There are some cool javascript tools out there, for example
http://epiceditor.com/, http://dillinger.io/ or
http://lab.hakim.se/reveal-js (most of them are only
markdown-friendly)
We would be able to use them if txt2tags had a javascript
https://github.com/chjj/marked
I've tried to adapt some Creole js converter, but my javascript
skills are quite limited.
https://github.com/farvardin/t2t.js
https://github.com/farvardin/jstxt2tags
Some syntax is missing, but since they are both based on very
simple js code, it should be rather easy for someone fluent in js
to finish the work.
Is someone here interested in working on this?
My JavaScript skills are not quite up to this, but I'd be happy to
test anything you or anyone else writes and give my feedback and
--
Little Girl
There is no spoon.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
--
FLOSS Engineer & Lawyer
Florent Gallaire
2014-02-25 21:04:45 UTC
Permalink
Post by Forgeot Eric
It seems marked is often choosen for rendering markdown, so I guess it's
quite good. Yet, this library seems quite complicated. What is the reason?
Is it for optimisation purposes?
1200 lines for a parser, it is far from complicated.
Post by Forgeot Eric
Post by Florent Gallaire
I don't think your two tries are really a base we could build on.
https://github.com/farvardin/t2t.js/blob/master/t2t.js code is quite
compact. Why wouldn't it be a good candidate? It's only simple regex for
parsing the code. 80 % of it is working, and I guess with some knowledge it
could reach 100 % of the syntax.
Only simple regex don't do a real parser. Aurelio could talk better
than me about that.

Florent
Post by Forgeot Eric
This way, if it is released quickly, it would be able to adapt many markdown
tools to our needs.
Being able to parse pre and postproc would be another matter. Of course it
would be a nice addition too.
Hello Stephen,
The great RedNotebook is a heavyweight client, it uses txt2tags python
reference implementation.
Florent
On Tue, Feb 25, 2014 at 4:33 AM, Stephen Gibson
Post by Florent Gallaire
I hope not off-topic, but the application rednotebook
(http://rednotebook.sourceforge.net/) renders on screen using txt2tags.
Steve.
Post by Florent Gallaire
Hello Eric,
I totally agree with you that a client-side rendering of txt2tags
would be great.
I don't think your two tries are really a base we could build on.
https://github.com/chjj/marked
https://github.com/evilstreak/markdown-js
https://github.com/coreyti/showdown
For different reasons the first looks clearly as the best.
Florent
Post by Little Girl
Hey there,
Post by Forgeot Eric
There are some cool javascript tools out there, for example
http://epiceditor.com/, http://dillinger.io/ or
http://lab.hakim.se/reveal-js (most of them are only
markdown-friendly)
We would be able to use them if txt2tags had a javascript
https://github.com/chjj/marked
I've tried to adapt some Creole js converter, but my javascript
skills are quite limited.
https://github.com/farvardin/t2t.js
https://github.com/farvardin/jstxt2tags
Some syntax is missing, but since they are both based on very
simple js code, it should be rather easy for someone fluent in js
to finish the work.
Is someone here interested in working on this?
My JavaScript skills are not quite up to this, but I'd be happy to
test anything you or anyone else writes and give my feedback and
--
Little Girl
There is no spoon.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
--
FLOSS Engineer & Lawyer
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list
--
FLOSS Engineer & Lawyer
Forgeot Eric
2014-04-30 13:25:44 UTC
Permalink
I finally managed to get txt2tags to work with javascript!

You can see it there:

http://wiki.txt2tags.org/demos/txt2tagsjs/txt2tagsjs-gui.html


It's not very clean, because I'm using this on top of a markdown parser (showdown), but it's good enough to be implemented for example for comments on a website, until someone make a better js converter :)

It's possible to get parsed an external t2t file, as you can see there:


http://wiki.txt2tags.org/demos/txt2tagsjs/sample_external_file.html
(the source: http://wiki.txt2tags.org/demos/txt2tagsjs/test.t2t )

This should work correctly:
 
- headings
- beautifulers (**bold**, //italic//, --strike-- and __underline__)
- Pre-Formatted Text, blockquote, code
- lists
 - comments
 
This doesn't work at all:
 
- macros
- preprocessor (preproc / postproc
)
- 3 lines header 
 
This could be improved:
 
- Tables 
(it seems difficult to parse)
- definition lists 
(only the title is supported)
- links (I still get some errors when multiple links are on the same line but we should find a solution soon)
- images (additions such as centering images, otherwise it works ok)
- some ordered **sublists** will be turned to unordered lists when you mix both types 
- we should finish to remove all specific markdown syntax, if possible



   Eric


ps : as a bonus, there is this markdown to txt2tags converter, which is also based on showdown: http://wiki.txt2tags.org/demos/txt2tagsjs/markdown2txt2tags/markdown2txt2tags.html
Continue reading on narkive:
Loading...