file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
js/learn-arith.js
JavaScript
(function() { let s = document.getElementById('arith'); if (!s) { s = document.currentScript; if (!s) return alert('抱歉,本程序不支持您的古董浏览器,请尝试使用 Chrome/Firefox/Edge 等现代浏览器'); } document.querySelector('.arith') || s.insertAdjacentHTML('afterend', '<style type="text/css">' + '.arith{border:none}.arith tr:nt...
yihui/arith.js
6
简单的四则运算练习程序
JavaScript
yihui
Yihui Xie
rstudio swissre merck
R/build.R
R
blogdown::build_dir('static')
yihui/blogdown-static
9
A minimal example of building Rmd files under the static/ directory of a website based on blogdown and Hugo
HTML
yihui
Yihui Xie
rstudio swissre merck
static/slides/libs/remark-css/example.css
CSS
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); body { font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Mi...
yihui/blogdown-static
9
A minimal example of building Rmd files under the static/ directory of a website based on blogdown and Hugo
HTML
yihui
Yihui Xie
rstudio swissre merck
static/slides/xaringan.html
HTML
<!DOCTYPE html> <html> <head> <title>Presentation Ninja</title> <meta charset="utf-8"> <meta name="author" content="Yihui Xie" /> <link href="libs/remark-css/example.css" rel="stylesheet" /> </head> <body> <textarea id="source"> class: center, middle, inverse, title-slide # Presentation Ninja...
yihui/blogdown-static
9
A minimal example of building Rmd files under the static/ directory of a website based on blogdown and Hugo
HTML
yihui
Yihui Xie
rstudio swissre merck
build.R
R
# TODO: use CRAN version of xfun (>= 0.26) install.packages('remotes') remotes::install_github('yihui/xfun') db = available.packages(type = 'source') all_pkgs = rownames(db) ver = paste(unlist(getRversion())[1:2], collapse = '.') # version x.y dir = file.path('bin/macosx/contrib', ver) # no openmp support cat('\nSH...
yihui/homebrew-cran-extra
23
A "CRAN extras" repository of some binary R packages for the Homebrew (cask) version of base R on macOS
R
yihui
Yihui Xie
rstudio swissre merck
exampleSite/layouts/partials/disqus.html
HTML
{{ if and (not (eq .Site.Config.Services.Disqus.Shortname "")) (not .Params.disable_comments) }} <section class="comments"> <div id="disqus_thread"></div> <script> var disqus_config = function () { {{ with .Site.Params.disqusURL }} this.page.url = "{{ . }}" + {{ if eq $.Type "404" }} "/404.html" {{ else }} ...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
exampleSite/layouts/partials/foot_custom.html
HTML
{{ if .Section }} <nav class="post-nav"> <span class="nav-prev">{{ with .PrevInSection }}&larr; <a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ end }}</span> <span class="nav-next">{{ with .NextInSection }}<a href="{{ .RelPermalink }}">{{ .Title }}</a> &rarr;{{ end }}</span> </nav> {{ end }} {{ partial "disqus.ht...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
exampleSite/layouts/partials/head_custom.html
HTML
<link rel="stylesheet" href="{{ "/css/custom.css" | relURL }}" />
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
exampleSite/static/css/custom.css
CSS
.hljs { padding: 1em; }
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/404.html
HTML
{{ partial "header.html" . }} 404 NOT FOUND {{ partial "footer.html" . }}
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_default/list.html
HTML
{{ partial "header.html" . }} {{ .Content }} <ul> {{ range (where (cond .IsHome .Site.RegularPages .Pages) "Section" "!=" "") }} <li> <span class="date">{{ .Date.Format "2006/01/02" }}</span> <a href="{{ .RelPermalink }}">{{ .Title }}</a> </li> {{ end }} </ul> {{ partial "footer.html" . }}
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_default/single.html
HTML
{{ partial "header.html" . }} {{ if .Params.show_toc }} {{ .TableOfContents }} {{ end }} {{ if (and (eq (getenv "HUGO_BLOGDOWN_POST_RELREF") "") (and (and .Params.date (lt (now.AddDate 0 0 ($.Site.Params.holdDays | default -90)) .Date)) (in (string .Content) "<!--# ON_HOLD -->"))) }} {{ (index (split .Content "<!--# ...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_default/terms.html
HTML
{{ partial "header.html" . }} <ul class="terms"> {{ range $key, $value := .Data.Terms }} <li> <a href="{{ (print "/" $.Data.Plural "/" $key | urlize) | relURL }}"> {{ $key }} </a> ({{ len $value }}) </li> {{ end }} </ul> {{ partial "footer.html" . }}
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/footer.html
HTML
<footer> {{ partial "foot_custom.html" . }} {{ partial "footer_highlightjs" . }} {{ with .Site.Params.footer }} <hr> <div class="copyright">{{ replace . "{Year}" now.Year | markdownify }}</div> {{ end }} </footer> </article> {{ template "_internal/google_analytics.html" . }} </body> </html>
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/footer_highlightjs.html
HTML
{{ if and (not .Params.disable_highlight) (in (string .Content) "</pre>") }} {{ $highVer := .Site.Params.highlightjsVersion }} {{ if (not (eq $highVer "")) }} {{ $highJS := (print "//cdn.jsdelivr.net/combine/gh/highlightjs/cdn-release@" $highVer "/build/highlight.min.js") }} {{ range (union .Site.Params.highlightjsLang...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/head_highlightjs.html
HTML
{{ if and (not .Params.disable_highlight) (in (string .Content) "</pre>") }} {{ $highTheme := .Site.Params.highlightjsTheme }} {{ with .Site.Params.highlightjsVersion }} <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@{{ . }}/build/styles/{{ $highTheme }}.min.css"> {{ end }} {{ end }}
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/header.html
HTML
<!DOCTYPE html> {{ partial "html_open.html" . }} <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> {{ if eq .RelPermalink "/" }} <title>{{ .Site.Title }}</title> <meta property="og:title" content="{{ .Site.Title }}"> <meta property="og:type" con...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/html_open.html
HTML
<html lang="{{ .Site.LanguageCode }}">
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/menu.html
HTML
<nav class="menu"> <input id="menu-check" type="checkbox" hidden/> <label id="menu-label" for="menu-check" class="unselectable" hidden> <span class="icon close-icon">✕</span> <span class="icon open-icon">☰</span> <span class="text">Menu</span> </label> <ul> {{ $currentPage := . }} {{ range (defa...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/meta.html
HTML
{{ if not .IsHome }} <h1>{{ .Title }}</h1> {{ with .Params.subtitle }}<h2 class="subtitle">{{ . }}</h2>{{ end }} {{ $author := false }} {{ if .IsPage }} <h3>{{ with or (or .Params.author (index (or .Site.Params.author dict) .Section)) "" }} {{ $author = . }} {{ . }} {{ end }} {{ $date := "" }} {{ if .Params.date }} {{ ...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/tagline.html
HTML
<h1><a href="{{ relURL "/" }}">{{ .Site.Title }}</a></h1> {{ with .Site.Params.Description }}<p class="tagline">{{ . }}</p>{{ end }}
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
static/css/fonts.css
CSS
body { font-family: Optima, 'Lucida Sans', Calibri, Candara, Arial, 'source-han-serif-sc', 'Source Han Serif SC', 'Source Han Serif CN', 'Source Han Serif TC', 'Source Han Serif TW', 'Source Han Serif', 'Noto Serif CJK SC', 'Songti SC', 'Microsoft YaHei', sans-serif; } code { font-family: "Lucida Console", 'Andale ...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
static/css/style.css
CSS
/* Micro Reset */ html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } body { margin: 0; padding: 0; } button, input, select, textarea, label { margin: 0; padding: 0; font-family: inherit; fo...
yihui/hugo-ivy
297
A two-column Hugo theme ported from Ivy
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/404.html
HTML
{{ partial "header.html" . }} <h1 class="title">404 NOT FOUND</h1> {{ partial "footer.html" . }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/foot_custom.html
HTML
{{- if (in .Content "</dl>") -}} <script src="//cdn.jsdelivr.net/npm/@xiee/utils/js/dl-fieldset.min.js" defer></script> {{ end }} {{- $has_code := (in .Content "</code></pre>") -}} {{- $has_img := (in .Content `<img `) -}} {{- $has_toc := .Scratch.Get "has_toc" -}} {{- if $has_toc -}} <script src="//cdn.jsdelivr.net/np...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/footer.html
HTML
<footer class="small"> {{ partial "foot_custom.html" . }} {{ if .Site.Params.footer }} {{ if not $.IsHome }} <hr/> {{ end }} <p class="nav-bottom"> <span>{{ replace .Site.Params.footer "{Year}" now.Year | markdownify }}</span> <span class="menu-bottom">{{ partial "menu_extra.html" . }}</span> </...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/head_custom.html
HTML
<link rel="stylesheet" href="https://indestructibletype.com/fonts/Jost.css">
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/header.html
HTML
<!DOCTYPE html> {{ partial "html_open.html" . }} <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> {{ if eq .RelPermalink "/" }} <title>{{ .Site.Title }}</title> <meta property="og:title" content="{{ .Site.Title }}"> <meta property="og:type" con...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/html_open.html
HTML
<html lang="{{ .Site.LanguageCode }}">
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/menu_extra.html
HTML
{{ if not .IsHome }} {{ markdownify "[Categories](/categories/) [Tags](/tags/)" }} {{ with .Section }} <a href="{{ relURL . }}/index.xml" type="application/rss+xml" title="RSS feed">Subscribe</a> {{ end }} <a href="#">Back to Top</a> {{ end }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/meta.html
HTML
{{ if .IsPage }} {{ with or (or .Params.author (index (or .Site.Params.author dict) (or ($.Scratch.Get "lang") .Section))) "" }} <span class="author">{{ . }}</span> {{ end }} {{ $date := "" }} {{ if .Params.date }} {{ $date = .Date.Format "2006-01-02" }} {{ else }} {{ with .Lastmod }} {{ $date = .Format "2006-01-02" }}...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/post_nav.html
HTML
{{ if .Section }} <nav class="post-nav fullwidth"> <span>{{ with .NextInSection }}&larr; <a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>{{ end }}</span> <span>{{ with .PrevInSection }}<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a> &rarr;{{ end }}</span> </nav> {{ end }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/summary.html
HTML
{{ $summary := "" }} {{ if .Description }} {{ $summary = (markdownify .Description) }} {{ else }} {{ $summary = ((delimit (findRE "(?s)(<p.*?>.*?</p>)" .Content) "[&hellip;] ") | plainify | truncate (default 200 $.Site.Params.summary_length) (default " &hellip;" $.Site.Params.text.truncated ) | replaceRE "&amp;" "&...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/toc-list.html
HTML
{{ $toc := partial "toc.html" . }} {{ replace $toc `<a href="#` (print "<a href=\"" .RelPermalink "#") | replaceRE "(?s)<nav ?.*?>|</nav>" "" | replaceRE "^\\s*<ul>" `<ul class="toc-list">` | safeHTML }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_partials/toc.html
HTML
{{ replaceRE `(?s)(<nav [^>]+>)\s*<ul>\s*<li>(\s*<ul>.+?</ul>)\s*</li>\s*</ul>(\s*</nav>)` `$1$2$3` .TableOfContents | safeHTML }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/baseof.list.html
HTML
{{ partial "header.html" . }} {{if .IsHome }} <div class="home"> {{ .Content }} </div> {{ else }} <h1 class="title">{{ .Title | markdownify }}{{ if eq .Kind "term" }}<span class="small subtitle"> | <a href="{{ urlize .Type | relURL }}/">{{ .Type }}</a></span>{{ end }}</h1> {{ with .Params.subtitle }}<h2 class="subtitl...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/blog/list.html
HTML
{{ define "summary" }} <blockquote>{{ partial "summary.html" . }}</blockquote> {{ end }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/docs/list.html
HTML
{{ define "summary" }} {{ partial "toc-list.html" . }} {{ end }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/list.html
HTML
{{ define "summary" }} {{ end }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/single.html
HTML
{{ partial "header.html" . }} <div class="article-meta"> <h1 class="title">{{ .Title | markdownify }}</h1> {{ with .Params.subtitle }}<h2 class="subtitle">{{ . | markdownify }}</h2>{{ end }} <h3 class="meta-line"> <span>{{ partial "meta.html" . }}</span> <span class="term"> {{ with .Params.categories }} {{ rang...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/taxonomy.html
HTML
{{ partial "header.html" . }} <main class="main fullwidth"> <h1 class="title">{{ .Title }}</h1> <ul class="terms"> {{ range .Data.Terms }} <li> <a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> ({{ .Count }}) </li> {{ end }} </ul> </main> {{ partial "footer.html" . }}
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
static/css/fonts.css
CSS
@font-face { font-family: 'Linden Hill'; font-style: normal; src: url('https://cdn.jsdelivr.net/gh/theleagueof/linden-hill/webfonts/LindenHill-webfont.woff') format('woff'); } @font-face { font-family: 'Linden Hill'; font-style: italic; src: url('https://cdn.jsdelivr.net/gh/theleagueof/linden-hill/webfonts/...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
static/css/style.css
CSS
:root { --body-width: 992px; --text-width: 620px; --bg-body: white; --bg-block: #f9f9f9; --border-color: #ddd; --box-shadow: 5px 5px 5px #eee; } * { box-sizing: border-box; } body { max-width: var(--body-width); min-height: calc(100vh - 3em); background-color: var(--bg-body); margin: auto; paddi...
yihui/hugo-paged
48
A Hugo theme with the feel of printed media (inspired by paged.js)
HTML
yihui
Yihui Xie
rstudio swissre merck
exampleSite/content/post/2020-11-10-r-markdown-demo/index.html
HTML
--- title: "R Markdown Demo" author: "Yihui Xie" date: '2020-11-10' slug: r-markdown-demo bibliography: packages.bib --- <div id="floats" class="section level2"> <h2>Floats</h2> <div id="full-width-figures" class="section level3"> <h3>Full-width figures</h3> <p>Use a fenced <code>Div</code> with the class <code>full...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
exampleSite/content/post/2020-11-10-r-markdown-demo/index_files/header-attrs/header-attrs.js
JavaScript
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to // be compatible with the behavior of Pandoc < 2.8). document.addEventListener('DOMContentLoaded', function(e) { var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); var i, h, a; for (i = 0; i < hs.length; ...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
exampleSite/layouts/shortcodes/blogdown/postref.html
HTML
{{ if eq (getenv "HUGO_BLOGDOWN_POST_RELREF") "true" }}{{ .Page.RelPermalink }}{{ else }}{{ .Page.Permalink }}{{ end }}
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/404.html
HTML
{{ partial "header.html" . }} <div class="container"> <main> <h1>404 NOT FOUND</h1> </main> </div> {{ partial "footer.html" . }}
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_default/list.html
HTML
{{ partial "header.html" . }} <div class="container list"> <main> {{ if not .IsHome }} <h1>{{ .Title }}</h1> {{ end }} {{ with .Content }} <section class="article-list"> <div>{{ . }}</div> </section> {{ end }} {{ if .IsHome }} {{ range $i, $p := (where .Site.RegularPages "Section" "card") }} <section class="article-...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_default/single.html
HTML
{{ partial "header.html" . }} <div class="container single"> <main> {{ if .Draft }} <div class="watermark">Draft</div> {{ end }} <div class="article-meta"> <h1><span class="title">{{ .Title }}</span></h1> {{ with .Params.author }} <h3 class="author"> {{ if reflect.IsSlice . }}{{ delimit . (default " / " $.Site.Params....
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_default/sitemap.html
HTML
{{ partial "header.html" . }} <div class="container"> <main> <h1>{{ .Title }}</h1> {{ .Content }} {{ range .Site.RegularPages.GroupBy "Section" }} <section class="article-list normal-card"> <h2 class="archive-title"><a href="{{ print "/" .Key "/" | relURL }}">{{ .Key | pluralize | title }}</a></h2> <ul> {{...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/_default/terms.html
HTML
{{ partial "header.html" . }} <main class="container"> <h1>{{ .Title }}</h1> <ul class="terms"> {{ range (index .Site.Taxonomies (.Title | lower)) }} <li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }} <span class="bg-number">{{ .Count }}</span></a></li> {{ end }} </ul> </main> {{ partial "footer.html" . ...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/appendix.html
HTML
<section class="appendix"> {{ if $.Site.Data.authors }} {{ if .Params.author }} <div> <div class="side side-left"><h3>{{ i18n "authorsBio" }}</h3></div> <div>{{ partial "bio.html" . }}</div> </div> {{ end }} {{ end }} {{ range $key, $value := .Params.appendix }} <div> <div class="side side-left"><h3>{{ $key | ti...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/bio.html
HTML
{{ with .Params.author }} {{ $author := . }} {{ if not (reflect.IsSlice $author) }} {{ $author = (slice $author) }} {{ end }} {{ range (where $.Site.Data.authors "name" "in" $author) }} <div>{{ .bio | markdownify }}</div> {{ end }} {{ end }}
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/correction.html
HTML
{{ if (and .File .Site.Params.editLink) }} <div> <div class="side side-left"><h3>{{ i18n "suggestChanges" }}</h3></div> {{ $filePath := path.Clean .File.Path }} {{ $RmdFile := (print .File.Dir .File.BaseFileName ".Rmd") }} {{ if (fileExists (print "content/" $RmdFile)) }} {{ $filePath = $RmdFile }} {{ els...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/disqus.html
HTML
<!-- copied from https://github.com/rbind/yihui/blob/master/layouts/partials/disqus.html --> {{ if and (not (eq .Site.Config.Services.Disqus.Shortname "")) (and (not .Params.disable_comments) (or (eq .Kind "404") (and (not .IsHome) .Content))) }} <section class="comments"> <div id="disqus_thread"></div> <script> ...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/foot_custom.html
HTML
{{ with .Site.Params.fuseVersion }} <script src="https://cdn.jsdelivr.net/npm/fuse.js@{{ . }}"></script> {{ end }} {{ if and (not .Params.disable_mathjax) (or (in (string .Content) "\\") (in (string .Content) "$")) }} <script src="//yihui.org/js/math-code.js"></script> <script async src="//mathjax.rstudio.com/latest/M...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/footer.html
HTML
<footer> {{ partial "foot_custom.html" . }} <div class="footer"> {{ with .Site.Params.footer }} <ul class="copyright"> <li>{{ . | markdownify }}</li> </ul> {{ end }} <ul> {{ range .Site.Menus.footer }} <li{{ with .Pre }} class="{{ . }}"{{ end }}{{ with .Identifier }} id="{{ . }}"{{ end }}> ...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/head_custom.html
HTML
{{ template "_internal/twitter_cards.html" . }}
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
layouts/partials/header.html
HTML
<!DOCTYPE html> <html lang="{{ .Site.LanguageCode }}"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>{{ with .Title }} {{ . }} | {{ end }}{{ .Site.Title }}</title> <!-- uncomme...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
static/css/fonts.css
CSS
body { font-family: Optima, Candara, Calibri, "Droid Sans", Arial, sans-serif; } code { font-family: "Lucida Console", Monaco, monospace; font-size: 85%; } h1, h2, h3 { font-family: Palatino, Book Antiqua, serif; }
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
static/css/style.css
CSS
/* overall layout */ * { box-sizing: border-box; } body { margin: 0 auto 0; line-height: 1.5; overflow-x: hidden; } main, .menu ul, .footer, .single section, .post-nav { max-width: 800px; margin: 0 auto 0; } main { display: block; hyphens: auto; } .list main { display: flex; flex-wrap: wrap; justify...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
static/js/features.js
JavaScript
(function(d) { // move <figcaption> out of <figure> (and p.caption out of div.figure) so that <figure> can scroll d.querySelectorAll('.fullscroll figure > figcaption, .fullscroll .figure > .caption').forEach(el => { el.parentNode.after(el); }); // make TOC stiky beneath the top menu const menu = d.queryS...
yihui/hugo-prose
112
A Hugo theme derived from the XMin theme, and inspired by Wowchemy, Distill, and tufte.css
HTML
yihui
Yihui Xie
rstudio swissre merck
compile.R
R
options(repos = "https://cran.rstudio.com") dir.create('~/R', showWarnings = FALSE) .libPaths('~/R') # install xfun and tinytex pkg_install = function(...) install.packages(..., quiet = TRUE) pkg_install('xfun') options(xfun.install.package = pkg_install) xfun::pkg_load2(c('tinytex', 'rmarkdown')) # install TinyTeX s...
yihui/latex-pass
52
Help you pass the LaTeX compilation by telling you which LaTeX packages are missing to compile your documents
R
yihui
Yihui Xie
rstudio swissre merck
latex-pass.R
R
.libPaths('~/R') pp = readRDS('packages.rds') p1 = pp[[1]]; p2 = pp[[2]] one_string = function(..., s = ' ') paste(..., collapse = s) msg = c( if (length(p1)) c('The missing packages identified from the LaTeX log are:\n\n ', one_string(p1)), if (length(p2)) c('\n\nAdditional packages required to compile your d...
yihui/latex-pass
52
Help you pass the LaTeX compilation by telling you which LaTeX packages are missing to compile your documents
R
yihui
Yihui Xie
rstudio swissre merck
build.sh
Shell
#!/bin/sh set -e npm install lightningcss-cli terser -g cd js for i in *.js; do terser $i --compress --mangle --source-map "url='${i%.*}.min.js.map'" --output ${i%.*}.min.js done cd ../css for i in *.css; do lightningcss --minify --sourcemap -o ${i%.*}.min.css $i done cd ..
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/article.css
CSS
:root { --side-width: 200px; --side-gap: 2em; --side-margin: calc(0px - var(--side-width) - var(--side-gap)); } body, blockquote, .side { background: #fafafa; } .body, .body ~ .appendix, .frontmatter, .fullwidth, .embed-left, .embed-right { margin-top: 2em; padding: 1em; box-shadow: 0 0 8px #ccc; backgrou...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/book-litedown.css
CSS
/* CSS for https://yihui.org/litedown/ */ /* hide 4th-level TOC items when printing to PDF and 3rd-level in chapter TOC */ .pagesjs #TOC > ul > li > ul > li > ul > li > ul, .chapter-toc > ul > li > ul > li > ul { display: none; } .pagesjs { #tab\:assets tr > :nth-child(2) { display: none; } } .epigraph { ...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/book.css
CSS
body { font-size: 1em; font-family: Palatino, Georgia, serif; } .footnotes, code, .side, .body .side, .chapter-toc { font-size: .85em; } .frontmatter, .chapter { min-height: calc(100vh - 1em); } .frontmatter { background-image: radial-gradient(#b6cee2 1px, #fff 1px); background-size: 2em 2em; background: ...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/callout.css
CSS
fieldset { font-size: .9em; margin: 1em auto; } legend { font-weight: bold; border-style: groove; padding: 2px .5em; background: white; } .callout { legend::before { content: var(--callout-icon); } legend::after { content: attr(data-legend); text-transform: uppercase; } background: var...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/circled-numbers.css
CSS
/* Add circled numbers to h2 and TOC items generated by Hugo */ #TableOfContents, #TableOfContents ~ p:first-of-type { counter-reset: circled-numbers; } h2:not([class])::before, #TableOfContents > ul > li > ul > li::before { counter-increment: circled-numbers; content: counter(circled-numbers); border-radius: 50...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/code-line-numbers.css
CSS
span[data-line-number]::before { content: attr(data-line-number); padding-right: .5em; margin-right: 1em; display: inline-block; border-right: solid 1px; color: #ccc; }
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/copy-button.css
CSS
.copy-button { position: absolute; display: none; cursor: pointer; inset: 5px 5px auto auto; width: 1em; height: 1em; border: 1px solid; box-shadow: -3px 3px #999; } :is(:focus, :hover) > .copy-button { display: inline-block; } .copy-success { box-shadow: none; background: #999; transition: box-...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/default.css
CSS
body { font-family: sans-serif; max-width: 800px; margin: auto; padding: 1em; line-height: 1.5; print-color-adjust: exact; -webkit-print-color-adjust: exact; } body, .abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; } li li { font-size: .95em; } ul:has(li > input[type="checkbox"]) { ...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/docco-classic.css
CSS
/* Derived from the Docco package by Jeremy Ashkenas: https://github.com/jashkenas/docco/ */ body { font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; line-height: 1.5; color: #30404f; margin: 0; padding: 0; } h1, h2, h3, h4, h5, h6 { color: #112233; font-weight: normal; margi...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/faq.css
CSS
.faq-button { cursor: pointer; float: right; margin-left: 1em; } .faq-list { & > li { border: 1px solid #eee; padding: .5em; & > :first-child { display: block; cursor: pointer; background: #fafafa; margin: -.5em; padding: .5em; } } & > :not(.faq-clicked) > * { d...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/heading-anchor.css
CSS
.anchor { &:not(:hover > *) { display: none; } & > a::before { content: "#"; } }
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/key-buttons.css
CSS
kbd { border: 2px solid #ccc; box-shadow: 2px 2px #999; display: inline-block; padding: 0 5px; border-radius: 0.25em; min-width: 1.5em; text-align: center; margin-right: .15em; } kbd:hover { position: relative; top: 2px; left: 2px; }
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/manual.css
CSS
/* mainly for litedown::pkg_manual() */ .table-full, h3[id^="sec:arguments"] + table { width: 100%; td { vertical-align: baseline; & > p { &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } dt { font-weight: bold; } .side .pkg-desc dd { margin: 0 0 .5em; } code.fade:...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/pages.css
CSS
:root { --paper-width: 210mm; --paper-height: 297mm; --paper-margin-top: 40px; --paper-margin-right: 80px; --paper-margin-bottom: 40px; --paper-margin-left: 80px; --page-header-height: 40px; --page-header-bottom: 40px; --page-footer-height: 40px; --page-footer-top: 40px; } @page { size: var(--pape...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/prism-xcode.css
CSS
/** * Prism.s theme ported from highlight.js's xcode style */ .token { &.comment { color: #007400; } &.punctuation { color: #999; } &.tag, &.selector { color: #aa0d91; } &.boolean, &.number, &.constant, &.symbol { color: #1c00cf; } &.property, &.attr-name, &.string, &.char, &.builtin { color: #c41a16; } &...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/site.css
CSS
nav > p:last-child { border-bottom: 1px dashed #666; } footer { border-top: 1px dashed #666; margin-top: 2em; .flex-col { gap: 2em; } } nav a, footer a { text-decoration: none; } nav a { display: inline-block; background: white; padding: .2em .5em; margin-right: .5em; } nav a:hover { backgroun...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/snap.css
CSS
:root { --slide-width: 100%; } html { scroll-snap-type: y mandatory; } th, td { padding: .2em .5em; } .slide { padding: 0 1em; background-color: #fff; } .slide, :is(.frontmatter, .middle) .main { display: flex; flex-direction: column; } .slide { & > .main { flex-grow: 1; } & > .header { margin-bottom: 1em; } ...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
css/tabsets.css
CSS
.tabset { &:has(.tab-link) { margin-top: 1em; margin-bottom: 1em; } &:is(.tabset *) { margin: .5em auto; } } .tab-link, .tab-pane { border: 1px solid rgba(0, 0, 0, .05); border-radius: 5px 5px 0 0; padding: .2em .5em; &.active { border-color: rgba(0, 0, 0, .5); } } .tab-link { display: inline-block; mar...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/alt-title.js
JavaScript
[...document.getElementsByTagName('img')].forEach(el => { if (el.alt) { el.alt = el.alt.replace(/\n/g, ' '); if (!el.title) el.title = el.alt; } });
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/appendix.js
JavaScript
// find <h[1-6] class="appendix"> and either add the class 'appendix' to // wrappers of appendix elements or create a new <div> next to the parent // element to hold all appendix elements (d => { const h = d.querySelector([1, 2, 3, 4, 5, 6].map(i => `h${i}.appendix`).join(',')); if (!h) return; h.classList.remove...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/callout.js
JavaScript
// turn <div class="callout-*"> to <fieldset><legend>* document.querySelectorAll('div[class^="callout-"]').forEach(el => { const f = document.createElement('fieldset'); f.className = el.className; f.classList.add('callout'); // if the data-legend attribute exists, use its value as legend, otherwise use the class ...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/center-img.js
JavaScript
(d => { function one_child(el) { if (el.childElementCount !== 1) return false; const nodes = el.childNodes; if (nodes.length === 1) return true; for (let i in nodes) { let node = nodes[i]; if (node.nodeName === '#text' && !/^\s$/.test(node.textContent)) return false; } return true;...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/chapter-toc.js
JavaScript
// copy chapter TOC to each chapter's first page (under h1) (d => { d.querySelector('.chapter-toc') || d.querySelectorAll('#TOC > ul > li > a[href^="#"]').forEach(a => { const id = a.getAttribute('href'), h = d.getElementById(id.replace(/^#/, '')); if (h?.tagName !== 'H1') return; const h2 = h.nextElement...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/code-lang.js
JavaScript
// add 'language-' prefix to <code> inside <pre> for syntax highlighters to work (e.g., prism.js) document.querySelectorAll('pre').forEach(pre => { const code = pre.querySelector('code'); // no code or already highlighted if (!code || code.querySelector('span')) return; const c1 = pre.className, c2 = code.class...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/code-line-numbers.js
JavaScript
// add line numbers to code blocks for <code class="line-numbers" [data-start=*]> (() => { function addNum(el) { const s = '<span data-line-number=""></span>', sel = 'span[data-line-number]'; if (el.querySelector(sel)) return; el.innerHTML = s + el.innerHTML.replace(/\n(?=.|\s)/g, '\n' + s); let n1 = ...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/comment-utils.js
JavaScript
(function(d) { function inIFrame() { let iframe = true; try { iframe = window.self !== window.top; } catch (e) {} return iframe; }; const a = d.querySelector('section.comments'); if (!a) return; // remove the comments section when in iframe (e.g., in RStudio Viewer) if (inIFrame()) { a.remov...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/copy-button.js
JavaScript
// add a button to elements to copy their content: https://yihui.org/en/2023/09/copy-button/ (d => { const cfg = d.currentScript?.dataset; d.querySelectorAll(cfg?.selector || 'pre>code, .copy-this').forEach(el => { const btn = d.createElement('span'), cls = btn.classList, c1 = 'copy-success', c2 = 'copy-f...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/custom-disqus.js
JavaScript
// lazyload Disqus on my personal site (function(d) { var inIFrame = function() { var iframe = true; try { iframe = window.self !== window.top; } catch (e) {} return iframe; }; if (inIFrame()) return; var t = d.getElementById('disqus_thread'), s = t.nextElementSibling, a = d.querySelector('sec...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/dl-fieldset.js
JavaScript
// convert <dl><dt>Title</dt><dd>Content</dd></dl> // to <fieldset><legend>Title</legend>Content</fieldset>; // see documentation at: https://yihui.org/en/2023/11/dl-fieldset/ document.querySelectorAll('dl').forEach(dl => { if (dl.childElementCount !== 2) return; const dt = dl.children[0], dd = dl.children[1]; if...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/docco-classic.js
JavaScript
// create a <table> of 2 columns; put <pre> in the right column and other elements in the left column (d => { // find the first <pre> and assume it to be the container all code blocks const c1 = d.querySelector('pre')?.parentNode; if (!c1) return; c1.insertAdjacentHTML('afterend', '<div class="container"><div c...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/docco-resize.js
JavaScript
jQuery.fn.disableTextSelect=function(){return this.each(function(){$(this).css({MozUserSelect:"none",webkitUserSelect:"none"}).attr("unselectable","on").bind("selectstart",function(){return false})})};jQuery.fn.enableTextSelect=function(){return this.each(function(){$(this).css({MozUserSelect:"",webkitUserSelect:""}).a...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/external-link.js
JavaScript
(d => { const r = /^(https?:)?\/\//; d.querySelectorAll('a').forEach(a => { if (!a.title) a.title = decodeURI(a.href); if (!r.test(a.getAttribute('href'))) return; // add _blank target to external links a.target = '_blank'; // shorten bare links if (a.childElementCount === 0 && r.test(a.inne...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/faq.js
JavaScript
(d => { const cls_list = 'faq-list', cls_clicked = 'faq-clicked'; function faq(el, id) { // each child of the list must have at least 2 child elements (one question // and one answer) const lis = el.children; if (lis.length === 0) return; for (let li of lis) { if (li.childElementCount < 2)...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/fix-footnote.js
JavaScript
(d => { // add [] to footnote numbers d.querySelectorAll('sup[id^="fnref:"] > a.footnote-ref, a.footnote-ref > sup').forEach(el => { if (!/^[0-9]+$/.test(el.innerText)) return; el.innerText = `[${el.innerText}]`; el.parentNode.before(d.createTextNode(' ')); }); // move the return symbol into the pre...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck
js/fix-pandoc.js
JavaScript
// move the class from <pre class="foo"> (generated by Pandoc with --no-highlight) // to <code class="language-foo"> so that Prism.js can highlight the code document.querySelectorAll('pre[class]:not([class^=language-])').forEach(el => { el.firstElementChild?.classList.add(`language-${el.classList[0]}`); el.removeAt...
yihui/lite.js
19
Miscellaneous lightweight tools and utilities in JavaScript
JavaScript
yihui
Yihui Xie
rstudio swissre merck