-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
146 lines (131 loc) · 3.11 KB
/
example.php
File metadata and controls
146 lines (131 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
// Turn on debugging
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'stdout');
ini_set('display_startup_errors', true);
ini_set('log_errors', false);
ini_set('ignore_repeated_errors', true);
ini_set('html_errors', true);
ini_set('docref_root', 'http://ca2.php.net/manual/en/');
require_once 'NDlite.php';
// Path to your source files
define('NDLITE_DOC_PATH', '/home/lis/public_html/devel/');
// Base URL for cross-file links
define('NDLITE_BASE_URL', '/devel/php-utils/samples/ndlite-pathinfo.php/');
// NOTHING TO MODIFY BELOW THIS POINT
// Browser-friendly URL: use PATH_INFO, preferrably append '-doc'
$path = $_SERVER['PATH_INFO'];
$pathlength = strlen($path);
$pathstart = 0;
if (strpos($path, '-doc') > 0) $pathlength -= 4;
if (!empty($path) && $path[0] == '/') $pathstart = 1;
$path = substr($path, $pathstart, ($pathlength - $pathstart));
// The program
header('Content-Type: text/html');
$doc = new NDlite(NDLITE_DOC_PATH, NDLITE_BASE_URL);
$doc->parseFile(NDLITE_DOC_PATH . $path);
$title = $doc->guessTitle($path);
?>
<html>
<head>
<title><?=$title?></title>
<style>
/* Example NDlite styling, loosely based on NaturalDocs 1.x.
*
* WARNING: Tested only with Firefox 2.0. I'm not sure MSIE will like the
* display:table-cell I used in the summary and definition lists.
*/
/* Make links less intrusive in text flow */
.ndlite_doc a {
text-decoration: none;
}
.ndlite_doc a:hover {
text-decoration: underline;
}
/* Titles */
.ndlite_doc h2 {
border-bottom: 2px solid black;
font-variant: small-caps;
padding-left: 1em;
}
.ndlite_doc h3 {
border-bottom: 1px solid #808080;
padding-left: 2em;
}
/* Code blocks */
.ndlite_doc pre {
margin: 0 1em 0 2em;
padding: 1em;
border: 1px solid #c0c0c0;
border-left: 6px solid #c0c0c0;
color: #606060;
}
/* Definition lists */
.ndlite_doc dt {
color: #606060;
font-family: monospace;
}
.ndlite_doc dd {
margin-bottom: 1em;
}
/* Prototype code */
.ndlite_doc code {
display: block;
font-family: monospace;
border: 1px solid #c0c0c0;
background-color: #f8f8f8;
margin: 0.5em 4em 1em 4em;
padding: 0.5em 1em 0.5em 1em;
}
/* Summary */
.ndlite_doc .NDlite_Summary {
padding: 1em 1em 0.5em 2em;
margin: 0 4em 0 4em;
background-color: #f8f8f8;
border: 1px solid #c0c0c0;
}
.ndlite_doc .NDlite_Summary ul {
margin-left: 0;
padding-left: 2em;
}
.ndlite_doc .NDlite_Summary li {
list-style-type: none;
margin-left: 0;
padding-left: 0;
clear: both;
}
.ndlite_doc .NDlite_Summary li.NDlite_Group ul {
margin: 0.5em 0 1em 0;
}
.ndlite_doc .NDlite_Summary a {
display: block;
float: left;
width: 20em;
}
.ndlite_doc .NDlite_Summary .NDlite_Abstract a {
width: auto;
display: inline;
float: none;
}
.ndlite_doc .NDlite_Summary li.NDlite_Group a {
font-weight: bold;
font-variant: small-caps;
width: 18em;
}
.ndlite_doc .NDlite_Summary li.NDlite_Group li a {
font-weight: normal;
font-variant: normal;
width: 16em;
}
.ndlite_doc .NDlite_Summary li.odd {
background-color: #eaeaea;
}
</style>
</head>
<body>
<div class="ndlite_doc">
<h1><?=$title?></h1>
<?php echo $doc->toXHTML(array('private' => true)); ?>
</div>
</body>
</html>