ci/treefmt: add biome (#435259)

+1 -2
.editorconfig
···
# see https://nixos.org/nixpkgs/manual/#chap-conventions
-
# Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces
-
[*.{bash,js,json,lock,md,nix,pl,pm,py,rb,sh,xml}]
+
[*.{bash,css,js,json,lock,md,nix,pl,pm,py,rb,sh,xml}]
indent_style = space
# Match docbook files, set indent width of one
+16
ci/default.nix
···
programs.actionlint.enable = true;
+
programs.biome = {
+
enable = true;
+
settings.formatter = {
+
useEditorconfig = true;
+
};
+
settings.javascript.formatter = {
+
quoteStyle = "single";
+
semicolons = "asNeeded";
+
};
+
settings.json.formatter.enabled = false;
+
};
+
settings.formatter.biome.excludes = [
+
"*.min.js"
+
"pkgs/*"
+
];
+
programs.keep-sorted.enable = true;
# This uses nixfmt underneath,
+57 -28
ci/github-script/commits.js
···
-
module.exports = async function ({ github, context, core, dry }) {
+
module.exports = async ({ github, context, core, dry }) => {
const { execFileSync } = require('node:child_process')
-
const { readFile } = require('node:fs/promises')
-
const { join } = require('node:path')
const { classify } = require('../supportedBranches.js')
const withRateLimit = require('./withRateLimit.js')
···
run_id: context.runId,
per_page: 100,
})
-
).find(({ name }) => name == 'Check / cherry-pick').html_url +
+
).find(({ name }) => name === 'Check / cherry-pick').html_url +
'?pr=' +
pull_number
async function extract({ sha, commit }) {
const noCherryPick = Array.from(
-
commit.message.matchAll(/^Not-cherry-picked-because: (.*)$/g)
+
commit.message.matchAll(/^Not-cherry-picked-because: (.*)$/g),
).at(0)
if (noCherryPick)
···
const fetch = extracted
.filter(({ severity }) => !severity)
-
.map(({ sha, original_sha }) => [ sha, original_sha ])
-
.flat()
+
.flatMap(({ sha, original_sha }) => [sha, original_sha])
if (fetch.length > 0) {
// Fetching all commits we need for diff at once is much faster than any other method.
···
])
}
-
const results = extracted.map(result => result.severity ? result : diff(result))
+
const results = extracted.map((result) =>
+
result.severity ? result : diff(result),
+
)
// Log all results without truncation, with better highlighting and all whitespace changes to the job log.
results.forEach(({ sha, commit, severity, message, colored_diff }) => {
···
// Only create step summary below in case of warnings or errors.
// Also clean up older reviews, when all checks are good now.
-
if (results.every(({ severity }) => severity == 'info')) {
+
if (results.every(({ severity }) => severity === 'info')) {
if (!dry) {
await Promise.all(
(
···
pull_number,
})
)
-
.filter((review) => review.user.login == 'github-actions[bot]')
+
.filter((review) => review.user.login === 'github-actions[bot]')
.map(async (review) => {
-
if (review.state == 'CHANGES_REQUESTED') {
+
if (review.state === 'CHANGES_REQUESTED') {
await github.rest.pulls.dismissReview({
...context.repo,
pull_number,
···
// In the case of "error" severity, we also fail the job.
// Those should be considered blocking and not be dismissable via review.
-
if (results.some(({ severity }) => severity == 'error'))
+
if (results.some(({ severity }) => severity === 'error'))
process.exitCode = 1
-
core.summary.addRaw('This report is automatically generated by the `PR / Check / cherry-pick` CI workflow.', true)
+
core.summary.addRaw(
+
'This report is automatically generated by the `PR / Check / cherry-pick` CI workflow.',
+
true,
+
)
core.summary.addEOL()
-
core.summary.addRaw("Some of the commits in this PR require the author's and reviewer's attention.", true)
+
core.summary.addRaw(
+
"Some of the commits in this PR require the author's and reviewer's attention.",
+
true,
+
)
core.summary.addEOL()
if (results.some(({ type }) => type === 'no-commit-hash')) {
-
core.summary.addRaw('Please follow the [backporting guidelines](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#how-to-backport-pull-requests) and cherry-pick with the `-x` flag.', true)
-
core.summary.addRaw('This requires changes to the unstable `master` and `staging` branches first, before backporting them.', true)
+
core.summary.addRaw(
+
'Please follow the [backporting guidelines](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#how-to-backport-pull-requests) and cherry-pick with the `-x` flag.',
+
true,
+
)
+
core.summary.addRaw(
+
'This requires changes to the unstable `master` and `staging` branches first, before backporting them.',
+
true,
+
)
core.summary.addEOL()
-
core.summary.addRaw('Occasionally, commits are not cherry-picked at all, for example when updating minor versions of packages which have already advanced to the next major on unstable.', true)
-
core.summary.addRaw('These commits can optionally be marked with a `Not-cherry-picked-because: <reason>` footer.', true)
+
core.summary.addRaw(
+
'Occasionally, commits are not cherry-picked at all, for example when updating minor versions of packages which have already advanced to the next major on unstable.',
+
true,
+
)
+
core.summary.addRaw(
+
'These commits can optionally be marked with a `Not-cherry-picked-because: <reason>` footer.',
+
true,
+
)
core.summary.addEOL()
}
if (results.some(({ type }) => type === 'diff')) {
-
core.summary.addRaw('Sometimes it is not possible to cherry-pick exactly the same patch.', true)
-
core.summary.addRaw('This most frequently happens when resolving merge conflicts.', true)
-
core.summary.addRaw('The range-diff will help to review the resolution of conflicts.', true)
+
core.summary.addRaw(
+
'Sometimes it is not possible to cherry-pick exactly the same patch.',
+
true,
+
)
+
core.summary.addRaw(
+
'This most frequently happens when resolving merge conflicts.',
+
true,
+
)
+
core.summary.addRaw(
+
'The range-diff will help to review the resolution of conflicts.',
+
true,
+
)
core.summary.addEOL()
}
-
core.summary.addRaw('If you need to merge this PR despite the warnings, please [dismiss](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/dismissing-a-pull-request-review) this review shortly before merging.', true)
+
core.summary.addRaw(
+
'If you need to merge this PR despite the warnings, please [dismiss](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/dismissing-a-pull-request-review) this review shortly before merging.',
+
true,
+
)
results.forEach(({ severity, message, diff }) => {
-
if (severity == 'info') return
+
if (severity === 'info') return
// The docs for markdown alerts only show examples with markdown blockquote syntax, like this:
// > [!WARNING]
···
// Whether this is intended or just an implementation detail is unclear.
core.summary.addRaw('<blockquote>')
core.summary.addRaw(
-
`\n\n[!${({ important: 'IMPORTANT', warning: 'WARNING', error: 'CAUTION' })[severity]}]`,
+
`\n\n[!${{ important: 'IMPORTANT', warning: 'WARNING', error: 'CAUTION' }[severity]}]`,
true,
)
core.summary.addRaw(`${message}`, true)
···
})
).find(
(review) =>
-
review.user.login == 'github-actions[bot]' &&
+
review.user.login === 'github-actions[bot]' &&
// If a review is still pending, we can just update this instead
// of posting a new one.
-
(review.state == 'CHANGES_REQUESTED' ||
+
(review.state === 'CHANGES_REQUESTED' ||
// No need to post a new review, if an older one with the exact
// same content had already been dismissed.
-
review.body == body),
+
review.body === body),
)
if (dry) {
if (pendingReview)
-
core.info('pending review found: ' + pendingReview.html_url)
+
core.info(`pending review found: ${pendingReview.html_url}`)
else core.info('no pending review found')
} else {
// Either of those two requests could fail for very long comments. This can only happen
+18 -17
ci/github-script/labels.js
···
-
module.exports = async function ({ github, context, core, dry }) {
+
module.exports = async ({ github, context, core, dry }) => {
const path = require('node:path')
const { DefaultArtifactClient } = require('@actions/artifact')
const { readFile, writeFile } = require('node:fs/promises')
···
const approvals = new Set(
reviews
-
.filter((review) => review.state == 'APPROVED')
+
.filter((review) => review.state === 'APPROVED')
.map((review) => review.user?.id),
)
···
// This is intentionally less than the time that Eval takes, so that the label job
// running after Eval can indeed label the PR as conflicted if that is the case.
const merge_commit_sha_valid =
-
new Date() - new Date(pull_request.created_at) > 3 * 60 * 1000
+
Date.now() - new Date(pull_request.created_at) > 3 * 60 * 1000
const prLabels = {
// We intentionally don't use the mergeable or mergeable_state attributes.
···
// The second pass will then read the result from the first pass and set the label.
'2.status: merge conflict':
merge_commit_sha_valid && !pull_request.merge_commit_sha,
-
'12.approvals: 1': approvals.size == 1,
-
'12.approvals: 2': approvals.size == 2,
+
'12.approvals: 1': approvals.size === 1,
+
'12.approvals: 2': approvals.size === 2,
'12.approvals: 3+': approvals.size >= 3,
'12.first-time contribution': [
'NONE',
···
// existing reviews, too.
'9.needs: reviewer':
!pull_request.draft &&
-
pull_request.requested_reviewers.length == 0 &&
-
reviews.length == 0,
+
pull_request.requested_reviewers.length === 0 &&
+
reviews.length === 0,
})
}
···
// called "comparison", yet, will skip the download.
const expired =
!artifact ||
-
new Date(artifact?.expires_at ?? 0) <
-
new Date(new Date().getTime() + 60 * 1000)
+
new Date(artifact?.expires_at ?? 0) < new Date(Date.now() + 60 * 1000)
log('Artifact expires at', artifact?.expires_at ?? '<n/a>')
if (!expired) {
stats.artifacts++
···
async function handle({ item, stats }) {
try {
const log = (k, v, skip) => {
-
core.info(`#${item.number} - ${k}: ${v}` + (skip ? ' (skipped)' : ''))
+
core.info(`#${item.number} - ${k}: ${v}${skip ? ' (skipped)' : ''}`)
return skip
}
···
// No need for an API request, if all labels are the same.
const hasChanges = Object.keys(after).some(
-
(name) => (before[name] ?? false) != after[name],
+
(name) => (before[name] ?? false) !== after[name],
)
if (log('Has changes', hasChanges, !hasChanges)) return
···
// Go back as far as the last successful run of this workflow to make sure
// we are not leaving anyone behind on GHA failures.
// Defaults to go back 1 hour on the first run.
-
new Date(lastRun?.created_at ?? new Date().getTime() - 1 * 60 * 60 * 1000).getTime(),
+
new Date(
+
lastRun?.created_at ?? Date.now() - 1 * 60 * 60 * 1000,
+
).getTime(),
// Go back max. 1 day to prevent hitting all API rate limits immediately,
// when GH API returns a wrong workflow by accident.
-
new Date().getTime() - 24 * 60 * 60 * 1000,
+
Date.now() - 24 * 60 * 60 * 1000,
),
)
-
core.info('cutoff timestamp: ' + cutoff.toISOString())
+
core.info(`cutoff timestamp: ${cutoff.toISOString()}`)
const updatedItems = await github.paginate(
github.rest.search.issuesAndPullRequests,
···
.concat(updatedItems, allItems.data)
.filter(
(thisItem, idx, arr) =>
-
idx ==
-
arr.findIndex((firstItem) => firstItem.number == thisItem.number),
+
idx ===
+
arr.findIndex((firstItem) => firstItem.number === thisItem.number),
)
;(await Promise.allSettled(items.map((item) => handle({ item, stats }))))
-
.filter(({ status }) => status == 'rejected')
+
.filter(({ status }) => status === 'rejected')
.map(({ reason }) =>
core.setFailed(`${reason.message}\n${reason.cause.stack}`),
)
+1 -1
ci/github-script/prepare.js
···
-
module.exports = async function ({ github, context, core }) {
+
module.exports = async ({ github, context, core }) => {
const pull_number = context.payload.pull_request.number
for (const retryInterval of [5, 10, 20, 40, 80]) {
+2 -2
ci/github-script/withRateLimit.js
···
-
module.exports = async function ({ github, core }, callback) {
+
module.exports = async ({ github, core }, callback) => {
const Bottleneck = require('bottleneck')
const stats = {
···
// Requests to a different host do not count against the rate limit.
if (options.url.startsWith('https://github.com')) return request(options)
// Requests to the /rate_limit endpoint do not count against the rate limit.
-
if (options.url == '/rate_limit') return request(options)
+
if (options.url === '/rate_limit') return request(options)
// Search requests are in a different resource group, which allows 30 requests / minute.
// We do less than a handful each run, so not implementing throttling for now.
if (options.url.startsWith('/search/')) return request(options)
+6 -2
ci/supportedBranches.js
···
}
function split(branch) {
-
return { ...branch.match(/(?<prefix>.+?)(-(?<version>\d{2}\.\d{2}|unstable)(?:-(?<suffix>.*))?)?$/).groups }
+
return {
+
...branch.match(
+
/(?<prefix>.+?)(-(?<version>\d{2}\.\d{2}|unstable)(?:-(?<suffix>.*))?)?$/,
+
).groups,
+
}
}
function classify(branch) {
const { prefix, version } = split(branch)
return {
stable: (version ?? 'unstable') !== 'unstable',
-
type: typeConfig[prefix] ?? [ 'wip' ]
+
type: typeConfig[prefix] ?? ['wip'],
}
}
+5 -3
doc/anchor-use.js
···
-
document.addEventListener('DOMContentLoaded', function(event) {
-
anchors.add('h1[id]:not(div.note h1, div.warning h1, div.tip h1, div.caution h1, div.important h1), h2[id]:not(div.note h2, div.warning h2, div.tip h2, div.caution h2, div.important h2), h3[id]:not(div.note h3, div.warning h3, div.tip h3, div.caution h3, div.important h3), h4[id]:not(div.note h4, div.warning h4, div.tip h4, div.caution h4, div.important h4), h5[id]:not(div.note h5, div.warning h5, div.tip h5, div.caution h5, div.important h5), h6[id]:not(div.note h6, div.warning h6, div.tip h6, div.caution h6, div.important h6)');
-
});
+
document.addEventListener('DOMContentLoaded', () => {
+
anchors.add(
+
'h1[id]:not(div.note h1, div.warning h1, div.tip h1, div.caution h1, div.important h1), h2[id]:not(div.note h2, div.warning h2, div.tip h2, div.caution h2, div.important h2), h3[id]:not(div.note h3, div.warning h3, div.tip h3, div.caution h3, div.important h3), h4[id]:not(div.note h4, div.warning h4, div.tip h4, div.caution h4, div.important h4), h5[id]:not(div.note h5, div.warning h5, div.tip h5, div.caution h5, div.important h5), h6[id]:not(div.note h6, div.warning h6, div.tip h6, div.caution h6, div.important h6)',
+
)
+
})
+205 -206
doc/style.css
···
html {
-
line-height: 1.15;
-
-webkit-text-size-adjust: 100%;
+
line-height: 1.15;
+
-webkit-text-size-adjust: 100%;
}
body {
-
margin: 0;
+
margin: 0;
}
.book,
.appendix {
-
margin: auto;
-
width: 100%;
+
margin: auto;
+
width: 100%;
}
@media screen and (min-width: 768px) {
-
.book,
-
.appendix {
-
max-width: 46rem;
-
}
+
.book,
+
.appendix {
+
max-width: 46rem;
+
}
}
@media screen and (min-width: 992px) {
-
.book,
-
.appendix {
-
max-width: 60rem;
-
}
+
.book,
+
.appendix {
+
max-width: 60rem;
+
}
}
@media screen and (min-width: 1200px) {
-
.book,
-
.appendix {
-
max-width: 73rem;
-
}
+
.book,
+
.appendix {
+
max-width: 73rem;
+
}
}
.book .list-of-examples {
-
display: none;
+
display: none;
}
h1 {
-
font-size: 2em;
-
margin: 0.67em 0;
+
font-size: 2em;
+
margin: 0.67em 0;
}
hr {
-
box-sizing: content-box;
-
height: 0;
-
overflow: visible;
+
box-sizing: content-box;
+
height: 0;
+
overflow: visible;
}
pre {
-
font-family: monospace, monospace;
-
font-size: 1em;
+
font-family: monospace;
+
font-size: 1em;
}
a {
-
background-color: transparent;
+
background-color: transparent;
}
strong {
-
font-weight: bolder;
+
font-weight: bolder;
}
code {
-
font-family: monospace, monospace;
-
font-size: 1em;
+
font-family: monospace;
+
font-size: 1em;
}
sup {
-
font-size: 75%;
-
line-height: 0;
-
position: relative;
-
vertical-align: baseline;
+
font-size: 75%;
+
line-height: 0;
+
position: relative;
+
vertical-align: baseline;
}
sup {
-
top: -0.5em;
+
top: -0.5em;
}
::-webkit-file-upload-button {
-
-webkit-appearance: button;
-
font: inherit;
+
-webkit-appearance: button;
+
font: inherit;
}
pre {
-
overflow: auto;
+
overflow: auto;
}
*,
*::before,
*::after {
-
box-sizing: border-box;
+
box-sizing: border-box;
}
html {
-
font-size: 100%;
-
line-height: 1.77777778;
+
font-size: 100%;
+
line-height: 1.77777778;
}
@media screen and (min-width: 4000px) {
-
html {
-
background: #000;
-
}
+
html {
+
background: #000;
+
}
-
html body {
-
margin: auto;
-
max-width: 250rem;
-
}
+
html body {
+
margin: auto;
+
max-width: 250rem;
+
}
}
@media screen and (max-width: 320px) {
-
html {
-
font-size: calc(16 / 320 * 100vw);
-
}
+
html {
+
font-size: calc(16 / 320 * 100vw);
+
}
}
body {
-
font-size: 1rem;
-
font-family: "Roboto", sans-serif;
-
font-weight: 300;
-
color: var(--main-text-color);
-
background-color: var(--background);
-
min-height: 100vh;
-
display: flex;
-
flex-direction: column;
+
font-size: 1rem;
+
font-family: "Roboto", sans-serif;
+
font-weight: 300;
+
color: var(--main-text-color);
+
background-color: var(--background);
+
min-height: 100vh;
+
display: flex;
+
flex-direction: column;
}
@media screen and (max-width: 767.9px) {
-
body {
-
padding-left: 1rem;
-
padding-right: 1rem;
-
}
+
body {
+
padding-left: 1rem;
+
padding-right: 1rem;
+
}
}
a {
-
text-decoration: none;
-
border-bottom: 1px solid;
-
color: var(--link-color);
+
text-decoration: none;
+
border-bottom: 1px solid;
+
color: var(--link-color);
}
ul {
-
padding: 0;
-
margin-top: 0;
-
margin-right: 0;
-
margin-bottom: 1rem;
-
margin-left: 1rem;
+
padding: 0;
+
margin-top: 0;
+
margin-right: 0;
+
margin-bottom: 1rem;
+
margin-left: 1rem;
}
table {
-
border-collapse: collapse;
-
width: 100%;
-
margin-bottom: 1rem;
+
border-collapse: collapse;
+
width: 100%;
+
margin-bottom: 1rem;
}
thead th {
-
text-align: left;
+
text-align: left;
}
hr {
-
margin-top: 1rem;
-
margin-bottom: 1rem;
+
margin-top: 1rem;
+
margin-bottom: 1rem;
}
h1 {
-
font-weight: 800;
-
line-height: 110%;
-
font-size: 200%;
-
margin-bottom: 1rem;
-
color: var(--heading-color);
+
font-weight: 800;
+
line-height: 110%;
+
font-size: 200%;
+
margin-bottom: 1rem;
+
color: var(--heading-color);
}
h2 {
-
font-weight: 800;
-
line-height: 110%;
-
font-size: 170%;
-
margin-bottom: 0.625rem;
-
color: var(--heading-color);
+
font-weight: 800;
+
line-height: 110%;
+
font-size: 170%;
+
margin-bottom: 0.625rem;
+
color: var(--heading-color);
}
h2:not(:first-child) {
-
margin-top: 1rem;
+
margin-top: 1rem;
}
h3 {
-
font-weight: 800;
-
line-height: 110%;
-
margin-bottom: 1rem;
-
font-size: 150%;
-
color: var(--heading-color);
+
font-weight: 800;
+
line-height: 110%;
+
margin-bottom: 1rem;
+
font-size: 150%;
+
color: var(--heading-color);
}
.note h3,
···
.warning h3,
.caution h3,
.important h3 {
-
font-size: 120%;
+
font-size: 120%;
}
h4 {
-
font-weight: 800;
-
line-height: 110%;
-
margin-bottom: 1rem;
-
font-size: 140%;
-
color: var(--heading-color);
+
font-weight: 800;
+
line-height: 110%;
+
margin-bottom: 1rem;
+
font-size: 140%;
+
color: var(--heading-color);
}
h5 {
-
font-weight: 800;
-
line-height: 110%;
-
margin-bottom: 1rem;
-
font-size: 130%;
-
color: var(--small-heading-color);
+
font-weight: 800;
+
line-height: 110%;
+
margin-bottom: 1rem;
+
font-size: 130%;
+
color: var(--small-heading-color);
}
h6 {
-
font-weight: 800;
-
line-height: 110%;
-
margin-bottom: 1rem;
-
font-size: 120%;
+
font-weight: 800;
+
line-height: 110%;
+
margin-bottom: 1rem;
+
font-size: 120%;
}
strong {
-
font-weight: bold;
+
font-weight: bold;
}
p {
-
margin-top: 0;
-
margin-bottom: 1rem;
+
margin-top: 0;
+
margin-bottom: 1rem;
}
dt > *:first-child,
dd > *:first-child {
-
margin-top: 0;
+
margin-top: 0;
}
dt > *:last-child,
dd > *:last-child {
-
margin-bottom: 0;
+
margin-bottom: 0;
}
pre,
code {
-
font-family: monospace;
+
font-family: monospace;
}
code {
-
color: #ff8657;
-
background: #f4f4f4;
-
display: inline-block;
-
padding: 0 0.5rem;
-
border: 1px solid #d8d8d8;
-
border-radius: 0.5rem;
-
line-height: 1.57777778;
+
color: #ff8657;
+
background: #f4f4f4;
+
display: inline-block;
+
padding: 0 0.5rem;
+
border: 1px solid #d8d8d8;
+
border-radius: 0.5rem;
+
line-height: 1.57777778;
}
div.book .programlisting,
div.appendix .programlisting {
-
border-radius: 0.5rem;
-
padding: 1rem;
-
overflow: auto;
-
background: var(--codeblock-background);
-
color: var(--codeblock-text-color);
+
border-radius: 0.5rem;
+
padding: 1rem;
+
overflow: auto;
+
background: var(--codeblock-background);
+
color: var(--codeblock-text-color);
}
div.book .note,
···
div.appendix .warning,
div.appendix .caution,
div.appendix .important {
-
margin-bottom: 1rem;
-
border-radius: 0.5rem;
-
padding: 1.5rem;
-
overflow: auto;
-
background: #f4f4f4;
+
margin-bottom: 1rem;
+
border-radius: 0.5rem;
+
padding: 1.5rem;
+
overflow: auto;
+
background: #f4f4f4;
}
div.book .note > .title,
···
div.appendix .warning > .title,
div.appendix .caution > .title,
div.appendix .important > .title {
-
font-weight: 800;
-
line-height: 110%;
-
margin-bottom: 1rem;
-
color: inherit;
-
margin-bottom: 0;
+
font-weight: 800;
+
line-height: 110%;
+
color: inherit;
+
margin-bottom: 0;
}
div.book .note > :first-child,
···
div.appendix .warning > :first-child,
div.appendix .caution > :first-child,
div.appendix .important > :first-child {
-
margin-top: 0;
+
margin-top: 0;
}
div.book .note > :last-child,
···
div.appendix .warning > :last-child,
div.appendix .caution > :last-child,
div.appendix .important > :last-child {
-
margin-bottom: 0;
+
margin-bottom: 0;
}
div.book .note,
div.book .tip,
div.appendix .note,
div.appendix .tip {
-
color: var(--note-text-color);
-
background: var(--note-background);
+
color: var(--note-text-color);
+
background: var(--note-background);
}
div.book .warning,
div.book .caution,
div.appendix .warning,
div.appendix .caution {
-
color: var(--warning-text-color);
-
background-color: var(--warning-background);
+
color: var(--warning-text-color);
+
background-color: var(--warning-background);
}
div.book .section,
div.appendix .section {
-
margin-top: 2em;
+
margin-top: 2em;
}
div.book div.example,
div.appendix div.example {
-
margin-top: 1.5em;
+
margin-top: 1.5em;
}
div.book div.example details,
div.appendix div.example details {
-
padding: 5px;
+
padding: 5px;
}
div.book div.example details[open],
div.appendix div.example details[open] {
-
border: 1px solid #aaa;
-
border-radius: 4px;
+
border: 1px solid #aaa;
+
border-radius: 4px;
}
div.book div.example details > summary,
div.appendix div.example details > summary {
-
cursor: pointer;
+
cursor: pointer;
}
div.book br.example-break,
div.appendix br.example-break {
-
display: none;
+
display: none;
}
div.book div.footnotes > hr,
div.appendix div.footnotes > hr {
-
border-color: #d8d8d8;
+
border-color: #d8d8d8;
}
div.book div.footnotes > br,
div.appendix div.footnotes > br {
-
display: none;
+
display: none;
}
div.book dt,
div.appendix dt {
-
margin-top: 1em;
+
margin-top: 1em;
}
div.book .toc dt,
div.appendix .toc dt {
-
margin-top: 0;
+
margin-top: 0;
}
div.book .list-of-examples dt,
div.appendix .list-of-examples dt {
-
margin-top: 0;
+
margin-top: 0;
}
div.book code,
div.appendix code {
-
padding: 0;
-
border: 0;
-
background-color: inherit;
-
color: inherit;
-
font-size: 100%;
-
-webkit-hyphens: none;
-
-moz-hyphens: none;
-
hyphens: none;
+
padding: 0;
+
border: 0;
+
background-color: inherit;
+
color: inherit;
+
font-size: 100%;
+
-webkit-hyphens: none;
+
-moz-hyphens: none;
+
hyphens: none;
}
div.book div.toc,
div.appendix div.toc {
-
margin-bottom: 3em;
-
border-bottom: 0.0625rem solid #d8d8d8;
+
margin-bottom: 3em;
+
border-bottom: 0.0625rem solid #d8d8d8;
}
div.book div.toc dd,
div.appendix div.toc dd {
-
margin-left: 2em;
+
margin-left: 2em;
}
div.book span.command,
div.appendix span.command {
-
font-family: monospace;
-
-webkit-hyphens: none;
-
-moz-hyphens: none;
-
hyphens: none;
+
font-family: monospace;
+
-webkit-hyphens: none;
+
-moz-hyphens: none;
+
hyphens: none;
}
div.book .informaltable th,
div.book .informaltable td,
div.appendix .informaltable th,
div.appendix .informaltable td {
-
padding: 0.5rem;
+
padding: 0.5rem;
}
div.book .variablelist .term,
div.appendix .variablelist .term {
-
font-weight: 500;
+
font-weight: 500;
}
/*
···
For more details, see https://highlightjs.readthedocs.io/en/latest/css-classes-reference.html#stylable-scopes
*/
.hljs-meta.prompt_ {
-
user-select: none;
-
-webkit-user-select: none;
+
user-select: none;
+
-webkit-user-select: none;
}
:root {
-
--background: #fff;
-
--main-text-color: #000;
-
--link-color: #405d99;
-
--heading-color: #6586c8;
-
--small-heading-color: #6a6a6a;
-
--note-text-color: #5277c3;
-
--note-background: #f2f8fd;
-
--warning-text-color: #cc3900;
-
--warning-background: #fff5e1;
-
--codeblock-background: #f2f8fd;
-
--codeblock-text-color: #000;
+
--background: #fff;
+
--main-text-color: #000;
+
--link-color: #405d99;
+
--heading-color: #6586c8;
+
--small-heading-color: #6a6a6a;
+
--note-text-color: #5277c3;
+
--note-background: #f2f8fd;
+
--warning-text-color: #cc3900;
+
--warning-background: #fff5e1;
+
--codeblock-background: #f2f8fd;
+
--codeblock-text-color: #000;
}
@media (prefers-color-scheme: dark) {
-
:root {
-
--background: #242424;
-
--main-text-color: #fff;
-
--link-color: #6586c8;
-
--small-heading-color: #fff;
-
--note-background: none;
-
--warning-background: none;
-
--codeblock-background: #393939;
-
--codeblock-text-color: #fff;
-
}
+
:root {
+
--background: #242424;
+
--main-text-color: #fff;
+
--link-color: #6586c8;
+
--small-heading-color: #fff;
+
--note-background: none;
+
--warning-background: none;
+
--codeblock-background: #393939;
+
--codeblock-text-color: #fff;
+
}
-
div.book .note,
-
div.book .tip,
-
div.appendix .note,
-
div.appendix .tip,
-
div.book .warning,
-
div.book .caution,
-
div.appendix .warning,
-
div.appendix .caution {
-
border: 2px solid;
-
font-weight: 400;
-
}
+
div.book .note,
+
div.book .tip,
+
div.appendix .note,
+
div.appendix .tip,
+
div.book .warning,
+
div.book .caution,
+
div.appendix .warning,
+
div.appendix .caution {
+
border: 2px solid;
+
font-weight: 400;
+
}
}
@font-face {
-
font-family: Roboto;
-
src: url(Roboto.ttf);
+
font-family: Roboto;
+
src: url(Roboto.ttf);
}