From 3c6e283027ced6ac43b195d4d4047f9212a65fbc Mon Sep 17 00:00:00 2001 From: Navarrop Date: Thu, 10 Nov 2011 17:01:36 +0100 Subject: [PATCH 1/1] Add a sync target. Rewrite *.html with postprocesser. --- GenerateDoc.cmake | 16 +++++++++++ doc/footer.html.in | 2 +- doxygen_postprocesser.pl | 57 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100755 doxygen_postprocesser.pl diff --git a/GenerateDoc.cmake b/GenerateDoc.cmake index c8686a8041..922e728fba 100644 --- a/GenerateDoc.cmake +++ b/GenerateDoc.cmake @@ -24,6 +24,13 @@ if(DOXYGEN_PATH AND JAVADOC_PATH) WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/ ) + ADD_CUSTOM_COMMAND(TARGET documentation + COMMAND ${CMAKE_COMMAND} -E echo "XX Post-processing Doxygen result" + COMMAND ${CMAKE_HOME_DIRECTORY}/doxygen_postprocesser.pl + + WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc + ) + else(DOXYGEN_PATH AND JAVADOC_PATH) ADD_CUSTOM_TARGET(documentation COMMENT "Generating the SimGrid documentation..." @@ -36,3 +43,12 @@ else(DOXYGEN_PATH AND JAVADOC_PATH) COMMAND false ) endif(DOXYGEN_PATH AND JAVADOC_PATH) + +add_custom_target(sync-gforge-doc +COMMAND chmod g+rw -R doc/ +COMMAND chmod a+rX -R doc/ +COMMAND rsync --verbose --cvs-exclude --compress --delete --delete-excluded --rsh=ssh --ignore-times --recursive --links --perms --times --omit-dir-times +doc/html/ scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid-java/${SIMGRID_JAVA_VERSION_MAJOR}.${SIMGRID_JAVA_VERSION_MINOR}/doc/ || true +WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}" +) +add_dependencies(sync-gforge-doc documentation) \ No newline at end of file diff --git a/doc/footer.html.in b/doc/footer.html.in index b6704130a3..244d7ab41b 100644 --- a/doc/footer.html.in +++ b/doc/footer.html.in @@ -8,7 +8,7 @@ Back to the main Simgrid Documentation page -The version of Simgrid documented here is v@SIMGRID_JAVA_VERSION_MAJOR@.@SIMGRID_JAVA_VERSION_MINOR@.
+The version of Simgrid-java documented here is v@SIMGRID_JAVA_VERSION_MAJOR@.@SIMGRID_JAVA_VERSION_MINOR@.
Documentation of other versions can be found in their respective archive files (directory doc/html). diff --git a/doxygen_postprocesser.pl b/doxygen_postprocesser.pl new file mode 100755 index 0000000000..4bd645969a --- /dev/null +++ b/doxygen_postprocesser.pl @@ -0,0 +1,57 @@ +#! /usr/bin/perl + +use strict; + +# Add here the pages of the documentation generated by a @page doxygen macro +my @extra_files = qw(html/index.html html/install.html); + +### +### Post-processsing common to all pages +### +my $tabs = 0; + +foreach my $file (@extra_files) { + +open FROM,"$file" || die; +my $outfile = "$file"; +$outfile =~ s/.(html|php)$/.new.$1/; +open TO,">$outfile" || die; + +print "file: ".$file."\n"; + +while () { + + if( $_ =~ //){ + $tabs = 1; + } + if( $_ =~ /<\/div>/ && $tabs){ + $tabs = 0; + } + + if( $_ =~ // && $tabs){ + my $tmp_buff=""; + $tmp_buff .= $_; + $tmp_buff .= '
  • Install SimGrid-Java
  • '."\n"; + $tmp_buff .= '
  • Javadoc
  • '."\n"; + + $tabs = 0; + + my $filename = $file; + $filename =~ s/html\///g; + $filename =~ s/\.html//g; + $tmp_buff =~ s/
  • /
  • /g; + $tmp_buff =~ s/
  • /
  • /g; + + print TO $tmp_buff; + next; + } + + s|.*
  • \n||g; + + print TO $_; + } + +close FROM; +close TO; +rename("$outfile", "$file"); +} -- 2.20.1