Browse Source

Add floating toc in documentation.html

main
Manos Pitsidianakis 9 months ago
parent
commit
191cd7d883
Signed by: epilys GPG Key ID: 73627C2F690DF710
4 changed files with 112 additions and 64 deletions
  1. +7
    -61
      css/default.css
  2. +89
    -2
      css/manpage.css
  3. +0
    -1
      src/main.rs
  4. +16
    -0
      templates/documentation.hbs

+ 7
- 61
css/default.css View File

@ -405,7 +405,7 @@ kbd.□.▭ {
padding: 13px 5px;
/* box-shadow: 2px 3px #8e897a; */
box-shadow: 3px 5px #8e897a, 2px 0px 2px -1px inset #bbb, -1px 0px 2px -1px inset #bbb, -2px 3px #8e897a, -3px 5px #8e897a, 3px 5px #8e897a, -2px 3px #8e897a, 2px 3px #8e897a, 2px 3px #8e897a;
margin: .5rem .5rem .6rem .25rem;
margin:.5rem .25rem 0rem 0rem;
}
kbd..:active {
@ -455,7 +455,7 @@ kbd.□ {
display: none;
}
body {
padding:0 5%;
padding:0 8px;
}
header {
margin:.5rem 0 2.0rem 0;
@ -484,6 +484,9 @@ kbd.□ {
z-index: 1;
padding:0;
}
body {
padding:0 5%;
}
header nav a {
margin:0 0 0 1.2rem;
display:inline;
@ -933,51 +936,6 @@ top: 0px;
padding: .4em;
}
div.mandoc {
max-width: 100vw;
min-width: 100vw;
}
nav.nav-doc {
/* fallback in case max-content is not supported by the browser */
max-width: 100%;
max-width: max-content;
border: 1px solid black;
padding: .4rem 1rem .4rem 2rem;
background: var(--color-bg);
box-shadow: 5px 5px darkgrey;
margin-bottom: 1rem;
}
nav.nav-doc ul {
list-style: square;
}
main.article-doc {
display: grid;
grid-template-columns: minmax(auto, 50em);
grid-auto-rows: minmax(auto, 0fr);
width: 100%;
place-content: center;
}
main.article-doc > * {
grid-column: 1 / span 1;
width: 100%;
max-width: 100%;
}
article.article-doc {
max-width: 50em;
background: var(--color-bg);
}
article.article-doc2 {
margin: 0 auto;
background: var(--color-bg);
}
.screenshots-page {
display: flex;
flex-wrap: wrap;
@ -1017,18 +975,6 @@ code.Nm::after {
}
/* Documentation */
span.notice-info {
padding: .5rem;
border: 2px dashed grey;
margin-bottom: 15px;
background: var(--color-bg);
display: inline-block;
}
/*! * * * * * * * * * * * * * * * * * * * *\
CSShake :: shake-little
v1.5.0
@ -1167,8 +1113,8 @@ code.Nm:hover::after,
}
.logo::after {
transition: all 6.1s cubic-bezier(.68,-0.55,.27,1.55);
.logo::after {
transition: all 6.1s cubic-bezier(.68,-0.55,.27,1.55);
}
.logo:hover::after {
content: "🌸";

+ 89
- 2
css/manpage.css View File

@ -52,7 +52,8 @@ h1.Sh {
section.Sh {
border-left: 1px dashed #979696;
padding-left: 2rem;
padding-left: 5px;;
padding-left: min(2rem, 2vw);
overflow-x: auto;
}
@ -123,7 +124,12 @@ dd {
.Bd.Pp {
padding: .2rem;
max-width: min(100%, 85vw);
}
.manual-text {
max-width: 95vw;
width: 100%;
}
.Bd.Bd-indent {
@ -160,6 +166,7 @@ ol.Bl-enum li {
overflow-x: auto;
max-width: max-content;
margin: auto;
margin-bottom: 5px;
box-shadow: 5px 5px #737373;
}
@ -224,3 +231,83 @@ code.Li {
margin: revert;
color: revert;
}
/* Documentation */
span.notice-info {
padding: .5rem;
border: 2px dashed grey;
margin-bottom: 15px;
background: var(--color-bg);
display: inline-block;
}
div.mandoc {
max-width: 100vw;
min-width: 100vw;
}
nav.nav-doc {
/* fallback in case max-content is not supported by the browser */
max-width: 100%;
max-width: max-content;
border: 1px solid black;
padding: .4rem 1rem .4rem 2rem;
background: var(--color-bg);
box-shadow: 5px 5px darkgrey;
margin-bottom: 1rem;
grid-column: 3 / span 1 !important;
grid-row: 1;
height: max-content;
max-height: max-content;
}
nav.nav-doc.sticky {
display: none;
top: 2rem;
position:sticky;
overflow: hidden;
margin-left: 2rem;
}
@media (min-width: 75em) {
nav.nav-doc {
display: none;
}
nav.nav-doc.sticky {
display: block;
}
}
nav.nav-doc ul {
list-style: square;
}
main.article-doc {
display: grid;
grid-template-columns: 1fr minmax(auto, 50em) 1fr;
grid-auto-rows: minmax(auto, 0fr);
width: 100%;
place-content: center;
}
main.article-doc > * {
grid-column: 2 / span 1;
width: 100%;
max-width: 100%;
}
article.article-doc {
max-width: 50em;
background: var(--color-bg);
}
article.article-doc2 {
margin: 0 auto;
background: var(--color-bg);
}

+ 0
- 1
src/main.rs View File

@ -226,7 +226,6 @@ fn main() -> Result<(), Box> {
Ok(Default::default())
})),
libssg::Renderer::LoadAndApplyTemplate("templates/documentation.hbs"),
libssg::Renderer::LoadAndApplyTemplate("templates/default_page.hbs"),
libssg::Renderer::LoadAndApplyTemplate("templates/default.hbs"),
]),
libssg::pandoc(),

+ 16
- 0
templates/documentation.hbs View File

@ -1,3 +1,18 @@
<nav class="nav-doc sticky">
<p><span style="border-bottom: 1px solid black">Contents:</span></p>
<ul>
<li><a href="#quick-start">Quick start tutorial</a></li>
<li>Manual Pages
<ul>
<li><a href="#meli.1">meli(1)</a> documentation for using the application</li>
<li><a href="#meli.conf.5">meli.conf(5)</a> documentation for the configuration file</li>
<li><a href="#meli-themes.5">meli-themes(5)</a> documentation for custom themes</li>
</ul>
</li>
</ul>
</nav>
<article>
<h1>{{ title }}</h1>
<span class="notice-info">Technical documentation: You can view the rustdoc generated documentation <a href="https://meli.delivery/rustdoc/meli/index.html">here</a></span>
<nav class="nav-doc">
<p><span style="border-bottom: 1px solid black">Contents:</span></p>
@ -38,3 +53,4 @@
</article>
<hr />
<a href="#">[go back]</a>
</article>

Loading…
Cancel
Save