Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.html > #24219 > unrolled thread

text to HTML

Started byDale <dalekellytoo@gmail.com>
First post2026-09-10 06:30 -0400
Last post2026-09-18 13:59 +0200
Articles 5 — 5 participants

Back to article view | Back to alt.html


Contents

  text to HTML Dale <dalekellytoo@gmail.com> - 2026-09-10 06:30 -0400
    Re: text to HTML Michael Uplawski <michael.uplawski@uplawski.eu> - 2026-09-10 18:30 +0200
    Re: text to HTML JJ <jj4public@gmail.com> - 2026-09-11 11:10 +0700
      Re: text to HTML ram@zedat.fu-berlin.de (Stefan Ram) - 2026-09-11 18:07 +0000
    Re: text to HTML Helmut Richter <hr.usenet@email.de> - 2026-09-18 13:59 +0200

#24219 — text to HTML

FromDale <dalekellytoo@gmail.com>
Date2026-09-10 06:30 -0400
Subjecttext to HTML
Message-ID<117u0ra$1tdh2$1@dont-email.me>
Are there open source programs that convert a *.txt file into an HTML file?

-- 
Mystery? -> https://www.dalekelly.org/

[toc] | [next] | [standalone]


#24220

FromMichael Uplawski <michael.uplawski@uplawski.eu>
Date2026-09-10 18:30 +0200
Message-ID<AABqotsvIOQAAAeW.A3.flnews@ferrat.uplawski.eu>
In reply to#24219
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 “how do
I produce HTML?”

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: “That is not the
text I have in mind.”

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

Cheerio

f'up alt.html

[toc] | [prev] | [next] | [standalone]


#24221

FromJJ <jj4public@gmail.com>
Date2026-09-11 11:10 +0700
Message-ID<yoap1r4ofkkb.17tm3s9aihvuq.dlg@40tude.net>
In reply to#24219
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.

[toc] | [prev] | [next] | [standalone]


#24222

Fromram@zedat.fu-berlin.de (Stefan Ram)
Date2026-09-11 18:07 +0000
Message-ID<script-20260911190721@ram.dialup.fu-berlin.de>
In reply to#24221
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

[toc] | [prev] | [next] | [standalone]


#24223

FromHelmut Richter <hr.usenet@email.de>
Date2026-09-18 13:59 +0200
Message-ID<c7463da2-59f2-d0be-2b54-d88572f7b0bb@email.de>
In reply to#24219
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 –
just the same syntax as you would use in plain-text emails. Markdown’s 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

[toc] | [prev] | [standalone]


Back to top | Article view | alt.html


csiph-web