index.php 5.73 KB
Newer Older
Mart Lubbers's avatar
Mart Lubbers committed
1
<!DOCTYPE html>
2
<html lang="en">
Mart Lubbers's avatar
Mart Lubbers committed
3
<head>
4
	<!-- cloogle/cloogle-org {{{COMMIT}}} -->
Mart Lubbers's avatar
Mart Lubbers committed
5
	<title>Cloogle</title>
Camil Staps's avatar
Camil Staps committed
6 7
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
8
	<meta name="description" content="Cloogle is a search engine for the Clean programming language"/>
9
	<meta name="keywords" content="Clean,Clean language,Concurrent Clean,search,functions,search engine,programming language,clean platform,iTasks,cloogle,hoogle"/>
10
	<script src="clean-highlighter/clean.js" defer="defer"></script>
11
	<script src="clean-doc-markup/clean-doc-markup.js" defer="defer"></script>
12 13
	<script src="common.js" defer="defer"></script>
	<script src="api.js" defer="defer"></script>
14
	<link rel="stylesheet" href="common.css" type="text/css"/>
15
	<link rel="stylesheet" href="clean-highlighter/clean.css" type="text/css"/>
16
	<link rel="stylesheet" href="frontend.css" type="text/css"/>
Mart Lubbers's avatar
Mart Lubbers committed
17 18
</head>
<body>
19
	<?php include('banners.php'); ?>
20 21
	<div id="header">
		<div id="logo">
22
			<a href="https://gitlab.science.ru.nl/cloogle/cloogle-org">
23
				<img src="logo.png" alt="follow link for the sourcecode" />
24 25 26
			</a>
		</div>
		<div id="search">
Camil Staps's avatar
Camil Staps committed
27
			<form id="search-form" action="#">
28
				<input id="search-str" spellcheck="false" autocapitalize="none" autocomplete="off"/>
29
				<button>Search</button><br/>
30 31 32 33 34 35
				<ul id="searchlinks">
					<li onclick="toggleAdvanced();this.classList.toggle('active');">Advanced</li>
					<li class="separator">|</li>
					<li onclick="toggleById('helptext');this.classList.toggle('active');">How to use</li>
					<li class="separator">|</li>
					<li onclick="toggleById('contributetext');this.classList.toggle('active');">Contribute</li>
Mart Lubbers's avatar
Mart Lubbers committed
36
					<li class="separator">|</li>
37
					<li onclick="shareButtonClick()" id="share-button">Share</li>
38 39 40
				</ul>
			</form>
		</div>
41
		<input id="share-link" type="text"/>
42 43
		<div id="advanced" class="tooltip">
			<div>
Camil Staps's avatar
Camil Staps committed
44 45
				<label><input type="checkbox" id="include-builtins" checked="checked"/> Include language builtins</label><br/>
				<label><input type="checkbox" id="include-core"/> Include library core modules</label><br/>
46
				<label><input type="checkbox" id="include-apps"/> Include apps</label><br/>
47
				<div id="libraries">
48 49 50 51 52 53 54 55
					<?php
						function make_group_id($name) {
							return 'libs-' . str_replace(' ', '-', $name);
						}

						$groups = json_decode(file_get_contents('/var/libs.json'), true);

						foreach ($groups as $group => $libs) {
56 57
							echo '<div class="libraries-list">';
							echo '<a class="libraries-heading" title="Toggle selection" href="javascript:toggleLibSelection(\'' . make_group_id($group) . '\')">' . $group . '</a>';
58
							echo '<div class="libraries-list-content" id="' . make_group_id($group) . '">';
59 60
							if ($group == 'Applications')
								echo '<p>Some modules in these libraries require that \'include apps\' is turned on.</p>';
61 62
							foreach ($libs as $lib) {
								echo '<label><input type="checkbox" class="search-libs" checked="checked" value="' . $lib['name'] . '"/> ' . $lib['name'];
63
								if (isset($lib['info_url'])) {
64
									echo ' <a class="more-info" href="' . $lib['info_url'] . '" target="_blank" title="More information">i</a>';
65
								}
66
								echo '</label>';
67
								echo '<br/>';
68
							}
69
							echo '</div></div>';
70 71
						}
					?>
72
				</div>
73
			</div>
74
		</div>
75 76
		<div id="helptext" class="tooltip">
			<div>
77
				<p>Cloogle is a search engine for the <a href="http://clean.cs.ru.nl">Clean</a> language.</p>
78
				<p>The following search strings are recognised:</p>
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
				<table>
					<tr>
						<td class='code'>hd</td>
						<td class='description'>Functions with a name like <code>hd</code></td>
					</tr>
					<tr>
						<td class='code'>:: a [a] -&gt; a</td>
						<td class='description'>Functions with a type unifiable with <code>a [a] -&gt; a</code></td>
					</tr>
					<tr>
						<td class='code'>hd :: [a] -&gt; a</td>
						<td class='description'>A combination of the above</td>
					</tr>
					<tr>
						<td class='code'>:: A.a: [a] -&gt; a</td>
Camil Staps's avatar
Camil Staps committed
94
						<td class='description'>Type search, where <code>a</code> cannot be unified</td>
95 96
					</tr>
					<tr>
Camil Staps's avatar
Camil Staps committed
97 98
						<td class='code'>\\</td>
						<td class='description'>Information about the syntax construct <code>\\</code></td>
99 100
					</tr>
					<tr>
Camil Staps's avatar
Camil Staps committed
101 102
						<td class='code'>stack overflow</td>
						<td class='description'>Information about the error message "stack overflow"</td>
103
					</tr>
104
					<tr>
105
						<td class='code'>using Maybe; ==</td>
106
						<td class='description'>Anything that uses <code>Maybe</code> <em>and</em> <code>==</code></td>
107
					</tr>
Camil Staps's avatar
Camil Staps committed
108
					<tr>
109 110
						<td class='code'>exact Text</td>
						<td class='description'>Anything with the exact name <code>Text</code></td>
Camil Staps's avatar
Camil Staps committed
111 112 113
					</tr>
					<tr>
						<td class='code'>class Text</td>
114
						<td class='description'>Classes with the exact name <code>Text</code></td>
Camil Staps's avatar
Camil Staps committed
115
					</tr>
116 117 118 119
					<tr>
						<td class='code'>type Maybe</td>
						<td class='description'>Types with the exact name <code>Maybe</code></td>
					</tr>
120
				</table>
121
				<p>Besides this web app, there are <a href="https://gitlab.science.ru.nl/cloogle/cloogle-org/#frontends">other frontends</a> available.</p>
122
				<p>You can also <a href="src">browse the index</a> and <a href="doc">read the documentation</a>.</p>
123 124 125 126 127
			</div>
		</div>
		<div id="contributetext" class="tooltip">
			<div>
				<p>
128 129
					Development takes place on <a href="https://gitlab.science.ru.nl/cloogle/cloogle-org">GitLab</a>.
					Please read the <a href="https://gitlab.science.ru.nl/cloogle/cloogle-org/blob/master/CONTRIBUTING.md">contributing guidelines</a> first.
130 131
				</p>
				<p>
132
					For bug reports, open an issue in the <a href="https://gitlab.science.ru.nl/cloogle/cloogle-org/issues">issue tracker</a>.
133 134 135 136
				</p>
			</div>
		</div>
	</div>
Camil Staps's avatar
Camil Staps committed
137
	<div id="search-results"></div>
Mart Lubbers's avatar
Mart Lubbers committed
138 139
</body>
</html>