Django

Code

Ticket #528 (reopened)

Opened 3 years ago

Last modified 2 months ago

Add a documentation generator that creates a PDF or HTML files locally

Reported by: anonymous Assigned to: Harkins
Component: Documentation Version: SVN
Keywords: sprintsept14, sprintpycon08 Cc: hv@tbz-pariv.de
Triage Stage: Accepted Has patch: 1
Needs documentation: 0 Needs tests: 0
Patch needs improvement: 0

Description

It would be nice to have doc generation script for making pdf or static html at local computer after each svn update.

Attachments

render_docs.py.diff (2.2 kB) - added by Harkins on 09/14/07 14:20:21.
Patch: a script to render HTML docs
render_docs.py.2.diff (3.2 kB) - added by programmerq on 01/13/08 20:24:46.
build_htmldocs-links_work-with_docs.diff (22.1 kB) - added by mrts on 03/21/08 18:21:53.
Patch that implements a management command for adding docs, with documentation.

Change History

09/19/05 11:31:02 changed by adrian

  • summary changed from docs generator to Add a documentation generator that creates a PDF or HTML files locally.

(follow-up: ↓ 18 ) 10/31/05 18:51:24 changed by adrian

  • priority changed from normal to lowest.
  • severity changed from normal to trivial.

01/17/07 22:46:08 changed by SmileyChris

  • stage changed from Unreviewed to Design decision needed.

03/09/07 05:56:52 changed by mtredinnick

  • stage changed from Design decision needed to Accepted.

This would be nice to have. A very low-priority enhancement.

05/19/07 19:11:03 changed by Marc Fargas <telenieko@telenieko.com>

Maybe the first needed thing is to have http://www.djangoproject.com/documentation/ as a .rst file in SVN (index.rst ?) it's currently a hardcoded template (djangoproject.com/django_website/templates/docs/index.html). Could the index page be moved to an .rst?

05/19/07 19:40:46 changed by Marc Fargas <telenieko@telenieko.com>

#1527 has been marked as a duplicate of this ticket. That one provides a Makefile that calls rst2html.py for every file in docs/ in case you want it ;)

08/26/07 17:56:00 changed by adrian

I've started working on this in my spare time.

09/05/07 07:06:31 changed by anonymous

FYI: I've just done a similar thing for my own projects (some of this information might be useful to you). I'm using MoinMoin? as my wiki and it has a plugin for PDF creation that uses htmldoc as the pdf generator. It provides a really nice interface and works like a dream.

I wrote a small python script in my build system that simply got the web pages with the 'CreatePdf?' action (ie after calling the wiki macro to create a PDF) and wrote it to a file which I zip up into my release.

The macro (and info) is here: http://moinmo.in/ActionMarket/PdfAction

Hope this helps :) - Tushar.

09/14/07 09:22:13 changed by Harkins

  • owner changed from nobody to Harkins.
  • status changed from new to assigned.

Claiming #528 and #4940 for Sprint14Sep.

09/14/07 14:20:21 changed by Harkins

  • attachment render_docs.py.diff added.

Patch: a script to render HTML docs

09/14/07 14:22:29 changed by Harkins

  • has_patch set to 1.

The script I've created does not produce especially beautiful output, but the basic basic functionality is there to render the Django doc dir into one large HTML doc or many small HTML docs with an index.

09/14/07 15:45:44 changed by Harkins

  • keywords set to sprintsept14.

09/14/07 21:59:45 changed by ubernostrum

Marked #4940 as a duplicate.

10/09/07 03:12:16 changed by Thomas Güttler <hv@tbz-pariv.de>

  • cc set to hv@tbz-pariv.de.

10/10/07 09:11:24 changed by Thomas Güttler <hv@tbz-pariv.de>

  • stage changed from Accepted to Ready for checkin.

+1

if you want to improve the documenation, you need some way to check the wiki syntax before you create a patch.

the patch render_docs.py.diff works for me. It think it is ready for check in (it can't break anything).

(follow-up: ↓ 19 ) 10/20/07 09:11:02 changed by mtredinnick

  • needs_better_patch set to 1.
  • stage changed from Ready for checkin to Accepted.
  • needs_docs set to 1.

This isn't ready to check in.

  • There should be practically no executable code at the top level. In other words, importing the file should not execute it. At least a main() function and if __name__ == '__main__': guard are required.
  • The imports should conform to PEP 8 style guidelines.
  • If you don't have docutils installed (which will be noticable in the import section), a helpful error message would be good, since docutils don't come by default with Python.

If somebody wants to take this further, it's probably worth checking in with Adrian (see comment 7) to find out where he's up.

01/13/08 20:24:46 changed by programmerq

  • attachment render_docs.py.2.diff added.

01/14/08 03:28:03 changed by programmerq

  • needs_better_patch deleted.
  • needs_docs deleted.

I wrote a small bit of documentation and did the requested things for improving the patch.

01/22/08 19:57:42 changed by ramiro

Apparently #6443 was created to suggest pisa from http://www.htmltopdf.org/ for conversion from HTML to PDF. I've closed it as duplicate of this and added the relevant info here.

(in reply to: ↑ 2 ) 02/03/08 04:30:42 changed by anonymous

  • status changed from assigned to closed.
  • needs_better_patch set to 1.
  • component changed from Documentation to Template system.
  • needs_tests set to 1.
  • version set to 0.95.
  • needs_docs set to 1.
  • resolution set to worksforme.
  • stage changed from Accepted to Unreviewed.

Replying to adrian:

(in reply to: ↑ 15 ) 02/03/08 04:31:48 changed by anonymous

  • version changed from 0.95 to other branch.

Replying to mtredinnick:

This isn't ready to check in. * There should be practically no executable code at the top level. In other words, importing the file should not execute it. At least a main() function and if __name__ == '__main__': guard are required. * The imports should conform to PEP 8 style guidelines. * If you don't have docutils installed (which will be noticable in the import section), a helpful error message would be good, since docutils don't come by default with Python. If somebody wants to take this further, it's probably worth checking in with Adrian (see comment 7) to find out where he's up.

02/03/08 04:56:48 changed by Simon Greenhill <dev@simon.net.nz>

  • status changed from closed to reopened.
  • component changed from Template system to Documentation.
  • needs_tests deleted.
  • version changed from other branch to SVN.
  • needs_docs deleted.
  • resolution deleted.
  • stage changed from Unreviewed to Accepted.

This ain't a toy, sparky.

03/20/08 17:00:21 changed by mrts

I've created a somewhat more extended version of this that produces output that looks very similar to real Django documentation. See DjangoSpecifications/Docs/ConvertingRestToOtherFormats for overview, screenshots and patch.

03/21/08 04:18:56 changed by mrts

  • keywords changed from sprintsept14 to sprintsept14, sprintpycon08.
  • needs_better_patch deleted.
  • stage changed from Accepted to Ready for checkin.

03/21/08 04:55:26 changed by mtredinnick

  • stage changed from Ready for checkin to Accepted.

Not ready-for-checkin, since there doesn't appear to be any single patch to checkin, it's a large change if it's the thing you've posted to that above URL, so needs careful review by somebody other than yourself, plus, as Jacob mentioned, he's also working on a toolchain, so he'll possibly want to take bits and pieces of both approaches.

03/21/08 18:18:17 changed by mrts

Posting the final patch attached to the wiki page here as well to avoid confusion (re: there doesn't appear to be any single patch to checkin).

03/21/08 18:21:53 changed by mrts

  • attachment build_htmldocs-links_work-with_docs.diff added.

Patch that implements a management command for adding docs, with documentation.


Add/Change #528 (Add a documentation generator that creates a PDF or HTML files locally)




Change Properties
Action