[Commits] [svn:einsteintoolkit] www/documentation/ThornDoc/ (Rev. 1147)
barry.wardell at gmail.com
barry.wardell at gmail.com
Fri Mar 14 10:56:24 CDT 2014
User: barry.wardell
Date: 2014/03/14 10:56 AM
Modified:
/documentation/ThornDoc/
docpage.php, index.php
Log:
Include table of contents in single thorn documentation page
File Changes:
Directory: /documentation/ThornDoc/
===================================
File [modified]: docpage.php
Delta lines: +14 -2
===================================================================
--- documentation/ThornDoc/docpage.php 2014-03-14 15:15:32 UTC (rev 1146)
+++ documentation/ThornDoc/docpage.php 2014-03-14 15:56:24 UTC (rev 1147)
@@ -2,20 +2,32 @@
$page = $_GET['page']."/documentation.html";
function get_page_contents ($filename) {
+ $page = dirname($filename);
+ echo '<a name="'.$page.'">';
echo '<div style="thorndoc">';
$contents = file_get_contents($filename);
preg_match('/.*<body[^>]*>(.*)<\/body>.*/sm', $contents, $body);
- echo preg_replace('/src="documentation([a-z0-9]*)/', 'src="/documentation/ThornDoc/'.dirname($filename).'/documentation$1', $body[1]);
+ echo preg_replace('/src="documentation([a-z0-9]*)/', 'src="/documentation/ThornDoc/'.$page.'/documentation$1', $body[1]);
echo '</div>';
- echo '<hr />';
+ echo '</a>';
}
if($page == "All/documentation.html") {
$pages = array_merge(glob('*/documentation/html'), glob('*/*/documentation.html'));
+ $title='Thorn and Arrangement Documentation';
include_once($_SERVER['DOCUMENT_ROOT'].'/global/header.php');
echo '<link rel="stylesheet" type="text/css" href="/global/documentation.css">';
+ echo '<h2>Table of Contents</h2>';
+ echo '<ul>';
foreach ($pages as $thornpage){
+ $page = dirname($thornpage);
+ echo '<li><a href="#'.$page.'">'.$page.'</a></li>';
+ }
+ echo '</ul>';
+
+ foreach ($pages as $thornpage){
get_page_contents($thornpage);
+ echo '<hr />';
}
include_once($_SERVER['DOCUMENT_ROOT'].'/global/footer.php');
} elseif (! file_exists($page)) {
File [modified]: index.php
Delta lines: +1 -1
===================================================================
--- documentation/ThornDoc/index.php 2014-03-14 15:15:32 UTC (rev 1146)
+++ documentation/ThornDoc/index.php 2014-03-14 15:56:24 UTC (rev 1147)
@@ -1,4 +1,4 @@
-<?php $title='Documentation';
+<?php $title='Thorn and Arrangement Documentation';
include_once($_SERVER['DOCUMENT_ROOT'].'/global/header.php'); ?>
<!--
More information about the Commits
mailing list