Skip to content

Commit

Permalink
Python 対応
Browse files Browse the repository at this point in the history
  • Loading branch information
tatyam-prime committed Jun 1, 2024
1 parent 67b3266 commit e7577f0
Show file tree
Hide file tree
Showing 6 changed files with 329 additions and 7 deletions.
159 changes: 159 additions & 0 deletions .verify-helper/docs/static/notebook.html

Large diffs are not rendered by default.

Binary file modified .verify-helper/docs/static/notebook.pdf
Binary file not shown.
16 changes: 10 additions & 6 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const prism = require('prismjs');
const loadLanguages = require('prismjs/components/');
loadLanguages("c");
loadLanguages("cpp");
loadLanguages("python");
loadLanguages("sh");
const cp = require('child_process');
const marked = require('marked');
Expand Down Expand Up @@ -50,12 +51,15 @@ function addCode(folder, filename) {
if (filename.endsWith(".cpp") || filename.endsWith(".hpp")) {
return prism.highlight(text, prism.languages.cpp, "cpp");
}
if (filename.endsWith(".py")) {
return prism.highlight(text, prism.languages.python, "python");
}
if (filename.endsWith(".sh")) {
return prism.highlight(text, prism.languages.sh, "sh");
}
return html_escape(text);
})();

codeContent += `
<div class="content content-${filename.split('.').pop()}">`;
if (filename.endsWith(".md")) {
Expand All @@ -65,15 +69,15 @@ function addCode(folder, filename) {
<pre><code>${highlight_text}</code></pre>
`;
}

codeContent += '</div>\n';
}

for (const section of section_order) {
ToCContent += `
ToCContent += `
<li><a class="section" href="#${section}">${section}</a></li>
<ol>`;
codeContent += `
codeContent += `
<h2 class="section" id="${section}">${section}</h2>
`;

Expand All @@ -87,7 +91,7 @@ for (const section of section_order) {
</ol>`;
}

// HTML を出力
// build/notebook.html を出力
fs.writeFileSync("build/notebook.html", `<!DOCTYPE html>
<!-- generated by build/build.js -->
<html lang="en">
Expand Down Expand Up @@ -121,7 +125,7 @@ fs.writeFileSync("build/notebook.html", `<!DOCTYPE html>
</body>
</html>`);

// CSS を出力
// build/notebook.css を出力
fs.writeFileSync("build/notebook.css", `/* generated by build/build.js */
@import url("base.css");
Expand Down
Loading

0 comments on commit e7577f0

Please sign in to comment.