#1227 closed enhancement (fixed)

Conversion of HTML docs to .rst

Reported by: p-static Owned by: marlowe
Priority: minor Milestone: 1.9.0
Component: documentation Version: 1.8.0
Keywords: docs Cc: zooko
Launchpad Bug:

Description

Following the conversion of the text-based docs to reStructuredText, it would make sense for consistency's sake to convert all the HTML-based documentation as well. This would also make the HTML docs more useful for people browsing through the source on the command line.

There's one sticking point before I start working on this: URLs. We want to have links in the documents such that they work as expected in HTML, and do something useful in any other format we convert the docs to. There are a lot of ways we could go with this:

  • Have relative links that point to the rST versions of the docs. This is probably the least useful choice, because the HTML pages wouldn't work right.
  • Have relative links that point to the HTML versions of the docs. (This is what they do now.) Downside is that somebody looking at the rST version of the doc wouldn't actually be directed to a useful resource, and the links wouldn't work if the HTML version hadn't been generated yet.
  • Do some voodoo with the doc generation and convert the links. I'm not sure how much voodoo this would require; I think rST has some basic #define-style support for string substitution, but I'd have to try it out before knowing for sure that this option is feasible.
  • Have absolute links pointing to the latest version of the HTML doc in Trac's VCS viewer. This is slightly hackish, and means that users viewing an outdated version of the documentation won't see anything useful by default, but it also gives us useful links in any format that we choose to use.

No matter which option we choose, it's probably unavoidable that generated docs will have to be committed to source control. :( Links directly into Trac's VCS viewer are used heavily, and these ones are probably widely distributed - we should avoid breaking them if possible. (This is why people don't usually store user-facing documents in the VCS and distribute them from there :)

Attachments (2)

html-rst-conversion.patch (17.3 KB) - added by p-static at 2010-12-04T08:36:19Z.
add rST versions of the existing HTML docs (and also delete install.html, since it's unused)
html-doc-replacement.patch (57.1 KB) - added by p-static at 2010-12-04T08:36:41Z.
replace HTML docs with versions generated from rST

Download all attachments as: .zip

Change History (12)

comment:1 Changed at 2010-10-16T11:18:35Z by gdt

It seems that the voodoo option is best; I'm surprised rST doesn't already support this as it seems like an obvious thing to want to do.

I don't understand why generated docs have to be committed; that's usually necessary only when the tools to generate them are so painful to deal with that users of the VCS should be spared the trouble because that's worse than the pain of having to commit generated files.

comment:2 Changed at 2010-11-18T06:38:46Z by zooko

  • Owner changed from nobody to p-static

Here's a cool fact: trac will automatically render .rst files for you when viewed through trac, like this:

http://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/docs/configuration.rst

I believe github does something similar. I don't know about launchpad.

I think this means that relative links to .rst docs are the right answer. That makes it work for browsing with "less" locally and browsing with a web browser on trac/github, which are the two most important current use cases. In the future perhaps a clever .rst -> .html renderer could rewrite the links.

comment:3 Changed at 2010-11-18T10:01:24Z by p-static

Oh, excellent! Yeah, if we get HTML rendering for free like that, then direct links are perfect. :D

comment:4 Changed at 2010-12-01T20:10:36Z by davidsarah

  • Component changed from unknown to documentation
  • Keywords docs added

Changed at 2010-12-04T08:36:19Z by p-static

add rST versions of the existing HTML docs (and also delete install.html, since it's unused)

Changed at 2010-12-04T08:36:41Z by p-static

replace HTML docs with versions generated from rST

comment:5 Changed at 2010-12-04T08:39:59Z by p-static

The attached patches should be it for this bug. I separated it into two parts; it's up to you whether you want to use the second one, and keep generated HTML docs in the tree (would keep links from breaking), or just delete the HTML docs.

If we do want to keep the HTML docs in the tree, I should point out that they can be regenerated with rst2html from the python docutils library. It goes something like this:

rst2html < about.rst > about.html

comment:6 Changed at 2011-04-23T22:47:54Z by zooko

  • Cc zooko added

comment:7 Changed at 2011-04-23T23:07:39Z by davidsarah

  • Keywords review-needed added
  • Owner changed from p-static to marlowe

comment:8 Changed at 2011-04-24T01:03:48Z by marlowe

Recommend implementing html-rst-conversion.patch. I recommend deleting the HTML docs. We could create a README in the docs directory which would contain the instructions listed in comment 5 if they want generate the HTML files.

comment:9 Changed at 2011-05-10T19:24:00Z by zooko@…

In 299e8ad5795d3c22:

replace remaining .html docs with .rst docs
Remove install.html (long since deprecated).
Also replace some obsolete references to install.html with references to quickstart.rst.
Fix some broken internal references within docs/historical/historical_known_issues.txt.
Thanks to Ravi Pinjala and Patrick McDonald?.
refs #1227

comment:10 Changed at 2011-05-10T19:30:00Z by zooko

  • Keywords review-needed removed
  • Milestone changed from undecided to 1.9.0
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.