You are not logged in.

#1 2008-06-30 14:16:02

nsf
Member
From: Yekaterinburg, Russia
Registered: 2007-09-15
Posts: 160
Website

Terminal Markup Language

Hi, I have created a new (semi-new) terminal markup language. Its main purpose to serve as HTML for terminals. It's similar to groff, but with colors and much simpler.
Usage should be very simple (example is not real yet):

wget -O - http://somesite.com/page.tml | tml --output-for-less | less

The markup language itself looks like this:

This is a table test!
[table=3]
[c,width=10][align=c][color=m](*)[!color]
[c,width=100%][table=2][c,width=50%]hello[br]hi[c,width=50%]world[br]universe[!table]
[c,width=10][color=m](*)[!color][!align]
[!table]

The screenshot of converted bmpanel's site to tml (in less pager [cmdline: "./tml bmpanel.tml | less"]):
535524_bigthumb.png
The code is a mess currently (it's a prototype), but you can try it here: http://nsf.110mb.com/tml.tar.gz

Notes on compilation:
1. There is no Makefile, just run: g++ -O2 -o tml tml.cpp.
2. Tml has no deps, it need a gcc, glibc and a linux kernel.

Notes on run:
1. It's better to run it in a white on black terminal (e.g.: xterm -fg white -bg black)
2. Examples included, run like this: "./tml bmpanel.tml | less"
3. Only suitable for less pager!
4. Run tml with a single parameter, always! Else you get a segfault.
5. There are two examples shipped in tarball: test.tml and bmpanel.tml.
6. You can play with tml files, but it is likely that there are bugs in tml, so output may be screwed.

What I need?:
I'm looking for everyone who interested in this project as a developer. I wish to work on it in a team from the very beginning. If there is no one, Project is dead already.
I really hope that the developer will be also an archlinux user.

PS. If there are problems with compiling and running demo, please post it here, I'll try to solve them in a short period of time.

Thank you for your attention smile

Last edited by nsf (2008-06-30 14:18:59)


Bmpanel2 and obkey developer.

Offline

#2 2008-07-01 01:52:25

adekoba
Member
Registered: 2007-07-10
Posts: 128
Website

Re: Terminal Markup Language

that is pretty fricking cool!

a bit slow, though. I wonder if it's just the terminal or your program. Nonetheless, neat stuff.

edit: it appears to be less which is making it slower. When I run the app without less, it it very fast.

Last edited by adekoba (2008-07-01 01:53:29)


abcdefghijklmnopqrstuvwxyz

Offline

#3 2008-07-01 06:11:05

nsf
Member
From: Yekaterinburg, Russia
Registered: 2007-09-15
Posts: 160
Website

Re: Terminal Markup Language

Yes, the less is slow. A lot of GNU software is *slow*, but fast enough for lazy people who don't like to rewrite programms smile

ok, one more post about future perpectives of such project.

Q: Why do we need another terminal markup language? There are already a groff, man pages, vim help, etc.
A: Yes, there are a lot of them, but this one is general and human friendly. And it is designed to be a general markup language for kind of environment without graphics and with fixed glyph widths.

Q: Why do we need another feature-less HTML?
A: Because current HTML is a total mess. I think a lot of developers and sys admins don't even need to see pictures in their browsers. What a modern developer/admin really wants is an access to all neccessary information without problems (banners, ads, slow browsers, java scripts, fancy design things) and I think terminal interface is more than enough for that purpose. Anyway, it's not me who have started browsers like lynx, links, netrik, w3m. People need a lightweight solution for information presentation and here it is.

Q: You're freaking crazy, no one will use it!
A: Current appearance of this markup language is really useless, I agree. But what will be in future? The possible directions are:

0. The simplest target is a TML as the asciidoc output. The TML is almost ready for that I think.
1. TML as a HTML replacement. We will add links, forms, styles to the TML and the HTTP exists already. Also we will need a nice ncurses-based probably browser with good utf8 support. I hate slow browsers! So, let's just remove them from our lives! It is possible to create all forms of interactive web without 16 million colors and pictures/banners. Eventually such a browser can be piped with a lynx/links/w3m/whatever to emulate HTML in some cases.
2. TML as a man pages replacement. Wake up people! Man pages are old and not really comfortable. They have no colors! big_smile I think it's a time to make a good documentation system with a nice searching interface. I think it will be easy to write manpages-system to new-whatever-system converter. Even if a lot of people don't want to replace their man pages, we can create a concurent documentation system. I am a developer myself and I hate to run my dinosauric firefox (50+ megabytes in memory waste) to see what some function does. Even windows is much better with MSDN (ie is embedded in explorer.exe anyway) and CHM.
3. Technically the TML can evolve in all pretty print sort of things. I am always open to ideas and proposals.

Q: Ok, I like it! What can I do?
A: First of all few notes about language internals. The language is simple as it should be. There is a two kinds of stuff.
tag:
[<params>,<params>,<params>]
and plain text:
Hello, world! \[this is not a tag] smile

Tag can take as a params anything you want. Here is an example of tags: [br][br][!b][color=b][table=4][c,5][c,10][c,width=5,hr]
So it's simple as you can see. And it is possible to make it extensible.

There are a LOT of things to do:

0. Tokenizer and parser works fine I guess, but they are far from perfect in terms of speed. It works extremly fast, but it is the matter of technical perfection. Maybe a bad idea.
1. The output generator is horrible and perspectiveless. It doesn't support utf8 and it's probably buggy. I think a nice solution for generating output will be a generation of two dimension array of symbols with parameters. I mean something like:

struct symbol {
    int foreground_color;
    int background_color;
    int flags;
    wchar_t unicode;
};

And when such an array is generated with requested width, we can put it wherever we want. Slang, ncurses or plain console, or other app.
2. You can make some progress of the language evolution to one of the areas described above. (Add 'link' tag or other useful tags, write a browser, make a converter or an ouput target for a documentation system)
3. Play with language and report errors and ideas.

Well.. that's it. But I'll repeat myself. I don't want to work on this project alone. Because such a big project should have a lot of followers or else it's total crap and nobody really needs it. I spent for now only two days on this project and if it was a waste of time, it's not a big deal. But I don't want to spend a month+ without be sure that it is the useful project.

Feel free to give a link to this thread to everyone who might be interested in such an activity.

Last edited by nsf (2008-07-01 06:16:24)


Bmpanel2 and obkey developer.

Offline

#4 2008-07-01 09:39:13

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: Terminal Markup Language

Interesting. I always lack time, but I'll try to have a look at it. smile

Offline

#5 2008-07-01 10:04:50

faelar
Member
From: Amiens (FR)
Registered: 2007-12-18
Posts: 232
Website

Re: Terminal Markup Language

I don't know... I don't believe in TML as an HTML replacement. hmm
A common problem with most of web-sites is that people don't understand how things are supposed to be done. On a perfect site, you can disable CSS and JS, the only pictures remaining are the one used for the content (not for decoration purpose), so their description must be filled, and displayed in text mode.
I don't think HTML itself matter.

I'm more interested in TML as a man-pages replacement. Something fast, with colors to make it easier to read. But the most important part is the possibility to add links ! First, if it is used as a menu, you can skip right to the section that interest you. Then, you can link related command etc...

To summarise, I see TML as a light replacement for documentation, with some feartures of the HTML. smile

PS : Sorry I'm not skilled enough to provide any help for coding this project.

Offline

Board footer

Powered by FluxBB