Closed Bug 664053 Opened 15 years ago Closed 14 years ago

fix 'cfx docs' to just look for *.md files

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: warner, Assigned: warner)

Details

Attachments

(1 file)

As noticed in Bug 664001, the code in webdocs.py (run by 'cfx docs') generates a list of "documented modules" by taking a list of known .js modules and looking for the ones that have corresponding .md files in the docs/ directory. This fails for the "self" module, which has a self.md in the right place in addon-kit/docs, but which is synthesized somewhat magically from code in api-utils/lib/self-maker.js . The generate-documented-modules function should be less clever, and instead just look for a list of all *.md files in the docs/ directory. Bug 664001 added a manual hack, which should be removed once this is fixed correctly.
Priority: -- → P2
Target Milestone: --- → Future
Assigning to warner.
Assignee: nobody → warner-bugzilla
Target Milestone: Future → 1.2
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: 1.2 → ---
This changes get_documented_modules() to get_documentation(), and changes the lookup process: instead of starting with all .js files and filtering away the ones that don't have corresponding .md files, this version just looks for all .md files. A nice side-effect: api-utils/docs/content/proxy.md is visible in this approach, whereas on current trunk it gets ignored (because there is no lib/content/proxy.js). I did a quick comparison (looking at the output of get_documentation()) to make sure no modules went missing, and the only difference I saw was the addition of content/proxy.md wbamberg: could you also eyeball the output and double-check this claim? Also, do you think this is a good approach in general? I can imagine instead wanting a warning if there were no .js to match the .md, or something like that.
Attachment #594369 - Flags: review?(wbamberg)
Attachment #594369 - Flags: review?(wbamberg) → review+
(In reply to Brian Warner [:warner :bwarner] from comment #3) > Created attachment 594369 [details] [diff] [review] > look for .md files, rather than .js files that also have .md files > > This changes get_documented_modules() to get_documentation(), and changes > the lookup process: instead of starting with all .js files and filtering > away the ones that don't have corresponding .md files, this version just > looks for all .md files. > > A nice side-effect: api-utils/docs/content/proxy.md is visible in this > approach, whereas on current trunk it gets ignored (because there is no > lib/content/proxy.js). > > I did a quick comparison (looking at the output of get_documentation()) to > make sure no modules went missing, and the only difference I saw was the > addition of content/proxy.md > > wbamberg: could you also eyeball the output and double-check this claim? > Also, do you think this is a good approach in general? I can imagine instead > wanting a warning if there were no .js to match the .md, or something like > that. Looks good to me, and I'm very happy to see this function simplified, it's been a source of multiple bugs. I think it's a fine approach, and makes it easy to deal with odd cases like "self".
Commit pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/12f6580e0781d819223b5ffc12dd169654505678 Bug 664053: 'cfx docs' should just look for *.md files. r=wbamberg This changes the documentation-file search used by 'cfx docs' and friends to search for all .md files in packages/, rather than searching for all .js files and then finding corresponding .md files. This makes it easier to handle pseudo-modules like "self", as well as not-exactly-module things like "content/proxy".
Done!
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: