Skip to content

Commit

Permalink
build PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored Jun 4, 2024
1 parent be6815a commit b83aba2
Show file tree
Hide file tree
Showing 4 changed files with 968 additions and 0 deletions.
148 changes: 148 additions & 0 deletions base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:[email protected]&display=swap');
@import url("https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css");
@import url("https://cdnjs.cloudflare.com/ajax/libs/prism-themes/1.9.0/prism-coldark-cold.min.css");


html,
code {
font-family: 'Jetbrains Mono', ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
font-variant-ligatures: none;
}

pre {
white-space: pre-wrap;
margin: 0;
}

div.content {
padding: 0.3em 0;
border-top: 1px solid;
border-bottom: 1px solid;
}

h1,
h2,
h3,
h4,
h5,
h6 {
margin-block-start: 0.2em;
margin-block-end: 0.2em;
padding-block-start: 0.3em;
padding-block-end: 0.3em;
break-after: avoid;
}

a {
color: currentColor;
}

h1#title {
font-weight: 800;
}

.section {
background-color: #005a8e99;
color: #ffffff;
}

h2.section {
margin-left: -0.5mm;
margin-right: -0.5mm;
padding-left: 1.5mm;
}

div.filename {
display: flex;
justify-content: space-between;
align-items: baseline;
}

/* 印刷時の設定 */
@media print {

body {
column-count: 2;
column-rule: 1px solid;
column-gap: 6mm;
}

@page {
size: A4 portrait;
margin: 8mm 2.5mm 2.5mm 2.5mm;

/* ヘッダー */
@top-left {
content: "tatyam/ICPC_notebook";
}

@top-right {
content: "Page " counter(page) " of " counter(pages);
}
}
}

/* 目次にページ数を付加する */
nav#toc ol {
list-style: none;
}

nav#toc>ol {
padding-left: 0;
}

nav#toc a {
display: inline-flex;
width: 100%;
text-decoration: none;
align-items: baseline;
}

nav#toc a.section {
padding-left: 0.5em;
}

nav#toc>ol>ol>li>a::before {
margin-left: 0.5em;
margin-right: 0.5em;
border-bottom: 1px dotted;
content: '';
order: 1;
flex: auto;
}

nav#toc>ol>ol>li>a::after {
text-align: right;
content: target-counter(attr(href), page);
align-self: flex-end;
flex: none;
order: 2;
}

/* 表に罫線をつける */
table {
border-spacing: 0;
border-top: 1px solid lightgray;
border-left: 1px solid lightgray;
}
td, th {
border-bottom: 1px solid lightgray;
border-right: 1px solid lightgray;
padding: 4px;
}

/* シンタックスハイライトの色を調整 */
.token.attr-name,
.token.boolean,
.token.boolean.important,
.token.number,
.token.constant,
.token.selector .token.attribute {
color: #001575;
}
.content {
break-before: avoid;
}
.content-md {
font-family: sans-serif;
}
26 changes: 26 additions & 0 deletions notebook.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* generated by build/build.js */
@import url("base.css");

html,
code {
font-size: 7.4pt;
}

nav#toc {
break-after: column;
}

@media print {
body {
column-count: 2;
}

@page {
size: A4 portrait;

/* ヘッダー */
@top-left {
content: "tatyam/ICPC_notebook";
}
}
}
Loading

0 comments on commit b83aba2

Please sign in to comment.