Skip to content

Commit

Permalink
为导出html的侧边栏设置自动编号
Browse files Browse the repository at this point in the history
  • Loading branch information
sumruler committed Dec 22, 2024
1 parent b3de265 commit 1378120
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 29 deletions.
39 changes: 30 additions & 9 deletions phycat/phycat.dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,13 @@ h4 {
h5 {
counter-reset: h6;
}

.sidebar-content {
counter-reset: h1
}

.outline-content {
counter-reset: h1
}
.outline-h1 {
counter-reset: h2
}
Expand Down Expand Up @@ -308,14 +311,16 @@ h5 {
counter-increment: h1;
content: var(--autonum-h1);
}

.outline-content .outline-h1>.outline-item>.outline-label:before{
counter-increment: h1;
content: var(--autonum-h1);
}
#write span.md-toc-item.md-toc-h1>a:before {
counter-increment: h1toc;
content: var(--autonum-h1toc);
}



#write h2:before {
counter-increment: h2;
content: var(--autonum-h2);
Expand All @@ -324,14 +329,16 @@ h5 {
counter-increment: h2;
content: var(--autonum-h2);
}

.outline-content .outline-h2>.outline-item>.outline-label:before {
counter-increment: h2;
content: var(--autonum-h2);
}
#write span.md-toc-item.md-toc-h2>a:before {
counter-increment: h2toc;
content: var(--autonum-h2toc);
}



#write h3 > span::before {
counter-increment: h3;
content: var(--autonum-h3);
Expand All @@ -340,7 +347,10 @@ h5 {
counter-increment: h3;
content: var(--autonum-h3);
}

.outline-content .outline-h3>.outline-item>.outline-label:before {
counter-increment: h3;
content: var(--autonum-h3);
}
#write span.md-toc-item.md-toc-h3>a:before {
counter-increment: h3toc;
content: var(--autonum-h3toc);
Expand All @@ -356,12 +366,16 @@ h5 {
counter-increment: h4;
content: var(--autonum-h4);
}

.outline-content .outline-h4>.outline-item>.outline-label:before {
counter-increment: h4;
content: var(--autonum-h4);
}
#write span.md-toc-item.md-toc-h4>a:before {
counter-increment: h4toc;
content: var(--autonum-h4toc);
}


#write h5 > span::before {
counter-increment: h5;
content: var(--autonum-h5);
Expand All @@ -370,12 +384,16 @@ h5 {
counter-increment: h5;
content: var(--autonum-h5);
}

.outline-content .outline-h5>.outline-item>.outline-label:before {
counter-increment: h5;
content: var(--autonum-h5);
}
#write span.md-toc-item.md-toc-h5>a:before {
counter-increment: h5toc;
content: var(--autonum-h5toc);
}


#write h6 > span::before {
counter-increment: h6;
content: var(--autonum-h6);
Expand All @@ -384,7 +402,10 @@ h5 {
counter-increment: h6;
content: var(--autonum-h6);
}

.outline-content .outline-h6>.outline-item>.outline-label:before {
counter-increment: h6;
content: var(--autonum-h6);
}
#write span.md-toc-item.md-toc-h6>a:before {
counter-increment: h6toc;
content: var(--autonum-h6toc);
Expand Down
49 changes: 29 additions & 20 deletions phycat/phycat.light.css
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ h6:after {
vertical-align: inherit;
}

/* 标题自动编号 Write区域*/
/* 标题自动编号 */
#write {
counter-reset: h1;
}
Expand Down Expand Up @@ -262,7 +262,9 @@ h5 {
.sidebar-content {
counter-reset: h1
}

.outline-content {
counter-reset: h1
}
.outline-h1 {
counter-reset: h2
}
Expand Down Expand Up @@ -314,25 +316,29 @@ h5 {
counter-increment: h1;
content: var(--autonum-h1);
}

#outline-content li.outline-h1>div>span.outline-label:before {
counter-increment: h1;
content: var(--autonum-h1);
}

.outline-content .outline-h1>.outline-item>.outline-label:before{
counter-increment: h1;
content: var(--autonum-h1);
}
#write span.md-toc-item.md-toc-h1>a:before {
counter-increment: h1toc;
content: var(--autonum-h1toc);
}


#write h2:before {
counter-increment: h2;
content: var(--autonum-h2);
color: var(--head-title-h2-color);
}

#outline-content li.outline-h2>div>span.outline-label:before {
.outline-content .outline-h2>.outline-item>.outline-label:before {
counter-increment: h2;
content: var(--autonum-h2);
}
li.outline-h2>div>a.outline-label:before {
counter-increment: h2;
content: var(--autonum-h2);
}
Expand All @@ -343,79 +349,82 @@ h5 {
}



#write h3>span::before {
counter-increment: h3;
content: var(--autonum-h3);
color: var(--element-color);
}

#outline-content li.outline-h3>div>span.outline-label:before {
counter-increment: h3;
content: var(--autonum-h3);
}

.outline-content .outline-h3>.outline-item>.outline-label:before {
counter-increment: h3;
content: var(--autonum-h3);
}
#write span.md-toc-item.md-toc-h3>a:before {
counter-increment: h3toc;
content: var(--autonum-h3toc);
}



#write h4>span::before {
counter-increment: h4;
content: var(--autonum-h4);
color: var(--element-color);
}

#outline-content li.outline-h4>div>span.outline-label:before {
counter-increment: h4;
content: var(--autonum-h4);
}

.outline-content .outline-h4>.outline-item>.outline-label:before {
counter-increment: h4;
content: var(--autonum-h4);
}
#write span.md-toc-item.md-toc-h4>a:before {
counter-increment: h4toc;
content: var(--autonum-h4toc);
}



#write h5>span::before {
counter-increment: h5;
content: var(--autonum-h5);
color: var(--element-color);
}

#outline-content li.outline-h5>div>span.outline-label:before {
counter-increment: h5;
content: var(--autonum-h5);
}

.outline-content .outline-h5>.outline-item>.outline-label:before {
counter-increment: h5;
content: var(--autonum-h5);
}
#write span.md-toc-item.md-toc-h5>a:before {
counter-increment: h5toc;
content: var(--autonum-h5toc);
}



#write h6>span::before {
counter-increment: h6;
content: var(--autonum-h6);
color: var(--element-color);
}

#outline-content li.outline-h6>div>span.outline-label:before {
counter-increment: h6;
content: var(--autonum-h6);
}

.outline-content .outline-h6>.outline-item>.outline-label:before {
counter-increment: h6;
content: var(--autonum-h6);
}
#write span.md-toc-item.md-toc-h6>a:before {
counter-increment: h6toc;
content: var(--autonum-h6toc);
}



/* 列表 */
::marker {
color: var(--element-color-deep);
Expand Down

0 comments on commit 1378120

Please sign in to comment.