What's the Name of the Python Module that Formats arbitrary Text to nicely looking HTML?

A while ago I came across a Python library that formats regular text to HTML similar to Markdown, reStructuredText and Textile, just that it had no syntax at all. It detected indentatations, quotes, links and newlines/paragraphs only.

Unfortunately I lost the name of the library and was unable to Google it. Anyone any ideas?

Edit: reStructuredText aka rst == docutils. That's not what I'm looking for :)

Asked by: Edgar519 | Posted: 28-01-2022

Answer 1

Okay. I found it now. It's called PottyMouth.

Answered by: Dainton924 | Posted: 01-03-2022

Answer 2

Markdown in python is a python implementation of the perl based markdown utility.

Markown converts various forms of structured text to valid html, and one of the supported forms is just plain ascii. Use is pretty straight forward.

python markdown.py input_file.txt > output_file.html

Markdown can be easily called as a module too:

import markdown
html = markdown.markdown(your_text_string)

Answered by: Lucas669 | Posted: 01-03-2022

Answer 3

Sphinx is a documentation generator using reStructuredText. It's quite nice, although I haven't used it personally.

The website Hazel Tree, which compiles python text uses Sphinx, and so does the new Python documentation.

Answered by: Emma886 | Posted: 01-03-2022

Similar questions

python string formatting from list with arbitrary item

I want to do a string formatting with a list as showed below: (pseudocode) down_url = [url1, url2, ..., urln] url = "download: %s" % down_url Yes, the list down_url has arbitrary items, and I want to get all the items from it. The result I want is: download: url1, url2, ..., urln I hope you can understand what I have e...

formatting - How do I format a number in python with k for thousand etc for arbitrary preffix symbols?

This question already has answers here:

String formatting in Python

This question already has answers here:

Python 3: formatting zip module arguments correctly (newb)

Please tell me why this code fails. I am new and I don't understand why my formatting of my zip arguments is incorrect. Since I am unsure how to communicate best so I will show the code, the error message, and what I believe is happening. #!c:\python30 # Filename: backup_ver5.py import os import time import zipfile source = r'"C:\Documents and Settings\Benjamin Serrato\My Documents\python\backup_list"'...

python - keeping same formatting for floating point values

I have a python program that reads floating point values using the following regular expression (-?\d+\.\d+) once I extract the value using float(match.group(1)), I get the actual floating point number. However, I am not able to distinguish if the number was 1.2345678 or 1.234 or 1.2340000. The problem I am facing is to print out the floating point value again, with the exact same...

format - String formatting in Python version earlier than 2.6

When I run the following code in Python 2.5.2: for x in range(1, 11): print '{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x) I get: Traceback (most recent call last): File "<pyshell#9>", line 2, in <module> print '{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x) AttributeError: 'str' object has no attribute 'format' I don't understand the pr...

floating - python formatting float numbers

my input is 3.23, but when I use float on it, it becomes 3.2, when my input is 3.00, when I do float on it, it becomes 3.0 when I convert to float from string, I still want it to be 3.00 and not 3.0 is it possible? I want to know the code to make it possible, and when I am doing a problem in which the decimal point till 2 digits matter, 3.23 is better than 3.2, for more precision

python - Formatting output when writing a list to textfile

i have a list of lists that looks like this: dupe = [['95d1543adea47e88923c3d4ad56e9f65c2b40c76', 'ron\\c', 'apa.txt'], ['95d1543adea47e88923c3d4ad56e9f65c2b40c76', 'ron\\c', 'knark.txt'], ['b5cc17d3a35877ca8b76f0b2e07497039c250696', 'ron\\a', 'apa2.txt'], ['b5cc17d3a35877ca8b76f0b2e07497039c250696', 'ron\\a', 'jude.txt']] I write it to a file using a very basic function():

python - Formatting with mako

Anyone know how to format the length of a string with Mako? The equivalent of print "%20s%10s" % ("string 1", "string 2")?

Formatting cells in Excel with Python

How do I format cells in Excel with python? In particular I need to change the font of several subsequent rows to be regular instead of bold.

python - Formatting a variable in Django and autofields

I have this problem I've been trying to tackle for a while. I have a variable that is 17 characters long, and when displaying the variable on my form, I want it to display the last seven characters of this variable in bold...how do I go about this...I'd really appreciate anybody's insight on this.

python - Formatting date times provided as strings in Django

In my Django application I get times from a webservice, provided as a string, that I use in my templates: {{date.string}} This provides me with a date such as: 2009-06-11 17:02:09+0000 These are obviously a bit ugly, and I'd like to present them in a nice format to my users. Django has a great built in date formatter, which would do exactly what I wanted:

Still can't find your answer? Check out these communities...

PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python