Verified Commit 841bb4da authored by Camil Staps's avatar Camil Staps 🚀

Layout improvements on /src and /doc

parent 8224c916
body.framelike {
margin: 0;
overflow: hidden;
}
body.framelike #logo {
margin-bottom: 1em;
max-width: 100%;
}
pre {
-moz-tab-size: 4;
-o-tab-size: 4;
......@@ -32,3 +42,67 @@ td, th {
#share-link {
display: none;
}
.browser-header {
margin-bottom: 0.2em;
}
.browser-item {
cursor: pointer;
font-weight: normal;
}
.browser-item.active {
font-style: italic;
}
.browser-item.directory .browser {
background-color: rgba(0, 0, 0, 0.05);
padding-left: 1em;
}
.browser-item {
padding-left: 1em;
text-indent: -1em;
}
#sidebar {
float: left;
overflow: auto;
padding: 10px 1em;
width: 15em;
}
#sidebar h3 {
margin-top: .2em;
}
#viewer {
margin-left: 16em;
overflow: auto;
}
#viewer #loading {
font-style: italic;
margin-top: 8em;
text-align: center;
}
@media (max-width: 800px) {
body {
overflow: auto;
}
#sidebar {
float: none;
overflow: initial;
width: calc(100% - 2em);
}
#viewer {
clear: both;
margin-left: 0;
overflow: initial;
}
}
......@@ -10,7 +10,6 @@
<script src="../browser.js" type="text/javascript" defer="defer"></script>
<script src="doc.js" type="text/javascript" defer="defer"></script>
<link rel="stylesheet" href="../common.css" type="text/css"/>
<link rel="stylesheet" href="../src/view.css" type="text/css"/>
<style type="text/css">
#viewer {
padding: 10px;
......@@ -41,14 +40,9 @@
a:visited {
color: blue !important;
}
.browser-item {
padding-left: 1em;
text-indent: -1em;
}
</style>
</head>
<body>
<body class="framelike">
<div id="sidebar">
<a href="/"><img id="logo" src="../logo.png" alt="Cloogle logo"/></a>
<h3>Documentation browser</h3>
......
......@@ -12,7 +12,7 @@
<link rel="stylesheet" href="../common.css" type="text/css"/>
<link rel="stylesheet" href="view.css" type="text/css"/>
</head>
<body>
<body class="framelike">
<div id="sidebar">
<a href="/"><img id="logo" src="../logo.png" alt="Cloogle logo"/></a>
<h3>Library browser</h3>
......
<?php
define('CLEANHOME', '/opt/clean');
define('CLEANLIB', CLEANHOME . '/lib');
$lib = isset($_GET['lib']) ? $_GET['lib'] : 'StdEnv';
$lib = preg_replace('/[^\\w\\/\\-]/', '', $lib);
......@@ -70,13 +71,55 @@ function makeBrowser($dir, $basemodule) {
foreach ($elems['modules'] as $m) {
$fullm = $basemodule . $m;
echo '<div class="browser-item module" data-name="' . $m . '">' . $m . '</span>' .
'</div>';
echo '<div class="browser-item module" data-name="' . $m . '">' . $m . '</div>';
}
echo '</div>';
}
$dname = CLEANHOME . '/lib';
$alllibs = [
'Clean 2.4' => [
'StdEnv',
'ArgEnv',
'Directory',
'Dynamics',
'Gast',
'Generics',
'MersenneTwister',
'StdLib',
'TCPIP',
],
'Official' => [
'GraphCopy',
'ObjectIO',
'Platform',
'Sapl',
'iTasks',
],
'Miscellaneous' => [
'CleanInotify',
'CleanPrettyPrint',
'CleanSerial',
'CleanSnappy',
'CleanTypeUnifier',
'Cloogle',
'SoccerFun',
'clean-compiler',
'clean-ide',
'libcloogle',
]
];
makeBrowser($dname, '');
echo '<div class="browser">';
foreach ($alllibs as $group => $libs) {
echo '<h4 class="browser-header">' . $group . '</h4>';
foreach ($libs as $lib) {
echo '<div class="browser-item directory toggle-container" data-name="' . $lib . '">' .
'<span class="toggler">' .
'<span class="toggle-icon">&#x229e</span>' .
'<span class="title">' . $lib . '</span></span>';
makeBrowser(CLEANLIB . '/' . $lib, '');
echo '</div>';
}
}
echo '</div>';
......@@ -72,82 +72,11 @@
.highlighttable .vm { color: #19177C } /* Name.Variable.Magic */
.highlighttable .il { color: #666666 } /* Literal.Number.Integer.Long */
body {
margin: 0;
overflow: hidden;
}
#sidebar {
float: left;
overflow: auto;
padding: 10px 1em;
width: 15em;
}
#sidebar h3 {
margin-top: .2em;
}
#logo {
margin-bottom: 1em;
max-width: 100%;
}
#select-lib {
margin-bottom: .8em;
}
#share-button {
margin-top: .8em;
}
#viewer {
margin-left: 16em;
overflow: auto;
}
#viewer #loading {
font-style: italic;
margin-top: 8em;
text-align: center;
}
.browser-item {
cursor: pointer;
font-weight: normal;
}
.browser-item.directory {
font-weight: bold;
}
.browser-item.active {
font-style: italic;
}
.browser-item.directory .browser {
background-color: rgba(0, 0, 0, 0.05);
padding-left: 1em;
}
@media (max-width: 800px) {
body {
overflow: auto;
}
#sidebar {
float: none;
overflow: initial;
width: calc(100% - 2em);
}
#viewer {
clear: both;
margin-left: 0;
overflow: initial;
}
}
.special {
.linenodiv .special {
cursor: pointer;
padding-left: .8em;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment