mirror of
https://github.com/danpros/htmly.git
synced 2026-04-20 20:46:26 +05:30
Styling the TOC
This commit is contained in:
parent
270b7f8e58
commit
8da38da937
10 changed files with 371 additions and 9 deletions
|
|
@ -628,4 +628,50 @@ ul.month {
|
||||||
display:inline;
|
display:inline;
|
||||||
margin:0 0 0 10px;
|
margin:0 0 0 10px;
|
||||||
float:right;
|
float:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
}
|
}
|
||||||
|
|
@ -211,7 +211,7 @@ h6 {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.in-front .post, .in-tag .post, .in-archive .post, .in-search .post, .in-profile .post {
|
.in-front .post, .in-tag .post, .in-archive .post, .in-search .post, .in-profile .post, .in-category .post, .in-blog .post, .in-type .post{
|
||||||
border-bottom: 1px solid #dfdfdf;
|
border-bottom: 1px solid #dfdfdf;
|
||||||
padding: 30px 0 10px 0;
|
padding: 30px 0 10px 0;
|
||||||
}
|
}
|
||||||
|
|
@ -949,4 +949,50 @@ ul.archivegroup {
|
||||||
.archivegroup li.expanded, .archivegroup li.collapsed, .archivegroup li.expanded li, .archivegroup li.collapsed li {
|
.archivegroup li.expanded, .archivegroup li.collapsed, .archivegroup li.expanded li, .archivegroup li.collapsed li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
background:none;
|
background:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
<?php echo $p->body; ?>
|
<?php echo $p->body; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="border"></div>
|
||||||
<div class="postnav">
|
<div class="postnav">
|
||||||
<?php if (!empty($next)): ?>
|
<?php if (!empty($next)): ?>
|
||||||
<span><a href="<?php echo($next['url']); ?>" class="pagination-arrow newer" rel="next"><?php echo($next['title']); ?></a></span>
|
<span><a href="<?php echo($next['url']); ?>" class="pagination-arrow newer" rel="next"><?php echo($next['title']); ?></a></span>
|
||||||
|
|
|
||||||
|
|
@ -3533,3 +3533,49 @@ body.dark .docs-bar .menu-icon .navicon::before, body.dark .docs-bar .menu-icon
|
||||||
.float-right {
|
.float-right {
|
||||||
float:right;
|
float:right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
@ -32,12 +32,6 @@ function htmlTableOfContents (documentRef) {
|
||||||
headings.forEach(function (heading, index) {
|
headings.forEach(function (heading, index) {
|
||||||
heading.setAttribute('id', 'toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase());
|
heading.setAttribute('id', 'toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase());
|
||||||
|
|
||||||
var anchor = documentRef.createElement('a');
|
|
||||||
anchor.setAttribute('href', '#toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase());
|
|
||||||
anchor.setAttribute('class', 'anchor');
|
|
||||||
anchor.setAttribute('aria-hidden', 'true');
|
|
||||||
anchor.textContent = '#';
|
|
||||||
|
|
||||||
var link = documentRef.createElement('a');
|
var link = documentRef.createElement('a');
|
||||||
link.setAttribute('href', '#toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase());
|
link.setAttribute('href', '#toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase());
|
||||||
link.textContent = heading.textContent;
|
link.textContent = heading.textContent;
|
||||||
|
|
@ -45,7 +39,6 @@ function htmlTableOfContents (documentRef) {
|
||||||
var div = documentRef.createElement('div');
|
var div = documentRef.createElement('div');
|
||||||
div.setAttribute('class', heading.tagName.toLowerCase() + '-toc');
|
div.setAttribute('class', heading.tagName.toLowerCase() + '-toc');
|
||||||
|
|
||||||
heading.appendChild(anchor);
|
|
||||||
div.appendChild(link);
|
div.appendChild(link);
|
||||||
toc.appendChild(div);
|
toc.appendChild(div);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -980,3 +980,49 @@ ul.archivegroup {
|
||||||
.archivegroup li.expanded, .archivegroup li.collapsed {
|
.archivegroup li.expanded, .archivegroup li.collapsed {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
@ -1030,4 +1030,50 @@ ul.archivegroup {
|
||||||
|
|
||||||
.archivegroup li.expanded, .archivegroup li.collapsed {
|
.archivegroup li.expanded, .archivegroup li.collapsed {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
}
|
}
|
||||||
|
|
@ -6139,4 +6139,50 @@ ul.month {
|
||||||
|
|
||||||
.feed-link a {
|
.feed-link a {
|
||||||
height:100%;
|
height:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
}
|
}
|
||||||
|
|
@ -6146,4 +6146,50 @@ ul.month {
|
||||||
|
|
||||||
.feed-link a {
|
.feed-link a {
|
||||||
height:100%;
|
height:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
}
|
}
|
||||||
|
|
@ -4065,4 +4065,50 @@ ul.month {
|
||||||
display:inline;
|
display:inline;
|
||||||
margin:0 0 0 10px;
|
margin:0 0 0 10px;
|
||||||
float:right;
|
float:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner {
|
||||||
|
margin-top:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-wrapper .inner a {
|
||||||
|
border: none;
|
||||||
|
box-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc .h3-toc {
|
||||||
|
margin-left: .20in;
|
||||||
|
}
|
||||||
|
.toc .h4-toc {
|
||||||
|
margin-left: .35in;
|
||||||
|
}
|
||||||
|
.toc .h5-toc {
|
||||||
|
margin-left: .50in;
|
||||||
|
}
|
||||||
|
.toc .h6-toc {
|
||||||
|
margin-left: .65in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-link a.anchor {
|
||||||
|
border:none;
|
||||||
|
margin-left: 5px;
|
||||||
|
box-shadow:none;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue