Skip to content

Commit

Permalink
Format build.js with prettier 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 25, 2025
1 parent 93a141e commit f206ea2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions book/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ while (dirs.length) {
const lang = langClass.replace('language-', '');
const lines = node.html().split('\n');
const boring = lines.map((line) =>
line.includes('<span class="boring">')
line.includes('<span class="boring">'),
);
const ellipsis = lines.map((line) => line.includes('// ...'));
const target = entities.decode(node.text());
Expand Down Expand Up @@ -105,7 +105,11 @@ while (dirs.length) {
foundScript = true;
}
});
const pathsWithoutScript = ['build/toc.html', 'build/build/index.html', 'build/binding/index.html'];
const pathsWithoutScript = [
'build/toc.html',
'build/build/index.html',
'build/binding/index.html',
];
if (!foundScript && !pathsWithoutScript.includes(path)) {
throw new Error('theme script not found');
}
Expand All @@ -121,5 +125,8 @@ fs.copyFileSync('build/highlight.css', 'build/ayu-highlight.css');
var bookjs = fs.readFileSync('build/book.js', 'utf8');
bookjs = bookjs
.replace('set_theme(theme, false);', '')
.replace('document.querySelectorAll("code.hljs")', 'document.querySelectorAll("code.hidelines")');
.replace(
'document.querySelectorAll("code.hljs")',
'document.querySelectorAll("code.hidelines")',
);
fs.writeFileSync('build/book.js', bookjs);

0 comments on commit f206ea2

Please sign in to comment.