r101807 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101806‎ | r101807 | r101808 >
Date:14:01, 3 November 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
man page help pages generation

Tweaked mwdocgen.php to let us generates man pages. They will be saved to
./docs/man so make sure to update your MANPATH if you use this feature.

Usage:

php mwdocgen.php --all --generate-man
or
make man
Modified paths:
  • /trunk/phase3/maintenance/Doxyfile (modified) (history)
  • /trunk/phase3/maintenance/Makefile (modified) (history)
  • /trunk/phase3/maintenance/mwdocgen.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mwdocgen.php
@@ -156,6 +156,8 @@
157157 */
158158 function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input, $exclude, $exclude_patterns ) {
159159
 160+ global $wgDoxyGenerateMan;
 161+
160162 $template = file_get_contents( $doxygenTemplate );
161163
162164 // Replace template placeholders by correct values.
@@ -168,6 +170,7 @@
169171 '{{EXCLUDE}}' => $exclude,
170172 '{{EXCLUDE_PATTERNS}}' => $exclude_patterns,
171173 '{{HAVE_DOT}}' => `which dot` ? 'YES' : 'NO',
 174+ '{{GENERATE_MAN}}' => $wgDoxyGenerateMan ? 'YES' : 'NO',
172175 );
173176 $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template );
174177 $tmpFileName = tempnam( wfTempDir(), 'mwdocgen-' );
@@ -204,6 +207,9 @@
205208 $doxyOutput = realpath( $argv[$i] );
206209 }
207210 break;
 211+ case '--generate-man':
 212+ $wgDoxyGenerateMan = true;
 213+ break;
208214 case '--help':
209215 print <<<END
210216 Usage: php mwdocgen.php [<command>] [<options>]
@@ -220,6 +226,7 @@
221227
222228 Other options:
223229 --output <dir> Set output directory (default $doxyOutput)
 230+ --generate-man Generates man page documentation
224231 --help Show this help and exit.
225232
226233
Index: trunk/phase3/maintenance/Doxyfile
@@ -207,7 +207,7 @@
208208 #---------------------------------------------------------------------------
209209 # configuration options related to the man page output
210210 #---------------------------------------------------------------------------
211 -GENERATE_MAN = NO
 211+GENERATE_MAN = {{GENERATE_MAN}}
212212 MAN_OUTPUT = man
213213 MAN_EXTENSION = .3
214214 MAN_LINKS = NO
Index: trunk/phase3/maintenance/Makefile
@@ -1,6 +1,7 @@
22 help:
33 @echo "Run 'make test' to run the parser tests."
44 @echo "Run 'make doc' to run the doxygen generation."
 5+ @echo "Run 'make man' to run the doxygen generation with man pages."
56
67 test:
78 php tests/parserTests.php --quiet
@@ -8,3 +9,9 @@
910 doc:
1011 php mwdocgen.php --all
1112 @echo 'Doc generation done. Look at ./docs/html/'
 13+
 14+man:
 15+ php mwdocgen.php --all --generate-man
 16+ @echo 'Doc generation done. Look at ./docs/html/ and ./docs/man'
 17+ @echo 'You might want to update your MANPATH currently:'
 18+ @echo 'MANPATH: $(MANPATH)'

Sign-offs

UserFlagDate
Nikerabbitinspected15:34, 3 November 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r111628always have $wgDoxyGenerateMan defined...hashar08:36, 16 February 2012

Comments

#Comment by Nikerabbit (talk | contribs)   14:58, 3 November 2011

Humm globals? Would it be time to refactor that method to take array of replacement variables?

#Comment by Hashar (talk | contribs)   15:00, 3 November 2011

I have prefixed with 'wg' to make it clear it is a global although it is only used in this script.

The whole script need to be refactored to use the Maintenance class anyway.

#Comment by Nikerabbit (talk | contribs)   15:34, 3 November 2011

Is there a bug open for that?

#Comment by Hashar (talk | contribs)   17:32, 3 November 2011

None I know of.

#Comment by Hashar (talk | contribs)   08:33, 16 February 2012

I have opened bug 34436 to get mwdocgen.php rewritten using the Maintenance class

#Comment by Reedy (talk | contribs)   02:03, 16 February 2012

wgDoxyGenerateMan isn't always defined.....

#Comment by Hashar (talk | contribs)   08:36, 16 February 2012

Done with r111628

Status & tagging log