Skip to content

Commit

Permalink
添加折叠代码的按钮 (#94)
Browse files Browse the repository at this point in the history
* 添加折叠代码的按钮

* 加点样式

* 加粗“查看代码”
  • Loading branch information
yihui committed Sep 20, 2023
1 parent 6818d0f commit 3ff95e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</div>
{{ if .IsPage }}
<script src="{{ relURL "/js/wordcount.js" }}" defer></script>
<script src="https://cdn.jsdelivr.net/npm/@xiee/utils/js/fold-details.min.js" data-label="查看代码" data-button="true" data-button-label="展开/折叠文中代码" data-parent=".article-metadata:last-of-type" data-position="afterend" defer></script>
{{ end }}
{{ partial "footer_highlightjs" . }}
{{ partial "footer_mathjax" . }}
Expand Down
10 changes: 10 additions & 0 deletions static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ blockquote > p:first-child {
line-height: 1ex;
}

/* 代码按钮 */
#toggle-all {
font-size: inherit;
margin-left: 1em;
}
summary {
border-bottom: 1px solid #ddd;
font-weight: bold;
}

/* https://github.com/rstudio/bookdown/blob/main/inst/templates/default.html#L89-L113 */
/* Used with Pandoc 2.11+ new --citeproc when CSL is used */
div.csl-bib-body { }
Expand Down

0 comments on commit 3ff95e6

Please sign in to comment.