Re: What would YOU like to see in a txt to html converter?

2009-05-08 Thread Dotan Cohen
 I already thought of using dots or asterisks
 or whatever to let the user format the text instead of using html tags (this
 would be quite paradox ;-)


Then please do not invent another wheel. Write a markdown parser:
http://en.wikipedia.org/wiki/Markdown

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list


Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread Dotan Cohen
 As you might have mentioned I'm just working on a txt to html converter
 called thc. This project is intended for me to learn Python and now pyQT4
 to which I changed a few days ago (started with Tkinter).

 I have implemented the following features so far:

 - Giving a title for the html
 - Choose whether it's Transitional or Strict Doctype

Don't give this choice. What benefit does this give the user?

 - Select a background color
 - Show the converted file with the standard browser

That should probably be valid [X]HTML and be done with it.

 - Working on a font size slider

This should be a browser feature, not a page feature. Use the default
sizes of the HTML elements, and let the UA override those defaults as
the user sees fit ot configure it.

If you think that there should be a font size slider, then file a
feature request at the bug tracker of your favourite browser.

 I don't really know if this is of any use for anybody but it's just a fun
 project by a beginner :-)

 Now I'd like to know what kind of features you'd like to see in version 0.3
 of thc!?


You should probably convert the text to UTF-8 and make sure to declare
that with a meta tag.

You might want to look at markdown for a nice way to have hyperlink support.

Lists conversion, like these:
* item one
* item two
* item three

1. item one
2. item two
3. item three

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list


Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread norseman

Dotan Cohen wrote:

As you might have mentioned I'm just working on a txt to html converter
called thc. This project is intended for me to learn Python and now pyQT4
to which I changed a few days ago (started with Tkinter).

I have implemented the following features so far:

- Giving a title for the html
- Choose whether it's Transitional or Strict Doctype


Don't give this choice. What benefit does this give the user?


- Select a background color
- Show the converted file with the standard browser


That should probably be valid [X]HTML and be done with it.


- Working on a font size slider


This should be a browser feature, not a page feature. Use the default
sizes of the HTML elements, and let the UA override those defaults as
the user sees fit ot configure it.

If you think that there should be a font size slider, then file a
feature request at the bug tracker of your favourite browser.


I don't really know if this is of any use for anybody but it's just a fun
project by a beginner :-)

Now I'd like to know what kind of features you'd like to see in version 0.3
of thc!?



You should probably convert the text to UTF-8 and make sure to declare
that with a meta tag.

You might want to look at markdown for a nice way to have hyperlink support.

Lists conversion, like these:
* item one
* item two
* item three

1. item one
2. item two
3. item three



Actually I would like to see a good HTML to txt or odt converter. 
Perhaps someone you know has the time and inclination to make one.
In Unix, grep is a fantastic search tool.  Since HTML's today seem to be 
one page one file, trying to search a help collection for a phrase is 
useless in the practical sense.


I mean no offense to your effort. There are many who wish a good version 
of such a converter.  It's just that I personally wish HTMLs used for 
Help and Documentation were banned from the universe. To me, a well 
written, easily understood, no frills, fully grep'able text file that 
covers the subject well is a truly fantastic thing to be well cherished.



Steve
--
http://mail.python.org/mailman/listinfo/python-list


Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread Will Wang
 Florian == Florian Wollenschein florian.wollensch...@fernuni-hagen.de 
 writes:

Florian As you might have mentioned I'm just working on a txt to html 
converter called
Florian thc. This project is intended for me to learn Python and now 
pyQT4 to which I
Florian changed a few days ago (started with Tkinter).

Florian I have implemented the following features so far:

Florian - Giving a title for the html
Florian - Choose whether it's Transitional or Strict Doctype
Florian - Select a background color
Florian - Show the converted file with the standard browser
Florian - Working on a font size slider

Florian I don't really know if this is of any use for anybody but it's 
just a fun
Florian project by a beginner :-)

Florian Now I'd like to know what kind of features you'd like to see in 
version 0.3 of
Florian thc!?

Florian Please post them...

Florian Have fun!
Florian Listick
Florian http://www.lictick.org

You could learn something from emacs-muse. That plugin can help emacs to
convert txt to html, tex, pdf, docbook and some other document format.

In emacs-muse, the title and subtitle is defined like this:

*emphasis*
**strong emphasis**
***very strong emphasis***
_underlined_
=verbatim and monospace=

emacs-muse : http://mwolson.org/projects/EmacsMuse.html
--
http://mail.python.org/mailman/listinfo/python-list


Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread Florian Wollenschein

Will Wang wrote:

Florian == Florian Wollenschein florian.wollensch...@fernuni-hagen.de 
writes:


Florian As you might have mentioned I'm just working on a txt to html 
converter called
Florian thc. This project is intended for me to learn Python and now 
pyQT4 to which I
Florian changed a few days ago (started with Tkinter).

Florian I have implemented the following features so far:

Florian - Giving a title for the html
Florian - Choose whether it's Transitional or Strict Doctype
Florian - Select a background color
Florian - Show the converted file with the standard browser
Florian - Working on a font size slider

Florian I don't really know if this is of any use for anybody but it's 
just a fun
Florian project by a beginner :-)

Florian Now I'd like to know what kind of features you'd like to see in 
version 0.3 of
Florian thc!?

Florian Please post them...

Florian Have fun!
Florian Listick
Florian http://www.lictick.org

You could learn something from emacs-muse. That plugin can help emacs to
convert txt to html, tex, pdf, docbook and some other document format.

In emacs-muse, the title and subtitle is defined like this:

*emphasis*
**strong emphasis**
***very strong emphasis***
_underlined_
=verbatim and monospace=

emacs-muse : http://mwolson.org/projects/EmacsMuse.html


Thank you for this information. I already thought of using dots or 
asterisks or whatever to let the user format the text instead of using 
html tags (this would be quite paradox ;-)


Please keep on posting ideas...

Thanks again,
Listick
http://www.listick.org
--
http://mail.python.org/mailman/listinfo/python-list


Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread News123
Florian Wollenschein wrote:
 As you might have mentioned I'm just working on a txt to html converter
 called thc. This project is intended for me to learn Python and now
 pyQT4 to which I changed a few days ago (started with Tkinter).
 
 I have implemented the following features so far:
 
 - Giving a title for the html
 - Choose whether it's Transitional or Strict Doctype
 - Select a background color
 - Show the converted file with the standard browser
 - Working on a font size slider
 
 I don't really know if this is of any use for anybody but it's just a
 fun project by a beginner :-)
 
 Now I'd like to know what kind of features you'd like to see in version
 0.3 of thc!?
 
 Please post them...
 
 Have fun!
 Listick
 http://www.lictick.org

I would first think about your personal requirements / use cases.
What kind of texts do you want to convert?

I think there's already quite some text to html converters, which you
could take as inspiration.
Most of them were written for a specific purpose though and started from
text files with some 'formatting syntax'

Exanples:
man2html   converts man pages to html
pod2html   covnerts perl online documentation to html

There's also converters from certain wiki formats to html.

There's also source code formatters for certain programming languages
or log file to html converters which color certain message types


If it is just for plain text with no special formattings,
then you need probably only:
- escape all characters, which have to be escap for html. (but there is
probably already a function for it.
)
- seperate paragraphs (at double new lines or at single new lines. This
could be an option)

- additionally you could allow to specify a html prefix (before the
converted text) and a html post fix after the converted text.

- I would handle settings lik color / font size etc with style sheets
and not within the generated html. If you want you could autgenerate
style sheets from some function arguments. They could contain Font color
/ background color / font formatting . . . .

- you could add a configuration, that automatically tags certain words
with certain tags, to allow simle keyword hihglighting.


It all depends on your use case.





--
http://mail.python.org/mailman/listinfo/python-list


Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread Stefan Behnel
Florian Wollenschein wrote:
 Will Wang wrote:
 *emphasis*
 **strong emphasis**
 ***very strong emphasis***
 _underlined_
 =verbatim and monospace=

 emacs-muse : http://mwolson.org/projects/EmacsMuse.html
 
 Thank you for this information. I already thought of using dots or
 asterisks or whatever to let the user format the text instead of using
 html tags (this would be quite paradox ;-)

First thing I'd look at is actually docutils' RestructuredText (ReST).

Stefan
--
http://mail.python.org/mailman/listinfo/python-list