• text to HTML

    From Dale@dalekellytoo@gmail.com to comp.infosystems.www.authoring.html,comp.infosystems.www.authoring.stylesheets,alt.html on Thu Sep 10 06:30:01 2026
    From Newsgroup: alt.html


    Are there open source programs that convert a *.txt file into an HTML file?
    --
    Mystery? -> https://www.dalekelly.org/

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Michael Uplawski@michael.uplawski@uplawski.eu to comp.infosystems.www.authoring.html,comp.infosystems.www.authoring.stylesheets,alt.html on Thu Sep 10 18:30:39 2026
    From Newsgroup: alt.html

    Dale wrote in comp.infosystems.www.authoring.html,comp.infosystems.www.authoring.stylesheets,alt.html:


    Are there open source programs that convert a *.txt file into an
    HTML file?

    I cannot know, what you want to do, as your question is like rCLhow do
    I produce HTML?rCY

    But just for having named two systems that convert something into
    HTML:

    <https://rst2html5.readthedocs.io/en/latest/>
    <https://asciidoc.org/>

    You might want one of those or like to respond: rCLThat is not the
    text I have in mind.rCY

    In that case, PSE describe what you mean with *.txt.

    Cheerio

    f'up alt.html
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From JJ@jj4public@gmail.com to comp.infosystems.www.authoring.html,comp.infosystems.www.authoring.stylesheets,alt.html on Fri Sep 11 11:10:35 2026
    From Newsgroup: alt.html

    On Thu, 10 Sep 2026 06:30:01 -0400, Dale wrote:
    Are there open source programs that convert a *.txt file into an HTML file?

    The basic idea and minimal method to convert text to HTML, is to replace all `<` characters with `&lt;`. Then insert `<pre>` at start of the text, and append `</pre>` at the end of the text.

    The PRE HTML tag is required to preserve plain text formatting such as new lines, tabs, and series of spaces. Without the PRE HTML tag, the text would
    end up be displayed as a line wrapped very long text. If the original formatting of the text is not required, the PRE HTML tag is not required.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.infosystems.www.authoring.html,alt.html on Fri Sep 11 18:07:57 2026
    From Newsgroup: alt.html

    JJ <jj4public@gmail.com> wrote or quoted:
    The basic idea and minimal method to convert text to HTML, is to replace all >`<` characters with `&lt;`. Then insert `<pre>` at start of the text, and >append `</pre>` at the end of the text.

    Yes. Here's a Python script that reads a text and prints HTML.

    import html
    code = html.escape( input( "Text? " ))
    print( f"""
    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head><meta charset="UTF-8" /><title>Web Page</title></head><body> <pre>{code!s}</pre></body></html>
    """ )

    Transcript

    Text? <p>&amp;

    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head><meta charset="UTF-8" /><title>Web Page</title></head><body> <pre>&lt;p&gt;&amp;amp;</pre></body></html>

    Newsgroups: comp.infosystems.www.authoring.html,alt.html


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Helmut Richter@hr.usenet@email.de to comp.infosystems.www.authoring.html,comp.infosystems.www.authoring.stylesheets,alt.html on Fri Sep 18 13:59:55 2026
    From Newsgroup: alt.html

    On Thu, 10 Sep 2026, Dale wrote:

    Are there open source programs that convert a *.txt file into an HTML file?

    Of course, you need at least some markup to distinguish headlines or links
    from other text. Nearest to pure plain text is Markdown: paragraphs are just text blocks separated by empty lines and lists are defined by indentation rCo just the same syntax as you would use in plain-text emails. MarkdownrCOs syntax is described in https://daringfireball.net/projects/markdown/syntax#overview . I think this is what you can expect for such a tool.

    How to get Markdown see https://daringfireball.net/projects/markdown/ .

    --
    Helmut Richter
    --- Synchronet 3.22a-Linux NewsLink 1.2