My favorites | Sign in
Logo
                
Search
for
Updated Dec 16, 2008 by aureliojargas
v3  
Ideas for the new version 3.0!

txt2tags v3

Time to rethink everything

The recent updates in the txt2tags development code (r41, r42, r44, r47, r52) has changed the resulting tagged code. These changes were necessary to make a saner line break behavior across targets. It may break some current postproc filters that used to rely on the old format.

Since the compatibility break is unavoidable (and necessary for evolution), now we have the rare opportunity to rethink everything and change things further, making an even bigger step towards quality.

The last jump has in 2004, when version 2.0 came out with many many improvements and new features.

This time we'll jump from 2.5 to 3.0 and lots of cool ideas are waiting to be matured and implemented.

Please read this list of ideas and leave a comment, telling your preferences. New ideas are also very welcome!

Proposed New Features

  1. Tagged mark, with optional target specification: '''html
  2. New mark for FootNotes
  3. Extended table syntax, allowing rowspan and blocks (such as lists) inside cells
  4. Improve the resulting code legibility, adding line breaks and spacing (breaks compatibility)
  5. Multiple target on the -t option: txt2tags -t txt,html,tex input.t2t
  6. Multiple target on the settings: %!options(html,xhtml,sgml): --toc
  7. New option --split to generate multiple pages from a single source
  8. New option --dump-tree (or something) to show the document structure (outline)
  9. Make UTF-8 the default encoding for the generated documents (if needed to specify one)
  10. Make the internal string handling 100% UTF-8 on the txt2tags code
  11. Use .html as the default XHTML file extension
  12. Distribution: change the tar.gz format to zip
  13. Some kind of plugin interface
  14. Improve the module interface
  15. Improve the PHP interface with Javascript and buttons for formatting (bold, quote, etc)
  16. New Mac interface
  17. Code compatible with Python3
  18. New %!exec command to execute external commands and insert the results on the document: %!exec: cat -n myapp.py (security implications)
  19. $HOME/txt2tags folder to store things: file history, command history, style files, includes, config, run count, allowed files for %!exec, alternative header templates, --split templates, plugins

New Name?

Maybe it's a good opportunity to improve the program name?

txt2tags is hard to pronounce and it is common to see it referred as t*e*xt2tags.

A new, simple name, could help the project to spread. Markdown is a killer name, maybe we could find something as strong and simple?

Proposed New HTML Features

Style:

  1. DIVs are added by default (obsolete --css-sugar)
  2. Clean tags with no attributes by default (obsolete --css-sugar)
  3. Default CSS on headers (simple and pretty) if no style was specified by user
  4. Better DIV names for the areas: #header, #main, #footer?, .toc
  5. No use for an automatic footer DIV, since there isn't a Footer Area on the sources
  6. Option --id (or something) to put an automatic unique id in every block (great for anchors, CSS and JavaScript): <table id="table1">
  7. Mark table columns to make it easy to style them <td class="col1"> or use colgroup
  8. Mark table row to make it easy to style them, like zebra: <tr class="odd">

Code:

  1. Move from TRANSITIONAL to STRICT
  2. Use lowercase tags
  3. Clean <HR> tag, no attributes
  4. Tags and contents on the same line: <p>...</p> to make filters (pre/postproc) easier
  5. Use only id= or class= on DIVs, not both (as today: <DIV CLASS="body" ID="body">)
  6. Remove A tag for anchors <A NAME="foo"><H2> and use id= attribute: <H2 id="foo">
  7. B/I/S/U versus STRONG/EM/DEL/, there is a strong reason to change?
  8. Prefer to use style= instead attributes for image: <IMG ALIGN="right" BORDER="0">
  9. Remove the ugly: <center><IMG ALIGN="middle" SRC="img.jpg" BORDER="0" ALT=""></center>
  10. Always close the tags: <li>...</li>
  11. Comment DIV closing to help filters and inspection: </div><!-- main -->

Features:

  1. P inside quote for consecutive quoted paragraphs <blockquote><p>...</p><p>...</p></blockquote>
  2. Or maybe just stick with <br><br> to separate the paragraphs
  3. Maintain or remove support for spaced list items? <p></p> is ugly, what's the right way?
  4. Map strong line ==== to simple ----? There is an use for it in HTML?
  5. How to expand the link mark to specify a description? <A TITLE="">
  6. How to expand the image mark to specify a description? <IMG TITLE="" ALT="">
  7. <br> make a mark for it or not?
  8. Any way to improve the default comment on footer? <!-- html code generated by txt2tags...
  9. Allow remote images URL inside image mark

Settings:

  1. Handy keywords to set HTML headers:
  2. %!script: foo.js
    %!favicon: foo.png
    %!author: Mr. John Doe
    %!keywords: surf, beach, wave, sun, summer
    %!description: This page is about surf.
    %!feed: http://feeds.feedburner.com/MyNews
  1. Or a more generic META keyword:
  2. %!meta: keywords surf, beach, wave, sun, summer
    %!meta: description This page is about surf.
    %!meta: verify-v1 d1EROlU9dwR+0/W9nLC+A6GgiD7VAyCxZtfnXsTRwQc=

Comment by eliasdorneles, Dec 10, 2008

> # B/I/S/U versus STRONG/EM/DEL/, there is a strong reason to change?

well, if you consider the users of screen readers, i think there is. b/i/s/u are strictly presentational elements, while the others are structure elements.

Comment by Zoom.Quiet, Dec 10, 2008

Markdown ? what means? .t2t is very good, so for fun and power ,i suggest: thought2tags things2tags thin2tags t2t=just make easy for publish idea with tags doc Sayeahoo?

Comment by stummjr, Dec 10, 2008

i think that the new latex-beamer target is a nice thing.

to improve it, i suggest to include multiple styles. something like: %!style: blue, wolverine, dark-green

it's quite useful to work with the themes provided by latex-beamer, since it has a color theme, a font theme and inner/outer theme. :)

btw, txt2tags is an amazing name!

Comment by szczudlik, Dec 10, 2008

I wouldn't change the name either. Love it, as it is. Btw, still I prounounce it "text to tags"

Comment by vecchi.b, Dec 11, 2008

Hi! I welcome the footnote feature! I would also like to see some sort of bibliography support! User could declare a .bib file, and when she wants to cite a reference, she'd say something like:

All your base are belong to us [someone2001].

Here, someone2001 should be a valid key in the provided .bib file.

I would also like an easy way to escape txt2tags parsing, to allow for inline inclusion of specific markup code. Let's suppose for now that the (()) characters do this, right? One might say:

And then some scientist came up with a very complicated formula: ((-tex-specific-complicated-formula-markup)).

This of course would be specific to one target, but the user will already be aware of that.

Thank you for txt2tags, Aurelio! I use it every day!

Comment by clairon, Dec 11, 2008

I would love seeing admonitions in Txt2tags. Juste like AsciiDoc? and restructured text.

I would also like to see new tag like :

align center : ">>> my text <<<<" align right : ">>> my text >>>"

Image legend would be cool as well.

Comment by otrocorreoinutil, Dec 11, 2008

I think that a "wiki" style output could be nice.

And also some tools to convert from output formats to txt2tags, but this is a lot of work :)

Thanks for txt2tags.

Comment by william.dowling, Dec 11, 2008

Python 3?

Zoom.Quiet: 'markdown' is the opposite of 'markup', and (as a native English speaker) I agree it's a killer name. One of the UNIX inventors was asked many years later if there was anything he would do differently if he could go back in time to write UNIX again. He said would have added an 'e' at the end of the system function 'creat'.

'text2tags'

Thanks to Aurelio!

Comment by aureliojargas, Dec 11, 2008

@elias: b/i/s/u are in fact presentational elements in txt2tags, not semantical, so we're fine.

@vecchi.b: Inline inclusion of specific markup code is already added to the development code, with the ''tagged'' mark. Example: First line.''<br>''Second line.

@otrocorreoinutil: Sorry, I didn't understood what you meat with "wiki style output". You weren't talking about the current wiki targets (Google Code, Wikipedia, MoinMoin?, DokuWiki?)?

@william.dowling: Python version 3 is incompabile with older versions. At some point in time we'll have to move to it. For years I think about adding the missing 'e' to the program name. This creat quote is a strong incentive, thanks! :)

Comment by eliasdorneles, Dec 11, 2008

about the $HOME/txt2tags, I think it's the greatest idea ever!

but I would make it a hidden directory, cause I don't feel comfortable with config files showing up on my $HOME. also, there are people who use their Desktop folder as $HOME, so I think it's not just me who would prefer that way. it could be configurable, at least, what do you think?

Comment by eliasdorneles, Dec 11, 2008

> Mark table columns to make it easy to style them <td class="col1"> or use colgroup

I would prefer the class approach instead of the colgroup, since it also makes it easier to get the elements with JS.

Comment by eliasdorneles, Dec 11, 2008

oh, I would love a plugin interface!! :) some way to add my own marks, allowing to easily code the processing of it... it would be just fantastically marvelous to have txt2tags extensible that way!

the latex-beamer, for example, could be implemented as a plugin, and could be mantained by someone else, taking the burden out of the main mantainer.

this would be simply perfect!

Comment by m...@celos.net, Dec 13, 2008

It might be nice to provide a syntax specifically for wiki-style links, since that's a common application. It can be translated directly into wiki targets, and labelled with a comment or null command in non-wiki targets (eg LaTeX, html) to allow easy manipulation with postproc. Obvious suggestion is double square-brackets:

[[pagename]]
[[page name with spaces]]

Might also be good to fix and document the API, so txt2tags can be an easy choice to call/embed in python applications needing markup.

Footnotes would be excellent, since they're common in some of the writing styles txt2tags is well suited to (technical documentation, reports, essays, and so on).

I think I'd prefer not to have built-in %!exec ability. There are plenty of safe and convenient ways to do machine-generated content already: better to have external programs generate the input files and/or call txt2tags than vice versa.

Comment by aureliojargas, Dec 16, 2008

Idea from Leonardo Rosa:

Use a default target (such as TXT or HTML) if none is specified by the user (instead of showing an error message)

Comment by griff.rees, Dec 16, 2008

clean the code. I love the project but it's pretty hackish and quite difficult to reuse in other applications.

I think the ideal for me would be to replicate as many standard latex environments as possible. I'm forced to drop into latex every time I want to cite, footnote, or use a glossary. Even cooler would be equation support, which switches to mathml, or latex automtically. Support for a verse environment, which I believe will be part of html5, would be nice, as would support for more semantic HTML tags like acronym.

+1 on plugin support, which would allow me to scratch my own itch. Something like a baseclass for a given syntax which can be modified to add new markup syntax, taking advantage of the special case of double characters on either side, bit having a more fundamental version which is as flexible as any python regex.

Comment by aureliojargas, Dec 16, 2008

@griff.rees: I completely agree that the code needs a clean up. I'll try to make it better for v3.

Comment by Zoom.Quiet, Dec 16, 2008

@aureliojargas less is more!

  • for name short is best them long;
  • for function realy strong support better then too more function but not stable;
so for t2t 3.0 , i hope :

- don't support more target(like Lout/PageMaker is usage less?!)
- make realy div covered HTML export,,, so CSS can realy made t2t export realy good,,because export HTML is thoe most in common use t2t!
- make more support for pop wiki engine (moinMoin/DokuWiki/Wikipedia) so t2t can usage middle doc for multi wiki !!!
Comment by vecchi.b, Jan 11, 2009

As previously suggested, image labeling would be great. Maybe something like:

[image1.jpg]
^^Figure: some figure of me^^

I don't know if that markup collapses with some other planned feature; i thought it would be intuitive for a table/image label since it seems to point up at the object being referred to.

Comment by dhajage, Jan 16, 2009

I would like :

  • docbook support (because a docbook document could be converted to odf, rtf... and many others not directly supported by text2tags)
  • table and image labeling ("|=" or "|+"
  • make anchor works every where (actually, just for titles)
  • make colspan works for latex (\multicolumn{\a}{text})
  • with preproc or postproc, \n is not matching, but it would be nice...

Example ("|+" is a numbered title table, "|=" is a non numbered title table) :

|| A | B | C 
| C | D | E 
|+ numbered title (and end of the table)
Comment by wjaguar.wj, Jan 17, 2009

I would like to have a direct way to override specific target tags and/or rules - the current way, by either using "%!postproc" or editing txt2tags source, is unnecessarily tortuous. Tags and rules are nothing but named entries in one hash or another - implementing "%!override" which assigns a new value to a name would cost a dozen lines at most, and make customizing the output many times easier.

Comment by obstriegel, Apr 19, 2009

I would like to convert things from some markup back to text2tags format. That would really be a nice feature, though I guess it requires a lot of work.

However this is a very useful program. Thanks for it!

Comment by esclinux, May 02, 2009

hello,

here are some suggestions and comments:

- About: $HOME/txt2tags

if possible, it should follow the freedesktop specifications which recommend to use the $(XDG_CONFIG_HOME) variable to store the configuration files (often into $HOME/.config/): http://freedesktop.org/wiki/Software/xdg-user-dirs

- About a new name, I like txt2tags but it's not really easy to pronunce or write (so many "t"s). Markdown is a "better" name, but if we can't find a better name for txt2tags it's probably better to stick with it.

- I'd like to see also a wiki or a forum where users could brainstorm and present theirs txt2tags configurations and tricks. For example I've made those lines for being able to add links to wikipedia:

%!preproc: '\[\[:([^ ].*?):([^ ].*?)\|([^ ].*?)\]\]' '\3[* http://\1.wikipedia.org/wiki/\2]'
%!preproc: '\[\[:([^ ].*?):([^ ].*?)\]\]' '\2[* http://\1.wikipedia.org/wiki/\2]'
%!preproc: '\[\[([^ ].*?)\]\]' '\1[* http://fr.wikipedia.org/wiki/\1]'

So [Borodine?] will link to the default French wikipedia page about Borodine, [[:fr:Edmond_Dulac?|Edmond Dulac]] will link to the French wikipedia page about Dulac (I have to explicitly specify :fr: here, otherwise the syntax will mix up, while [[:en:Lukas_Kandl?|Lukáš Kándl]] will lead to the English page about Lukáš Kándl. I had to :en:Lukas_Kandl? because txt2tags couldn't handle unicode names in links.

- Even if python is great, a php module which could handle the basic syntax of txt2tags (not the pre/processors macros of course but just the markup) could help the widespead of txt2tags. There are such modules for using the Markdown syntax into CMS or wiki: http://code.suckless.org/hg/genosite/ http://www.ohloh.net/tags/markdown/wiki

I'd like to be able to write directly txt2tags syntax into an online wiki or blog, and publish it into html. Most web hosters don't provide python but only php.

And I generally don't like to use the other wiki syntaxes at all (mediawiki, markdown), especially when I find the txt2tags syntax so clear and efficient.

- In addition, a markdown filter would be useful.

If the txt2tags code were more modular, we could propose such new syntax as an external module first, and then it could be included into the txt2tags core later.

- For example the txt2tags source code could be split into several modules:

- core syntax for html (the markup), this part could be converted into php for inclusion into other project - the basic html exports (meta tags, css, and code such as encoding="utf-8" etc) - the exportable part for latex, lout, mediawiki etc - the preproc / postproc and macro features - some use defined modules and plugins
Then a single txt2tags python file could be generated for redistribution.

- I fully agree with wjaguar.wj, Jan 17, 2009 ("a direct way to override specific target tags and/or rules")

- Add more control for using txt2tags with dynamic websites. For example using php include and such. We still can make our own rules, but it's less portable among users, for example I'm using:

%!postproc:  '@@include"([^ ].*?)"'  '<?\n   include("\1")\n ?>'

so the inclusion is made with @@include"myphppage.php" but other people may use something else.

- Correction of the \n in pre/postproc as proposed by dhajage, Jan 16, 2009

- Use strict html syntax. Use lower case html markup, I'd like that too. And most of the other proposals make sense too.

- I'd like to make or have a syntax highlight for the Geany software. A really cool feature is it can use a browser for listing CSS or C classes and such, and for txt2tags it could list the headers in the left panel, helping to create very long documents. ( example http://www.geany.org/images/geany_main.png? )

It seems it supports ctags / scintilla parser but I don't know anything about this. I've tried to adapt an already existing parser (restructured text and css), but it's difficult and doesn't work well.

(or another graphical editor supporting such a feature could be so great to edit long txt2tags texts, but geany is multiplateform, there is even a mac version on http://geany.darwinports.com/)

Good luck with programming all this!

Comment by esclinux, May 02, 2009

ps: I don't like google wiki syntax as well!! Everything is mixed up. And why can't we just edit our comments instead of deleting and copying it again with the modifications?

Comment by ilembitov, May 17, 2009

Hi! First of all, thanks for the great app! For me personally there are just a few things needed in order for txt2tags to become the best lightweight markup language that can easily replace AbiWord?:

-better support for paragraph styling. Center/right/left alighnment, first-line indent (for example, by adding a line in the settings section that would start every paragraph with a tab). -footnotes support. Really need to do references in my academic papers -rtf/doc/odt support for export. Would be really great to have at least RTF.

Comment by ilembitov, May 17, 2009

BTW, are there any plans for the 3.0 release date? At least estimated, of course I understand that I am likely to get a "when it's ready" answer here, but anyways.

Comment by aureliojargas, May 29, 2009

The answer I wanted to the release date is "it should already be done and released", but unfortunately, what I got now is "I have no idea, since there's still so much to do :("

Comment by jendrikseipp, Jul 23, 2009

I think it would be a good idea to drop some common txt2tags pitfalls such as requiring two blank lines after a list, but then again I don't know how many changes in the code that would require.

Comment by oliver.kurz955, Sep 16, 2009

I would suggest some other or additional marking for verbatim areas. '`' is not so easy to distinguish by the human eye in some fonts and also using the same tag for opening and closing a block might not be so easy to convert to other markup tags. Something like '' and '' in MoinWiki? is allowing unambiguous marking of inside and outside of a verbatim block.

Comment by oliver.kurz955, Sep 16, 2009

oops, didn't think about this wiki to have markup ;-) I meant, instead of

```

for opening and closing verbatim blocks, one should use the {{{ and }}} markups.

Comment by goathens, Oct 08, 2009

+1 on the "add your own markup" options.

+1 on the two blank lines after a list.


Sign in to add a comment
Hosted by Google Code