Closed Bug 963120 Opened 12 years ago Closed 12 years ago

Allow extensions to document themselves, and build result into docs

Categories

(Bugzilla :: Documentation, enhancement)

4.5.1
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: gerv, Assigned: gerv)

Details

Attachments

(1 file, 1 obsolete file)

We should have a mechanism whereby extensions can put a .rst file in their top-level directory which explains the extension, and we find those and build them into an "Extensions" chapter at the end of the documentation. Gerv
Let's first see if someone works on this before targetting the bug.
Severity: normal → enhancement
Target Milestone: Bugzilla 5.0 → ---
Attached patch Patch v.0.1 (obsolete) — Splinter Review
Here's one way to do it. Asking for review because it seems the Bugzilla product doesn't have the "feedback?" flag for attachments. I'm looking for feedback on my general approach here. I think it's probably hard to get Sphinx to look for .rst documents outside the tree which has conf.py at the top, so I elected to use makedocs.pl to copy them in to docs/en/rst/extensions/ instead. Each extension can have one .rst file, and it will be included as a subsection in a new "Extensions" top-level section. I suspect I will need to replace the "find" command with a cross-platform solution, if we want it to build on Windows. Gerv
Assignee: documentation → gerv
Status: NEW → ASSIGNED
Attachment #8365309 - Flags: review?(LpSolit)
Comment on attachment 8365309 [details] [diff] [review] Patch v.0.1 >=== modified file 'docs/en/rst/index.rst' > customization > troubleshooting >+ extensions > patches I think the order should be changed to extensions - customization - patches - troubleshooting. >=== modified file 'docs/makedocs.pl' >+ system("find ../../extensions -name '*.rst' -exec cp {} rst/extensions \\;"); You should use File::Find and File::Copy instead of system(). Both modules are in the core distribution of Perl. >=== added file 'extensions/Voting/voting.rst' Documentation should go into extensions/Voting/doc/voting.rst. This would let an extension author add more documentation without polluting the root directory. >+Here are some sample extension docs, for the voting extension. Please write real documentation, or do it for the Example extension only. In all cases need the Example extension such a file.
Attachment #8365309 - Flags: review?(LpSolit) → review-
(In reply to Frédéric Buclin from comment #3) > Documentation should go into extensions/Voting/doc/voting.rst. And voting.rst should probably be renamed to something more standard, like help.rst or documentation.rst or tutorial.rst or something similar.
Target Milestone: --- → Bugzilla 5.0
(In reply to Frédéric Buclin from comment #4) > And voting.rst should probably be renamed to something more standard, like > help.rst or documentation.rst or tutorial.rst or something similar. If all the tutorial docs are all going to be copied into the extensions/ directory, then they all need to have different names. So the best rule is to have the doc named after the extension. I think it's OK to require that each extension only use a single .rst file. This means we can avoid issues with name clashes. And it means we don't need a doc/ subdir for a single file. Gerv
(In reply to Gervase Markham [:gerv] from comment #5) > If all the tutorial docs are all going to be copied into the extensions/ > directory, then they all need to have different names. In that case, you shouldn't blindly copy everything with the .rst extension. You should enforce to use the exact same name as the extension itself. > I think it's OK to require that > each extension only use a single .rst file. This means we can avoid issues > with name clashes. And it means we don't need a doc/ subdir for a single > file. As an extension author, I could write additional documentation, such as .txt, .pdf or .html, etc... It's a good practice to not put all the documentation in root directory. Once extension authors see the doc/ directory, they will start putting their doc there. You should also fix extensions/create.pl to create such a default doc/$ext_name.rst file.
Using makedocs.pl to assemble the docs means that the docs on bugzilla.readthedocs.org won't have documentation for any extensions, including those shipped with Bugzilla. Is this acceptable? If not, we could perhaps do something with symlinks, having symlinks there by default for the shipped extensions, and having makedocs.pl add new symlinks if it finds new extensions. Not sure if this would work on Windows, though. LpSolit/mcote: what do you think? Gerv
(In reply to Gervase Markham [:gerv] from comment #7) > If not, we could perhaps do something with symlinks, having symlinks there > by default for the shipped extensions, and having makedocs.pl add new > symlinks if it finds new extensions. Not sure if this would work on Windows, > though. > > LpSolit/mcote: what do you think? I'm not sure it will work on Windows either. So if I understand correctly, RTD doesn't run makedocs.pl itself, it runs Makefile directly? About extensions, it's fine to omit them from RTD. Extensions are disabled by default, and so probably most installations do not use them.
RTD doesn't run makedocs.pl, and it doesn't run the Makefile. It runs Sphinx directly. If we are OK to omit extensions from RTD, then I will proceed on the basis of the patch as now designed. Gerv
Attached patch Patch v.1Splinter Review
How about this? Gerv
Attachment #8365309 - Attachment is obsolete: true
Attachment #8372400 - Flags: review?(LpSolit)
Comment on attachment 8372400 [details] [diff] [review] Patch v.1 On checkin, make sure to also fix t/008filter.t to ignore .rst files, see line 83: if ($file =~ /\.(pm|txt|rst|png)\.tmpl$/) { r=LpSolit with this fix.
Attachment #8372400 - Flags: review?(LpSolit) → review+
Flags: approval?
LpSolit: Are you sure we need that? There are no ".rst.tmpl" files, at least not now... Gerv
(In reply to Gervase Markham [:gerv] from comment #12) > LpSolit: Are you sure we need that? There are no ".rst.tmpl" files Yes, I'm sure. We now have template/en/default/extensions/name.rst.tmpl.
Don't forget comment 11.
Flags: approval? → approval+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ added template/en/default/extensions/name.rst.tmpl modified docs/en/rst/index.rst modified docs/makedocs.pl modified t/008filter.t modified extensions/create.pl added extensions/Example/doc/example.rst added docs/en/rst/extensions.rst added extensions/Example/doc Committed revision 8926. Gerv
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: