Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion otterwiki/renderer_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ def embedding_render(
+ '</ul></div>'
)

togglediv = f"""<div class="d-inline-block custom-switch font-size-12 mb-10" style="transform: translateY(-36px);float:right;">
togglediv = f"""<div class="d-inline-block custom-switch font-size-12 mb-10">
<input type="checkbox" id="switch-headings" {"checked" if show_toc else ""} value="" onchange="otterwiki.toggleClass(event.target.checked,'pagetoc')"><label for="switch-headings">Toggle page headings</label>
</div>"""

Expand Down
32 changes: 32 additions & 0 deletions otterwiki/static/css/elements/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,35 @@
margin: 0;
background-color: transparent;
}

.page .pageindex-header {
font-size: var(--content-title-font-size);
}

/* Embedded PageIndex: move heading toggle into the title row */
.pageindex-embedding {
position: relative;
}

/* The toggle immediately before an embedded index */
.pageindex-embedding:before {
content: "";
display: block;
}

/* Parent page title + toggle alignment */
article.page > h1 + .custom-switch {
float: right;
margin-top: -4.4rem;
margin-bottom: 0;
}

/* Recover the vertical space used by the old toggle position */
article.page > h1 + .custom-switch + .pageindex-embedding {
clear: both;
margin-top: -2.75rem;
}

article.page .pageindex-embedding {
padding-top: 0.1rem;
}
2 changes: 1 addition & 1 deletion otterwiki/templates/pageindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% block body_attrs %}data-index-path="{{ pagepath | slugify(keep_slashes=True) }}"{% endblock %}
{% block content %}
<div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center mb-10">
<h2 class="mb-0">{{ title }}</h2>
<h2 class="my-0">{{ title }}</h2>

<div class="custom-switch font-size-12">
<input
Expand Down