From 3b8aa71cf8be76f60589d527cde20d16c20ae5ba Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 3 Nov 2011 14:01:00 +0000 Subject: [PATCH] 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 --- maintenance/Doxyfile | 2 +- maintenance/Makefile | 7 +++++++ maintenance/mwdocgen.php | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/maintenance/Doxyfile b/maintenance/Doxyfile index 03342dc3bb..3a037ae201 100644 --- a/maintenance/Doxyfile +++ b/maintenance/Doxyfile @@ -207,7 +207,7 @@ RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -GENERATE_MAN = NO +GENERATE_MAN = {{GENERATE_MAN}} MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO diff --git a/maintenance/Makefile b/maintenance/Makefile index a92751c93d..30b568dcab 100644 --- a/maintenance/Makefile +++ b/maintenance/Makefile @@ -1,6 +1,7 @@ help: @echo "Run 'make test' to run the parser tests." @echo "Run 'make doc' to run the doxygen generation." + @echo "Run 'make man' to run the doxygen generation with man pages." test: php tests/parserTests.php --quiet @@ -8,3 +9,9 @@ test: doc: php mwdocgen.php --all @echo 'Doc generation done. Look at ./docs/html/' + +man: + php mwdocgen.php --all --generate-man + @echo 'Doc generation done. Look at ./docs/html/ and ./docs/man' + @echo 'You might want to update your MANPATH currently:' + @echo 'MANPATH: $(MANPATH)' diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 24d63c54c1..c68e426529 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -156,6 +156,8 @@ function getSvnRevision( $dir ) { */ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input, $exclude, $exclude_patterns ) { + global $wgDoxyGenerateMan; + $template = file_get_contents( $doxygenTemplate ); // Replace template placeholders by correct values. @@ -168,6 +170,7 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, '{{EXCLUDE}}' => $exclude, '{{EXCLUDE_PATTERNS}}' => $exclude_patterns, '{{HAVE_DOT}}' => `which dot` ? 'YES' : 'NO', + '{{GENERATE_MAN}}' => $wgDoxyGenerateMan ? 'YES' : 'NO', ); $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template ); $tmpFileName = tempnam( wfTempDir(), 'mwdocgen-' ); @@ -204,6 +207,9 @@ if ( is_array( $argv ) ) { $doxyOutput = realpath( $argv[$i] ); } break; + case '--generate-man': + $wgDoxyGenerateMan = true; + break; case '--help': print <<] [] @@ -220,6 +226,7 @@ If no command is given, you will be prompted. Other options: --output Set output directory (default $doxyOutput) + --generate-man Generates man page documentation --help Show this help and exit. -- 2.20.1