xref: /plugin/aichat/vendor/vanderlee/php-sentence/index.html (revision 8817535b0c67f8b10e9b8c05dcdf58fc17827423)
1*8817535bSAndreas Gohr
2*8817535bSAndreas Gohr<!DOCTYPE html>
3*8817535bSAndreas Gohr<html>
4*8817535bSAndreas Gohr	<head>
5*8817535bSAndreas Gohr        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6*8817535bSAndreas Gohr        <title>PHP Sentence</title>
7*8817535bSAndreas Gohr
8*8817535bSAndreas Gohr		<!-- jQuery/jQueryUI (hosted) -->
9*8817535bSAndreas Gohr		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>
10*8817535bSAndreas Gohr		<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.js"></script>
11*8817535bSAndreas Gohr
12*8817535bSAndreas Gohr		<!-- Markdown parser -->
13*8817535bSAndreas Gohr		<script src="https://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.min.js"></script>
14*8817535bSAndreas Gohr
15*8817535bSAndreas Gohr		<!-- Prettyprint -->
16*8817535bSAndreas Gohr		<link href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css" rel="stylesheet" type="text/css"/>
17*8817535bSAndreas Gohr		<script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
18*8817535bSAndreas Gohr
19*8817535bSAndreas Gohr		<!-- Index -->
20*8817535bSAndreas Gohr		<style>
21*8817535bSAndreas Gohr			body {
22*8817535bSAndreas Gohr				font-family:			"Segoe UI", Verdana, Helvetica, Arial, sans-serif;
23*8817535bSAndreas Gohr				font-size:				11px;
24*8817535bSAndreas Gohr				padding:				3em 8em 1em 4em;
25*8817535bSAndreas Gohr			}
26*8817535bSAndreas Gohr
27*8817535bSAndreas Gohr			#menu {
28*8817535bSAndreas Gohr				margin-bottom:			2em;
29*8817535bSAndreas Gohr			}
30*8817535bSAndreas Gohr
31*8817535bSAndreas Gohr			#preview {
32*8817535bSAndreas Gohr				text-align:				center;
33*8817535bSAndreas Gohr			}
34*8817535bSAndreas Gohr			#preview > * {
35*8817535bSAndreas Gohr				box-shadow:				0 0 2em silver;
36*8817535bSAndreas Gohr				padding:				2em;
37*8817535bSAndreas Gohr			}
38*8817535bSAndreas Gohr
39*8817535bSAndreas Gohr			.chapter {
40*8817535bSAndreas Gohr				-webkit-columns:		460px;
41*8817535bSAndreas Gohr				   -moz-columns:		460px;
42*8817535bSAndreas Gohr						columns:		460px;
43*8817535bSAndreas Gohr
44*8817535bSAndreas Gohr				-webkit-column-gap:		4em;
45*8817535bSAndreas Gohr				   -moz-column-gap:		4em;
46*8817535bSAndreas Gohr						column-gap:		4em;
47*8817535bSAndreas Gohr
48*8817535bSAndreas Gohr				-webkit-column-rule:	thin solid silver;
49*8817535bSAndreas Gohr				   -moz-column-rule:	thin solid silver;
50*8817535bSAndreas Gohr						column-rule:	thin solid silver;
51*8817535bSAndreas Gohr
52*8817535bSAndreas Gohr				text-align:				justify;
53*8817535bSAndreas Gohr			}
54*8817535bSAndreas Gohr
55*8817535bSAndreas Gohr			h1,
56*8817535bSAndreas Gohr			h2 {
57*8817535bSAndreas Gohr				background:				black;
58*8817535bSAndreas Gohr				color:					white;
59*8817535bSAndreas Gohr				padding:				.2em .4em;
60*8817535bSAndreas Gohr			}
61*8817535bSAndreas Gohr			h1 {
62*8817535bSAndreas Gohr				margin-top:				1em;
63*8817535bSAndreas Gohr			}
64*8817535bSAndreas Gohr			h2 {
65*8817535bSAndreas Gohr				background:				gray;
66*8817535bSAndreas Gohr			}
67*8817535bSAndreas Gohr
68*8817535bSAndreas Gohr			hr {
69*8817535bSAndreas Gohr				border-top:			double;
70*8817535bSAndreas Gohr				margin:				2em 25%;
71*8817535bSAndreas Gohr			}
72*8817535bSAndreas Gohr
73*8817535bSAndreas Gohr			#footer {
74*8817535bSAndreas Gohr				margin-top:			4em;
75*8817535bSAndreas Gohr				text-align:			center;
76*8817535bSAndreas Gohr				color:				silver;
77*8817535bSAndreas Gohr				border-top:			thin solid silver;
78*8817535bSAndreas Gohr				padding-top:		1em;
79*8817535bSAndreas Gohr			}
80*8817535bSAndreas Gohr
81*8817535bSAndreas Gohr			.output {
82*8817535bSAndreas Gohr				font-family:		monospace;
83*8817535bSAndreas Gohr				border:				solid thin silver;
84*8817535bSAndreas Gohr				padding:			.2em .4em;
85*8817535bSAndreas Gohr				background-color:	#cf3;
86*8817535bSAndreas Gohr			}
87*8817535bSAndreas Gohr
88*8817535bSAndreas Gohr			.clickable {
89*8817535bSAndreas Gohr				cursor:				pointer;
90*8817535bSAndreas Gohr			}
91*8817535bSAndreas Gohr
92*8817535bSAndreas Gohr			pre {
93*8817535bSAndreas Gohr				tab-size:			4;
94*8817535bSAndreas Gohr				overflow-x:			auto;
95*8817535bSAndreas Gohr				background-color:	#eee;
96*8817535bSAndreas Gohr			}
97*8817535bSAndreas Gohr		</style>
98*8817535bSAndreas Gohr		<script>
99*8817535bSAndreas Gohr			$(function() {
100*8817535bSAndreas Gohr				function tabsToSpaces(line, tabsize) {
101*8817535bSAndreas Gohr					var out		= '',
102*8817535bSAndreas Gohr						tabsize = tabsize || 4,
103*8817535bSAndreas Gohr						c;
104*8817535bSAndreas Gohr					for (c in line) {
105*8817535bSAndreas Gohr						var ch = line.charAt(c);
106*8817535bSAndreas Gohr						if (ch === '\t') {
107*8817535bSAndreas Gohr							do {
108*8817535bSAndreas Gohr								out += ' ';
109*8817535bSAndreas Gohr							} while (out.length % tabsize);
110*8817535bSAndreas Gohr						} else {
111*8817535bSAndreas Gohr							out += ch;
112*8817535bSAndreas Gohr						}
113*8817535bSAndreas Gohr					}
114*8817535bSAndreas Gohr					return out;
115*8817535bSAndreas Gohr				}
116*8817535bSAndreas Gohr
117*8817535bSAndreas Gohr				function visualizeElement(element, type) {
118*8817535bSAndreas Gohr					var code		= $(element).html().split('\n'),
119*8817535bSAndreas Gohr						tabsize		= 4,
120*8817535bSAndreas Gohr						minlength	= 2E53,
121*8817535bSAndreas Gohr						l;
122*8817535bSAndreas Gohr
123*8817535bSAndreas Gohr					// Convert tabs to spaces
124*8817535bSAndreas Gohr					for (l in code) {
125*8817535bSAndreas Gohr						code[l] = tabsToSpaces(code[l], tabsize);
126*8817535bSAndreas Gohr					}
127*8817535bSAndreas Gohr
128*8817535bSAndreas Gohr
129*8817535bSAndreas Gohr					// determine minimum length
130*8817535bSAndreas Gohr					var minlength = 2E53;
131*8817535bSAndreas Gohr					var first = 2E53;
132*8817535bSAndreas Gohr					var last = 0;
133*8817535bSAndreas Gohr					for (l in code) {
134*8817535bSAndreas Gohr						if (/\S/.test(code[l])) {
135*8817535bSAndreas Gohr							minlength = Math.min(minlength, /^\s*/.exec(code[l])[0].length);
136*8817535bSAndreas Gohr							first = Math.min(first, l);
137*8817535bSAndreas Gohr							last = Math.max(last, l);
138*8817535bSAndreas Gohr						}
139*8817535bSAndreas Gohr					}
140*8817535bSAndreas Gohr
141*8817535bSAndreas Gohr					code = code.slice(first, last + 1);
142*8817535bSAndreas Gohr
143*8817535bSAndreas Gohr					// strip tabs at start
144*8817535bSAndreas Gohr					for (l in code) {
145*8817535bSAndreas Gohr						code[l] = code[l].slice(minlength);
146*8817535bSAndreas Gohr					}
147*8817535bSAndreas Gohr
148*8817535bSAndreas Gohr					// recombine
149*8817535bSAndreas Gohr					code = code.join('\n');
150*8817535bSAndreas Gohr
151*8817535bSAndreas Gohr					var fragment = $('<pre class="prettyprint"><code/></pre>').text(code).insertAfter(element);
152*8817535bSAndreas Gohr					$('<h3 class="clickable">'+type+'&hellip;</h3>').insertBefore(fragment).click(function() {
153*8817535bSAndreas Gohr						fragment.slideToggle();
154*8817535bSAndreas Gohr					});
155*8817535bSAndreas Gohr				}
156*8817535bSAndreas Gohr
157*8817535bSAndreas Gohr				// extract html fragments
158*8817535bSAndreas Gohr				$('div.prettyprint, span.prettyprint').each(function() {
159*8817535bSAndreas Gohr					visualizeElement(this, 'HTML');
160*8817535bSAndreas Gohr				});
161*8817535bSAndreas Gohr
162*8817535bSAndreas Gohr				// extract scripts
163*8817535bSAndreas Gohr				$('script.prettyprint').each(function() {
164*8817535bSAndreas Gohr					visualizeElement(this, 'Javascript');
165*8817535bSAndreas Gohr				});
166*8817535bSAndreas Gohr
167*8817535bSAndreas Gohr				// Include the readme
168*8817535bSAndreas Gohr				var markdown = new Markdown.Converter();
169*8817535bSAndreas Gohr				$.get('README.md', function(readme) {
170*8817535bSAndreas Gohr					$('#readme').html(markdown.makeHtml(readme));
171*8817535bSAndreas Gohr					$('#readme h1').each(function() {
172*8817535bSAndreas Gohr						$(this).nextUntil('h1').wrapAll('<div class="chapter"/>');
173*8817535bSAndreas Gohr					});
174*8817535bSAndreas Gohr					$('#readme pre').addClass('prettyprint');
175*8817535bSAndreas Gohr					prettyPrint();
176*8817535bSAndreas Gohr
177*8817535bSAndreas Gohr					// build menu
178*8817535bSAndreas Gohr					var menuitems = [];
179*8817535bSAndreas Gohr					$('h1').each(function() {
180*8817535bSAndreas Gohr						var text	= $(this).text(),
181*8817535bSAndreas Gohr							id		= $(this).attr('id') || 'chapter '+text;
182*8817535bSAndreas Gohr						$(this).attr('id', id);
183*8817535bSAndreas Gohr						menuitems.push('<a href="#'+id+'">'+text+'</a>');
184*8817535bSAndreas Gohr					});
185*8817535bSAndreas Gohr					$(menu).html(menuitems.join(' &mdash; '));
186*8817535bSAndreas Gohr				}, 'html');
187*8817535bSAndreas Gohr			});
188*8817535bSAndreas Gohr		</script>
189*8817535bSAndreas Gohr    </head>
190*8817535bSAndreas Gohr    <body>
191*8817535bSAndreas Gohr		<a href="https://github.com/vanderlee/php-sentence"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
192*8817535bSAndreas Gohr
193*8817535bSAndreas Gohr		<div id="menu"></div>
194*8817535bSAndreas Gohr
195*8817535bSAndreas Gohr		<div id="book">
196*8817535bSAndreas Gohr			<div id="readme"></div>
197*8817535bSAndreas Gohr		</div>
198*8817535bSAndreas Gohr
199*8817535bSAndreas Gohr		<div id="footer">
200*8817535bSAndreas Gohr			Copyright &copy; 2016 Martijn van der Lee. MIT Open Source license applies.
201*8817535bSAndreas Gohr		</div>
202*8817535bSAndreas Gohr	</body>
203*8817535bSAndreas Gohr</html>
204