Author: dr Date: Thu Nov 1 17:14:54 2007 New Revision: 6668 Log: - New documentation layout.
Modified: scripts/build-docs.sh scripts/build-php-doc-config.php scripts/render-tutorial.php Modified: scripts/build-docs.sh ============================================================================== --- scripts/build-docs.sh [iso-8859-1] (original) +++ scripts/build-docs.sh [iso-8859-1] Thu Nov 1 17:14:54 2007 @@ -1,18 +1,20 @@ #!/bin/sh - -BASE_OUTPUT_DIR=/home/httpd/html/components -DOC_OUTPUT_DIR=${BASE_OUTPUT_DIR}/phpdoc_gen/ezcomponents -HTTP_ROOT_DIR=/components/phpdoc_gen/ezcomponents if test $# -lt 1; then echo "Usage: scripts/build-docs.sh <version> ..." exit 0; fi +release=$1 + +BASE_OUTPUT_DIR=/home/httpd/html/components +DOC_OUTPUT_DIR=${BASE_OUTPUT_DIR}/phpdoc_gen/ezcomponents-${release} +HTTP_ROOT_DIR=/components/phpdoc_gen/ezcomponents-${release} + wd=`pwd` rm -rf ${DOC_OUTPUT_DIR} || exit 6 -rm -rf ${BASE_OUTPUT_DIR}/cdocs.tgz || exit 7 +rm -rf ${BASE_OUTPUT_DIR}/cdocs-${release}.tgz || exit 7 mkdir -p ${DOC_OUTPUT_DIR} ln -s /home/httpd/html/components/design ${DOC_OUTPUT_DIR}/design @@ -20,52 +22,7 @@ echo "Copying overview" cp docs/overview.tpl ${DOC_OUTPUT_DIR} || exit 12 -echo "Preparing top left_menu_comp.tpl" -cat > ${DOC_OUTPUT_DIR}/left_menu_comp.tpl << EOF -<div class="attribute-heading"> -<h2 class="bullet">eZ Components</h2> -</div> - -<div class="boxcontent"> -<div id="quicklinks"> -{let \$indexDir = ezsys( 'indexdir' )} -<h2>Getting Started</h2> -<ul> -<li><a href="http://ez.no/community/articles/an_introduction_to_ez_components">Installation</a></li> -<li><a href="{concat(\$indexDir, '/components/view/latest/(file)/tutorials.html')}">Tutorials</a></li> -</ul> - -<h2>Versions</h2> -<ul> -EOF -cat > ${DOC_OUTPUT_DIR}/left_menu_comp.html << EOF -<div class="attribute-heading"> -<h2 class="bullet">eZ Components</h2> -</div> - -<div class="boxcontent"> -<div id="quicklinks"> -<h2>Getting Started</h2> -<ul> -<li><a href="http://ez.no/community/articles/an_introduction_to_ez_components">Installation</a></li> -<li><a href="${HTTP_ROOT_DIR}/$1/tutorials.html">Tutorials</a></li> -</ul> - -<h2>Versions</h2> -<ul> -EOF - -for release in trunk latest $@; do - -mkdir -p ${DOC_OUTPUT_DIR}/$release - -echo "Update main index file" -cat >> ${DOC_OUTPUT_DIR}/left_menu_comp.tpl << EOF -<li><a href="{concat(\$indexDir, '/components/view/$release/(file)/')}">eZ Components $release</a></li> -EOF -cat >> ${DOC_OUTPUT_DIR}/left_menu_comp.html << EOF -<li><a href="${HTTP_ROOT_DIR}/$release/">eZ Components $release</a></li> -EOF +mkdir -p ${DOC_OUTPUT_DIR} echo "Writing config file for $release" cd $wd @@ -76,7 +33,7 @@ cd /home/httpd || exit 2 cd ezcomponents || exit 4 -mkdir -p ${DOC_OUTPUT_DIR}/$release || exit 8 +mkdir -p ${DOC_OUTPUT_DIR} || exit 8 echo "Copying overview for $release" cp docs/overview_$release.tpl ${DOC_OUTPUT_DIR} @@ -86,34 +43,17 @@ ./scripts/setup-env.sh echo "Writing left_menu_comp_$release.tpl" -cat > ${DOC_OUTPUT_DIR}/left_menu_comp_$release.tpl << EOF -<div class="attribute-heading"> -<h2 class="bullet">eZ Components</h2> -</div> -<div class="boxcontent"> -<div id="quicklinks"> -{let \$indexDir = ezsys( 'indexdir' )} -<h2>Getting Started</h2> -<ul> -<li><a href="http://ez.no/community/articles/an_introduction_to_ez_components">Installation</a></li> -<li><a href="{concat(\$indexDir, '/components/view/$release/(file)/tutorials.html')}">Tutorials</a></li> -</ul> - -<h2>Components</h2> -<ul> -EOF cat > ${DOC_OUTPUT_DIR}/left_menu_comp_$release.html << EOF <div class="attribute-heading"> -<h2 class="bullet">eZ Components</h2> +<h1>eZ Components $release</h1> </div> - <div class="boxcontent"> <div id="quicklinks"> <h2>Getting Started</h2> <ul> -<li><a href="http://ez.no/community/articles/an_introduction_to_ez_components">Installation</a></li> -<li><a href="${HTTP_ROOT_DIR}/$release/tutorials.html">Tutorials</a></li> +<li><a href="/docs/install">Installation</a></li> +<li><a href="/docs/api/$release/tutorials.html">Tutorials</a></li> </ul> <h2>Components</h2> @@ -121,9 +61,9 @@ EOF -cat > ${DOC_OUTPUT_DIR}/$release/index.php << EOF +cat > ${DOC_OUTPUT_DIR}/index.php << EOF <?php -include '../overview_$release.tpl'; +include 'overview_$release.tpl'; ?> EOF @@ -131,30 +71,30 @@ echo "Generating Tutorials for $release:" echo "* Tutorials overview page start" -cat >> ${DOC_OUTPUT_DIR}/$release/tutorials.tpl <<EOF +cat >> ${DOC_OUTPUT_DIR}/tutorials.tpl <<EOF <div class="attribute-heading"><h1>Tutorials</h1></div> <ul> EOF -cp ${DOC_OUTPUT_DIR}/$release/tutorials.tpl ${DOC_OUTPUT_DIR}/$release/tutorials.html +cp ${DOC_OUTPUT_DIR}/tutorials.tpl ${DOC_OUTPUT_DIR}/tutorials.html for i in $j; do comp=`echo $i | cut -d / -f 2` version=`echo "$i" | sed "s/\/$comp//" | sed "s/releases\///"` if test -f $i/docs/tutorial.txt; then echo "* $comp ($version)" - php scripts/render-tutorial.php -c $comp -t ${DOC_OUTPUT_DIR}/$release -v $version + php scripts/render-tutorial.php -c $comp -t ${DOC_OUTPUT_DIR} -v $version - cat >> ${DOC_OUTPUT_DIR}/$release/tutorials.tpl << EOF + cat >> ${DOC_OUTPUT_DIR}/tutorials.tpl << EOF <li><a href="introduction_$comp.html')}">$comp</a></li> EOF - cat >> ${DOC_OUTPUT_DIR}/$release/tutorials.html << EOF + cat >> ${DOC_OUTPUT_DIR}/tutorials.html << EOF <li><a href="introduction_$comp.html">$comp</a></li> EOF # Add changelog and CREDITS - php scripts/render-rst-file.php -v $release -c $comp -t "${DOC_OUTPUT_DIR}/$release" -f $i/ChangeLog -o "changelog_$comp.html" - php scripts/render-rst-file.php -v $release -c $comp -t "${DOC_OUTPUT_DIR}/$release" -f $i/CREDITS -o "credits_$comp.html" + php scripts/render-rst-file.php -v $release -c $comp -t "${DOC_OUTPUT_DIR}" -f $i/ChangeLog -o "changelog_$comp.html" + php scripts/render-rst-file.php -v $release -c $comp -t "${DOC_OUTPUT_DIR}" -f $i/CREDITS -o "credits_$comp.html" # Add extra docs for tutorials extra1="" @@ -169,7 +109,7 @@ if test $output_name != "tutorial.html"; then if test $output_name != "docs"; then echo -n " - Rendering extra doc '$output_name' to $release/${comp}_${output_name}" - php scripts/render-rst-file.php -v $release -c $comp -t "${DOC_OUTPUT_DIR}/$release" -f $t + php scripts/render-rst-file.php -v $release -c $comp -t "${DOC_OUTPUT_DIR}" -f $t short_name=`echo $output_name | sed 's/.html//'` short_name=`php -r "echo ucfirst( '$short_name' );"` extra1="$extra1 <b>[ <a href='../${comp}_${output_name}'>$short_name</a> ]</b>" @@ -178,12 +118,12 @@ fi done if test "$extra1" != ""; then - for w in ${DOC_OUTPUT_DIR}/$release/$comp/*.html; do + for w in ${DOC_OUTPUT_DIR}/$comp/*.html; do echo "- Postprocessing $w" cp $w /tmp/file.html php -r "echo str_replace( '<!-- EXTRA DOCS GO HERE! -->', \"$extra1\", file_get_contents( '/tmp/file.html' ) ); " > $w done - for w in ${DOC_OUTPUT_DIR}/$release/${comp}_*.html ${DOC_OUTPUT_DIR}/$release/*_${comp}.html; do + for w in ${DOC_OUTPUT_DIR}/${comp}_*.html ${DOC_OUTPUT_DIR}/*_${comp}.html; do echo "- Postprocessing $w" cp $w /tmp/file.html php -r "echo str_replace( '<!-- EXTRA DOCS GO HERE! -->', \"$extra2\", file_get_contents( '/tmp/file.html' ) ); " > $w @@ -191,44 +131,30 @@ fi else - echo '<div class="attribute-heading"><h1>'$comp'</h1></div>' > ${DOC_OUTPUT_DIR}/$release/introduction_$comp.html - echo '<b>[ <a href="introduction_'$comp'.html" class="menu">Tutorial</a> ]</b>' >> ${DOC_OUTPUT_DIR}/$release/introduction_$comp.html - echo '<b>[ <a href="classtrees_'$comp'.html" class="menu">Class tree</a> ]</b>' >> ${DOC_OUTPUT_DIR}/$release/introduction_$comp.html - echo '<b>[ <a href="elementindex_'$comp'.html" class="menu">Element index</a> ]</b>' >> ${DOC_OUTPUT_DIR}/$release/introduction_$comp.html - echo '<b>[ <a href="changelog_'$comp'.html" class="menu">ChangeLog</a> ]</b>' >> ${DOC_OUTPUT_DIR}/$release/introduction_$comp.html - echo '<b>[ <a href="credits_'$comp'.html" class="menu">Credits</a> ]</b>' >> ${DOC_OUTPUT_DIR}/$release/introduction_$comp.html - echo "<h1>No introduction available for $comp</h1>" >> ${DOC_OUTPUT_DIR}/$release/introduction_$comp.html + echo '<div class="attribute-heading"><h1>'$comp'</h1></div>' > ${DOC_OUTPUT_DIR}/introduction_$comp.html + echo '<b>[ <a href="introduction_'$comp'.html" class="menu">Tutorial</a> ]</b>' >> ${DOC_OUTPUT_DIR}/introduction_$comp.html + echo '<b>[ <a href="classtrees_'$comp'.html" class="menu">Class tree</a> ]</b>' >> ${DOC_OUTPUT_DIR}/introduction_$comp.html + echo '<b>[ <a href="elementindex_'$comp'.html" class="menu">Element index</a> ]</b>' >> ${DOC_OUTPUT_DIR}/introduction_$comp.html + echo '<b>[ <a href="changelog_'$comp'.html" class="menu">ChangeLog</a> ]</b>' >> ${DOC_OUTPUT_DIR}/introduction_$comp.html + echo '<b>[ <a href="credits_'$comp'.html" class="menu">Credits</a> ]</b>' >> ${DOC_OUTPUT_DIR}/introduction_$comp.html + echo "<h1>No introduction available for $comp</h1>" >> ${DOC_OUTPUT_DIR}/introduction_$comp.html fi cat >> ${DOC_OUTPUT_DIR}/left_menu_comp_$release.tpl << EOF <li><a href="{concat(\$indexDir, '/components/view/$release/(file)/classtrees_$comp.html')}">$comp</a> ($version)</li> EOF cat >> ${DOC_OUTPUT_DIR}/left_menu_comp_$release.html << EOF -<li><a href="${HTTP_ROOT_DIR}/$release/classtrees_$comp.html">$comp</a> ($version)</li> +<li><a href="/docs/api/$release/classtrees_$comp.html">$comp</a> ($version)</li> EOF done - -cat >> ${DOC_OUTPUT_DIR}/left_menu_comp_$release.tpl << EOF -</ul> -<hr/> - -<ul> -<li><a href="{concat(\$indexDir, '/components/view/$release/(file)/allclassesindex.html')}">All Classes</a></li> -<li><a href="{concat(\$indexDir, '/components/view/$release/(file)/elementindex.html')}">All Elements</a></li> -</ul> -{/let} - -</div> -</div> -EOF cat >> ${DOC_OUTPUT_DIR}/left_menu_comp_$release.html << EOF </ul> <hr/> <ul> -<li><a href="${HTTP_ROOT_DIR}/$release/allclassesindex.html">All Classes</a></li> -<li><a href="${HTTP_ROOT_DIR}/$release/elementindex.html">All Elements</a></li> +<li><a href="/docs/api/$release/allclassesindex.html">All Classes</a></li> +<li><a href="/docs/api/$release/elementindex.html">All Elements</a></li> </ul> </div> @@ -237,26 +163,11 @@ echo "* Tutorials overview page end" -cat >> ${DOC_OUTPUT_DIR}/$release/tutorials.tpl << EOF +cat >> ${DOC_OUTPUT_DIR}/tutorials.tpl << EOF </ul> EOF -cat >> ${DOC_OUTPUT_DIR}/$release/tutorials.html << EOF +cat >> ${DOC_OUTPUT_DIR}/tutorials.html << EOF </ul> -EOF - -done - -echo "Wrapping up index files" -cat >> ${DOC_OUTPUT_DIR}/left_menu_comp.tpl << EOF -</ul> -</div> -</div> -EOF - -cat >> ${DOC_OUTPUT_DIR}/left_menu_comp.html << EOF -</ul> -</div> -</div> EOF cat > ${DOC_OUTPUT_DIR}/index.php << EOF @@ -272,5 +183,8 @@ rm $i done -tar -cf cdocs.tar phpdoc_gen || exit 11 -gzip -c -9 cdocs.tar > cdocs.tgz || exit 12 +cd phpdoc_gen +tar -cf ../cdocs-${release}.tar ezcomponents-${release} || exit 11 +cd .. +gzip -c -9 cdocs-${release}.tar > cdocs-${release}.tgz || exit 12 +rm cdocs-${release}.tar Modified: scripts/build-php-doc-config.php ============================================================================== --- scripts/build-php-doc-config.php [iso-8859-1] (original) +++ scripts/build-php-doc-config.php [iso-8859-1] Thu Nov 1 17:14:54 2007 @@ -38,14 +38,14 @@ echo <<<ECHOEND [Parse Data] -title = eZ components Manual +title = eZ Components Manual hidden = false parseprivate = off javadocdesc = off defaultcategoryname = NoCategoryName defaultpackagename = NoPackageName -target = /home/httpd/html/components/phpdoc_gen/ezcomponents/$targetversion +target = /home/httpd/html/components/phpdoc_gen/ezcomponents-$targetversion directory = $directories ignore = autoload/,*autoload.php,tests/,docs/ Modified: scripts/render-tutorial.php ============================================================================== --- scripts/render-tutorial.php [iso-8859-1] (original) +++ scripts/render-tutorial.php [iso-8859-1] Thu Nov 1 17:14:54 2007 @@ -98,7 +98,7 @@ $output = getRstOutput( $componentDir ); $output = removeHeaderFooter( $output ); -$output = addNewHeader( $component, $output ); +$output = addNewHeader( $component, $output, $version ); $output = addExampleLineNumbers( $output ); $output = addLinks( $component, $output, $version ); $output = addNewFooter( $output ); @@ -122,7 +122,7 @@ { ini_set( 'pcre.backtrack_limit', 10000000 ); $output = preg_replace( '@.*?<body>@ms', '', $output ); - $output = preg_replace( '@<h1 class="title">eZ components - [A-Za-z]+</h1>@', '', $output ); + $output = preg_replace( '@<h1 class="title">eZ components - [A-Za-z]+</h1>@i', '', $output ); $output = preg_replace( '@<\/body>[EMAIL PROTECTED]', '', $output ); return $output; } @@ -132,19 +132,16 @@ return $output . "\n". "<div style=\"color: #959fa8; text-align: right; font-size: 0.85em;\">Last updated: ". date( 'D, d M Y' ) . "</div>"; } -function addNewHeader( $component, $output ) +function addNewHeader( $component, $output, $version ) { $outputHeader = <<<FOO -<div class="attribute-heading"><h1>$component</h1></div> - - -<b>[ <a href="introduction_$component.html" class="menu">Tutorial</a> ]</b> +<h1>$component</h1> +<b>[ <a href="/docs/api/$version/introduction_$component.html" class="menu">Tutorial</a> ]</b> <!-- EXTRA DOCS GO HERE! --> -<b>[ <a href="classtrees_$component.html" class="menu">Class tree</a> ]</b> -<b>[ <a href="elementindex_$component.html" class="menu">Element index</a> ]</b> -<b>[ <a href="changelog_$component.html" class="menu">ChangeLog</a> ]</b> -<b>[ <a href="credits_$component.html" class="menu">Credits</a> ]</b> -<h2>Tutorial for Component $component</h2> +<b>[ <a href="/docs/api/$version/classtrees_$component.html" class="menu">Class tree</a> ]</b> +<b>[ <a href="/docs/api/$version/elementindex_$component.html" class="menu">Element index</a> ]</b> +<b>[ <a href="/docs/api/$version/changelog_$component.html" class="menu">ChangeLog</a> ]</b> +<b>[ <a href="/docs/api/$version/credits_$component.html" class="menu">Credits</a> ]</b> <hr class="separator" /> FOO; return $outputHeader . $output; -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components