The Wayback Machine - https://web.archive.org/web/20180610235555/https://github.com/tbayer/wikibrs
Skip to content
Tiny Python script to add line breaks to a text file before posting it as a wiki page
Python
Switch branches/tags
Nothing to show
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
License.md
README.wiki
wikibrs.py

README.wiki

A tiny Python script to convert a plaintext file into a MediaWiki wiki page (as wikitext), avoiding the issue that subsequent lines blend into one because MediaWiki treats newlines differently.

Basically, it adds "<br />" tags to the end of every line of the input file, except those where MediaWiki will keep the line break anyway when parsing it as wikitext (e.g. after a line that starts with "*").

I use it to publish notes taken on an Etherpad (exported from Etherpad as plaintext file) on Meta-wiki.

Usage: wikibrs.py inputfile.txt outputfile.txt

To avoid getting yourself into trouble when using this for Wikipedia articles, consider looking at the essay "Don't use line breaks" first ;)

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.