Does anyone know of an easy way to improve the readability of raw text files in the browser? I'm writing a novel using github and the raw text file output looks very ugly in the browser, even using things like readability [1].
It's easy to convert a static text file into something more readable, but I can't seem to find a solution for a dynamic text file at a static address.
Make sure your text files are readable in the first place (line length, paragraph length, etc.).
Chose a readable font. Text files are shown with the browser default monospace font, but you change it to whatever you like best.
I think there is not much else you can do with raw text files in the browser. The next level would be to write in something like markdown and view the processed text, I think.
I've been trying to avoid adding manual line breaks to the text file because in prose, unlike code or poetry, line breaks are presentation, not content.
I suppose I could try to write something that scrapes the text file, adds <p> tags around paragraphs and presents it with some really basic CSS. I don't know how to code, but I might try cobbling something together.
You could alternatively use an online markdown editor (such as http://markdown.pioul.fr/). It'll wrap your paragraphs in <p> tags.
Additionally, since it uses the Markdown syntax, it might give you more than paragraphs if you use more than line breaks. (Have a look at the quick reference for more about the syntax.)
Edit: Didn't see your answer to @kybernetikos. I still think this could help you out. Also note that in HTML (what you'll get by adding <p> tags to your text), whitespace is collapsed (except inside <pre> tags)
Instead of writing a converter yourself you could try to use Markdown on your files without modification and see how well it does. The design goal of Markdown is:
Markdown allows you to write using an easy-to-read,
easy-to-write plain text format, then convert it to
structurally valid XHTML (or HTML).
The styling applied there really clashes with the explicit breaks in the story text. Anyway, that gets you down to one click each time you want to review the text file, which is maybe still more than you want.
Now write your novel in markdown in an index.md file. Every time you check in github will render a nice html file for you that's easy to read, but your source remains easy to write and diff since it's just markdown.
I had exactly that problem, although use of text-indent in the css meant that every paragraph starts indented, so you just make each line of dialogue a new paragraph and it works out ok. So yes, it's not ideal, but it's still pretty good.
It's easy to convert a static text file into something more readable, but I can't seem to find a solution for a dynamic text file at a static address.
[1] http://readability.com/