generated from r-ca/md2pdf-meow
Initial commit
This commit is contained in:
commit
dae7cf9b22
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/node_modules/
|
||||
/work/
|
||||
/dist/
|
||||
.DS_Store
|
||||
/*/.DS_Store
|
9
LICENSE
Normal file
9
LICENSE
Normal file
|
@ -0,0 +1,9 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2024 r-ca
|
||||
|
||||
本ソフトウェアおよび関連する文書のファイル(以下「ソフトウェア」)の複製を取得した全ての人物に対し、以下の条件に従うことを前提に、本ソフトウェアを無制限に扱うことを無償で許可します。これには、本ソフトウェアの複製を使用、複製、改変、結合、公開、頒布、再許諾、および/または販売する権利、および本ソフトウェアを提供する人物に同様の行為を許可する権利が含まれますが、これらに限定されません。
|
||||
|
||||
上記の著作権表示および本許諾表示を、本ソフトウェアの全ての複製または実質的な部分に記載するものとします。
|
||||
|
||||
本ソフトウェアは「現状有姿」で提供され、商品性、特定目的への適合性、および権利の非侵害性に関する保証を含むがこれらに限定されず、明示的であるか黙示的であるかを問わず、いかなる種類の保証も行われません。著作者または著作権者は、契約、不法行為、またはその他の行為であるかを問わず、本ソフトウェアまたは本ソフトウェアの使用もしくはその他に取り扱いに起因または関連して生じるいかなる請求、損害賠償、その他の責任について、一切の責任を負いません。
|
7
README.md
Normal file
7
README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# md2pdf-meow 🐈
|
||||
|
||||
## 概要
|
||||
- WIP
|
||||
|
||||
## 移植元
|
||||
https://github.com/2SC1815J/md2pdf
|
205
css/custom.css
Executable file
205
css/custom.css
Executable file
|
@ -0,0 +1,205 @@
|
|||
@media screen {
|
||||
body {
|
||||
box-sizing: border-box;
|
||||
max-width: 980px;
|
||||
margin: 0 auto;
|
||||
padding: 30px 45px;
|
||||
}
|
||||
.markdown-body {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.FrontCover {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
.Footnote::before {
|
||||
content: "(";
|
||||
}
|
||||
.Footnote::after {
|
||||
content: ")";
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* github-markdown-cssのカスタマイズ */
|
||||
.markdown-body {
|
||||
/* font-family: "Source Han Serif JP", "MS PMincho", serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Source Han Sans JP", "Hiragino Kaku Gothic Pro", "MS PGothic"; */
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Source Han Sans JP", "Hiragino Kaku Gothic Pro", "MS PGothic";
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Source Han Sans JP", "Hiragino Kaku Gothic Pro", "MS PGothic";
|
||||
}
|
||||
.bg-colored {
|
||||
background-color: #f6f8fa !important;
|
||||
}
|
||||
.bg-white {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
table {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: table !important;
|
||||
margin-bottom: 1em !important;
|
||||
}
|
||||
table.page-break-inside-avoid {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
figure {
|
||||
margin-bottom: 1em;
|
||||
text-align: center;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
caption,
|
||||
figcaption {
|
||||
font-family: "Source Han Sans JP", source-sans-pro, source-han-sans, sans-serif;
|
||||
}
|
||||
pre {
|
||||
white-space: pre-wrap !important;
|
||||
}
|
||||
code {
|
||||
white-space: pre-wrap !important;
|
||||
}
|
||||
|
||||
/* 表紙 */
|
||||
.FrontCover {
|
||||
font-family: "Source Han Sans JP", source-sans-pro, source-han-sans, sans-serif;
|
||||
}
|
||||
/* 文書タイトル */
|
||||
.FrontCover h1 {
|
||||
margin-top: 55mm;
|
||||
margin-bottom: 140mm;
|
||||
font-weight: 900;
|
||||
font-size: 28pt;
|
||||
text-align: center;
|
||||
page-break-after: avoid;
|
||||
}
|
||||
/* 宛先 */
|
||||
.Attn {
|
||||
font-weight: 600;
|
||||
font-size: 18pt;
|
||||
page-break-after: avoid;
|
||||
}
|
||||
/* 著者 */
|
||||
.Author {
|
||||
margin-bottom: 4mm;
|
||||
text-align: center;
|
||||
font-size: 16pt;
|
||||
line-height: 1em;
|
||||
}
|
||||
/* 日付 */
|
||||
.Published {
|
||||
margin-bottom: 4mm;
|
||||
text-align: center;
|
||||
font-size: 16pt;
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
/* はじめに */
|
||||
article:first-of-type {
|
||||
page-break-before: always;
|
||||
page: Preface;
|
||||
}
|
||||
|
||||
/* 目次 */
|
||||
.TOC a::after {
|
||||
content: leader(dotted) " " target-counter(attr(href), page);
|
||||
}
|
||||
.TOC {
|
||||
page: TOC;
|
||||
}
|
||||
|
||||
/* 本文 */
|
||||
article {
|
||||
counter-reset: page 1;
|
||||
}
|
||||
article h1:nth-child(n+2) {
|
||||
page-break-before: always;
|
||||
}
|
||||
|
||||
/* 脚注 */
|
||||
.Footnote {
|
||||
text-align: justify;
|
||||
float: footnote;
|
||||
text-indent: 0;
|
||||
font-size: 10pt;
|
||||
line-height: 1.2;
|
||||
font-weight: normal;
|
||||
}
|
||||
::footnote-call {
|
||||
content: counter(footnote, decimal) ")";
|
||||
font-size: 10pt;
|
||||
font-weight: normal;
|
||||
vertical-align: super;
|
||||
}
|
||||
::footnote-marker {
|
||||
content: counter(footnote, decimal) ")";
|
||||
font-weight: normal;
|
||||
font-size: 1em;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* 裏表紙 */
|
||||
.BackCover {
|
||||
page: BackCover;
|
||||
font-family: "Source Han Sans JP", source-sans-pro, source-han-sans, sans-serif;
|
||||
}
|
||||
.Colophon {
|
||||
text-align: justify;
|
||||
float: bottom page;
|
||||
text-indent: 0;
|
||||
font-size: 10pt;
|
||||
line-height: 1.2;
|
||||
font-weight: normal;
|
||||
border-top: .5pt solid black;
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
|
||||
/* ブックマーク */
|
||||
.markdown-body h1 {
|
||||
bookmark-level: 1;
|
||||
}
|
||||
.markdown-body h2 {
|
||||
bookmark-level: 2;
|
||||
}
|
||||
.markdown-body h3 {
|
||||
bookmark-level: 3;
|
||||
}
|
||||
|
||||
@page {
|
||||
size: A4;
|
||||
@bottom-center {
|
||||
content: counter(page);
|
||||
}
|
||||
@footnote {
|
||||
float: page bottom;
|
||||
border-top: .5pt solid black;
|
||||
border-length: 30% 0;
|
||||
margin-top: 0.4em;
|
||||
padding-top: 0.3em;
|
||||
padding-left: 15pt;
|
||||
}
|
||||
}
|
||||
@page :first {
|
||||
@bottom-center {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
@page Preface {
|
||||
@bottom-center {
|
||||
content: counter(page, lower-roman);
|
||||
}
|
||||
}
|
||||
@page TOC {
|
||||
@bottom-center {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
@page BackCover {
|
||||
@bottom-center {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
}
|
963
css/github-markdown.css
Executable file
963
css/github-markdown.css
Executable file
|
@ -0,0 +1,963 @@
|
|||
/* github-markdown-css v3.0.1
|
||||
* https://github.com/sindresorhus/github-markdown-css
|
||||
*
|
||||
* MIT License
|
||||
* Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
*/
|
||||
@font-face {
|
||||
font-family: octicons-link;
|
||||
src: url(data:font/woff;charset=utf-8;base64,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) format('woff');
|
||||
}
|
||||
|
||||
.markdown-body .octicon {
|
||||
display: inline-block;
|
||||
fill: currentColor;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.markdown-body .anchor {
|
||||
float: left;
|
||||
line-height: 1;
|
||||
margin-left: -20px;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.markdown-body .anchor:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.markdown-body h1 .octicon-link,
|
||||
.markdown-body h2 .octicon-link,
|
||||
.markdown-body h3 .octicon-link,
|
||||
.markdown-body h4 .octicon-link,
|
||||
.markdown-body h5 .octicon-link,
|
||||
.markdown-body h6 .octicon-link {
|
||||
color: #1b1f23;
|
||||
vertical-align: middle;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.markdown-body h1:hover .anchor,
|
||||
.markdown-body h2:hover .anchor,
|
||||
.markdown-body h3:hover .anchor,
|
||||
.markdown-body h4:hover .anchor,
|
||||
.markdown-body h5:hover .anchor,
|
||||
.markdown-body h6:hover .anchor {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.markdown-body h1:hover .anchor .octicon-link,
|
||||
.markdown-body h2:hover .anchor .octicon-link,
|
||||
.markdown-body h3:hover .anchor .octicon-link,
|
||||
.markdown-body h4:hover .anchor .octicon-link,
|
||||
.markdown-body h5:hover .anchor .octicon-link,
|
||||
.markdown-body h6:hover .anchor .octicon-link {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.markdown-body {
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
color: #24292e;
|
||||
line-height: 1.5;
|
||||
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.markdown-body .pl-c {
|
||||
color: #6a737d;
|
||||
}
|
||||
|
||||
.markdown-body .pl-c1,
|
||||
.markdown-body .pl-s .pl-v {
|
||||
color: #005cc5;
|
||||
}
|
||||
|
||||
.markdown-body .pl-e,
|
||||
.markdown-body .pl-en {
|
||||
color: #6f42c1;
|
||||
}
|
||||
|
||||
.markdown-body .pl-s .pl-s1,
|
||||
.markdown-body .pl-smi {
|
||||
color: #24292e;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ent {
|
||||
color: #22863a;
|
||||
}
|
||||
|
||||
.markdown-body .pl-k {
|
||||
color: #d73a49;
|
||||
}
|
||||
|
||||
.markdown-body .pl-pds,
|
||||
.markdown-body .pl-s,
|
||||
.markdown-body .pl-s .pl-pse .pl-s1,
|
||||
.markdown-body .pl-sr,
|
||||
.markdown-body .pl-sr .pl-cce,
|
||||
.markdown-body .pl-sr .pl-sra,
|
||||
.markdown-body .pl-sr .pl-sre {
|
||||
color: #032f62;
|
||||
}
|
||||
|
||||
.markdown-body .pl-smw,
|
||||
.markdown-body .pl-v {
|
||||
color: #e36209;
|
||||
}
|
||||
|
||||
.markdown-body .pl-bu {
|
||||
color: #b31d28;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ii {
|
||||
background-color: #b31d28;
|
||||
color: #fafbfc;
|
||||
}
|
||||
|
||||
.markdown-body .pl-c2 {
|
||||
background-color: #d73a49;
|
||||
color: #fafbfc;
|
||||
}
|
||||
|
||||
.markdown-body .pl-c2:before {
|
||||
content: "^M";
|
||||
}
|
||||
|
||||
.markdown-body .pl-sr .pl-cce {
|
||||
color: #22863a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ml {
|
||||
color: #735c0f;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mh,
|
||||
.markdown-body .pl-mh .pl-en,
|
||||
.markdown-body .pl-ms {
|
||||
color: #005cc5;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mi {
|
||||
color: #24292e;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mb {
|
||||
color: #24292e;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.markdown-body .pl-md {
|
||||
background-color: #ffeef0;
|
||||
color: #b31d28;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mi1 {
|
||||
background-color: #f0fff4;
|
||||
color: #22863a;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mc {
|
||||
background-color: #ffebda;
|
||||
color: #e36209;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mi2 {
|
||||
background-color: #005cc5;
|
||||
color: #f6f8fa;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mdr {
|
||||
color: #6f42c1;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ba {
|
||||
color: #586069;
|
||||
}
|
||||
|
||||
.markdown-body .pl-sg {
|
||||
color: #959da5;
|
||||
}
|
||||
|
||||
.markdown-body .pl-corl {
|
||||
color: #032f62;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.markdown-body details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.markdown-body summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
.markdown-body a {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.markdown-body a:active,
|
||||
.markdown-body a:hover {
|
||||
outline-width: 0;
|
||||
}
|
||||
|
||||
.markdown-body strong {
|
||||
font-weight: inherit;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.markdown-body h1 {
|
||||
font-size: 2em;
|
||||
margin: .67em 0;
|
||||
}
|
||||
|
||||
.markdown-body img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
.markdown-body code,
|
||||
.markdown-body kbd,
|
||||
.markdown-body pre {
|
||||
font-family: monospace,monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.markdown-body hr {
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.markdown-body input {
|
||||
font: inherit;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown-body input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.markdown-body [type=checkbox] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.markdown-body input {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.markdown-body a {
|
||||
color: #0366d6;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.markdown-body a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.markdown-body strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body hr {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #dfe2e5;
|
||||
height: 0;
|
||||
margin: 15px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.markdown-body hr:before {
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.markdown-body hr:after {
|
||||
clear: both;
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.markdown-body table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.markdown-body td,
|
||||
.markdown-body th {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body details summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.markdown-body h1,
|
||||
.markdown-body h2,
|
||||
.markdown-body h3,
|
||||
.markdown-body h4,
|
||||
.markdown-body h5,
|
||||
.markdown-body h6 {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body h1 {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.markdown-body h1,
|
||||
.markdown-body h2 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.markdown-body h3 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.markdown-body h3,
|
||||
.markdown-body h4 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body h4 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown-body h5 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown-body h5,
|
||||
.markdown-body h6 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown-body p {
|
||||
margin-bottom: 10px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body blockquote {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown-body ol,
|
||||
.markdown-body ul {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.markdown-body ol ol,
|
||||
.markdown-body ul ol {
|
||||
list-style-type: lower-roman;
|
||||
}
|
||||
|
||||
.markdown-body ol ol ol,
|
||||
.markdown-body ol ul ol,
|
||||
.markdown-body ul ol ol,
|
||||
.markdown-body ul ul ol {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
|
||||
.markdown-body dd {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.markdown-body code,
|
||||
.markdown-body pre {
|
||||
font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown-body pre {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body input::-webkit-inner-spin-button,
|
||||
.markdown-body input::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown-body .border {
|
||||
border: 1px solid #e1e4e8!important;
|
||||
}
|
||||
|
||||
.markdown-body .border-0 {
|
||||
border: 0!important;
|
||||
}
|
||||
|
||||
.markdown-body .border-bottom {
|
||||
border-bottom: 1px solid #e1e4e8!important;
|
||||
}
|
||||
|
||||
.markdown-body .rounded-1 {
|
||||
border-radius: 3px!important;
|
||||
}
|
||||
|
||||
.markdown-body .bg-white {
|
||||
background-color: #fff!important;
|
||||
}
|
||||
|
||||
.markdown-body .bg-gray-light {
|
||||
background-color: #fafbfc!important;
|
||||
}
|
||||
|
||||
.markdown-body .text-gray-light {
|
||||
color: #6a737d!important;
|
||||
}
|
||||
|
||||
.markdown-body .mb-0 {
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
|
||||
.markdown-body .my-2 {
|
||||
margin-bottom: 8px!important;
|
||||
margin-top: 8px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-0 {
|
||||
padding-left: 0!important;
|
||||
}
|
||||
|
||||
.markdown-body .py-0 {
|
||||
padding-bottom: 0!important;
|
||||
padding-top: 0!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-1 {
|
||||
padding-left: 4px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-2 {
|
||||
padding-left: 8px!important;
|
||||
}
|
||||
|
||||
.markdown-body .py-2 {
|
||||
padding-bottom: 8px!important;
|
||||
padding-top: 8px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-3,
|
||||
.markdown-body .px-3 {
|
||||
padding-left: 16px!important;
|
||||
}
|
||||
|
||||
.markdown-body .px-3 {
|
||||
padding-right: 16px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-4 {
|
||||
padding-left: 24px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-5 {
|
||||
padding-left: 32px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-6 {
|
||||
padding-left: 40px!important;
|
||||
}
|
||||
|
||||
.markdown-body .f6 {
|
||||
font-size: 12px!important;
|
||||
}
|
||||
|
||||
.markdown-body .lh-condensed {
|
||||
line-height: 1.25!important;
|
||||
}
|
||||
|
||||
.markdown-body .text-bold {
|
||||
font-weight: 600!important;
|
||||
}
|
||||
|
||||
.markdown-body:before {
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.markdown-body:after {
|
||||
clear: both;
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.markdown-body>:first-child {
|
||||
margin-top: 0!important;
|
||||
}
|
||||
|
||||
.markdown-body>:last-child {
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
|
||||
.markdown-body a:not([href]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.markdown-body blockquote,
|
||||
.markdown-body dl,
|
||||
.markdown-body ol,
|
||||
.markdown-body p,
|
||||
.markdown-body pre,
|
||||
.markdown-body table,
|
||||
.markdown-body ul {
|
||||
margin-bottom: 16px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body hr {
|
||||
background-color: #e1e4e8;
|
||||
border: 0;
|
||||
height: .25em;
|
||||
margin: 24px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body blockquote {
|
||||
border-left: .25em solid #dfe2e5;
|
||||
color: #6a737d;
|
||||
padding: 0 1em;
|
||||
}
|
||||
|
||||
.markdown-body blockquote>:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body blockquote>:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.markdown-body kbd {
|
||||
background-color: #fafbfc;
|
||||
border: 1px solid #c6cbd1;
|
||||
border-bottom-color: #959da5;
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 -1px 0 #959da5;
|
||||
color: #444d56;
|
||||
display: inline-block;
|
||||
font-size: 11px;
|
||||
line-height: 10px;
|
||||
padding: 3px 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.markdown-body h1,
|
||||
.markdown-body h2,
|
||||
.markdown-body h3,
|
||||
.markdown-body h4,
|
||||
.markdown-body h5,
|
||||
.markdown-body h6 {
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
margin-bottom: 16px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.markdown-body h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.markdown-body h1,
|
||||
.markdown-body h2 {
|
||||
border-bottom: 1px solid #eaecef;
|
||||
padding-bottom: .3em;
|
||||
}
|
||||
|
||||
.markdown-body h2 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.markdown-body h3 {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.markdown-body h4 {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.markdown-body h5 {
|
||||
font-size: .875em;
|
||||
}
|
||||
|
||||
.markdown-body h6 {
|
||||
color: #6a737d;
|
||||
font-size: .85em;
|
||||
}
|
||||
|
||||
.markdown-body ol,
|
||||
.markdown-body ul {
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
.markdown-body ol ol,
|
||||
.markdown-body ol ul,
|
||||
.markdown-body ul ol,
|
||||
.markdown-body ul ul {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body li {
|
||||
word-wrap: break-all;
|
||||
}
|
||||
|
||||
.markdown-body li>p {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.markdown-body li+li {
|
||||
margin-top: .25em;
|
||||
}
|
||||
|
||||
.markdown-body dl {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body dl dt {
|
||||
font-size: 1em;
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
margin-top: 16px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body dl dd {
|
||||
margin-bottom: 16px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.markdown-body table {
|
||||
display: block;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.markdown-body table th {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body table td,
|
||||
.markdown-body table th {
|
||||
border: 1px solid #dfe2e5;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
|
||||
.markdown-body table tr {
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #c6cbd1;
|
||||
}
|
||||
|
||||
.markdown-body table tr:nth-child(2n) {
|
||||
background-color: #f6f8fa;
|
||||
}
|
||||
|
||||
.markdown-body img {
|
||||
background-color: #fff;
|
||||
box-sizing: content-box;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown-body img[align=right] {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.markdown-body img[align=left] {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.markdown-body code {
|
||||
background-color: rgba(27,31,35,.05);
|
||||
border-radius: 3px;
|
||||
font-size: 85%;
|
||||
margin: 0;
|
||||
padding: .2em .4em;
|
||||
}
|
||||
|
||||
.markdown-body pre {
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
.markdown-body pre>code {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.markdown-body .highlight {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.markdown-body .highlight pre {
|
||||
margin-bottom: 0;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.markdown-body .highlight pre,
|
||||
.markdown-body pre {
|
||||
background-color: #f6f8fa;
|
||||
border-radius: 3px;
|
||||
font-size: 85%;
|
||||
line-height: 1.45;
|
||||
overflow: auto;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.markdown-body pre code {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
display: inline;
|
||||
line-height: inherit;
|
||||
margin: 0;
|
||||
max-width: auto;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
.markdown-body .commit-tease-sha {
|
||||
color: #444d56;
|
||||
display: inline-block;
|
||||
font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.markdown-body .blob-wrapper {
|
||||
border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.markdown-body .blob-wrapper-embedded {
|
||||
max-height: 240px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.markdown-body .blob-num {
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
color: rgba(27,31,35,.3);
|
||||
cursor: pointer;
|
||||
font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
min-width: 50px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
text-align: right;
|
||||
user-select: none;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
width: 1%;
|
||||
}
|
||||
|
||||
.markdown-body .blob-num:hover {
|
||||
color: rgba(27,31,35,.6);
|
||||
}
|
||||
|
||||
.markdown-body .blob-num:before {
|
||||
content: attr(data-line-number);
|
||||
}
|
||||
|
||||
.markdown-body .blob-code {
|
||||
line-height: 20px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.markdown-body .blob-code-inner {
|
||||
color: #24292e;
|
||||
font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
|
||||
font-size: 12px;
|
||||
overflow: visible;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
.markdown-body .pl-token.active,
|
||||
.markdown-body .pl-token:hover {
|
||||
background: #ffea7f;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.markdown-body kbd {
|
||||
background-color: #fafbfc;
|
||||
border: 1px solid #d1d5da;
|
||||
border-bottom-color: #c6cbd1;
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 -1px 0 #c6cbd1;
|
||||
color: #444d56;
|
||||
display: inline-block;
|
||||
font: 11px SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
|
||||
line-height: 10px;
|
||||
padding: 3px 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.markdown-body :checked+.radio-label {
|
||||
border-color: #0366d6;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="1"] {
|
||||
-moz-tab-size: 1;
|
||||
tab-size: 1;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="2"] {
|
||||
-moz-tab-size: 2;
|
||||
tab-size: 2;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="3"] {
|
||||
-moz-tab-size: 3;
|
||||
tab-size: 3;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="4"] {
|
||||
-moz-tab-size: 4;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="5"] {
|
||||
-moz-tab-size: 5;
|
||||
tab-size: 5;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="6"] {
|
||||
-moz-tab-size: 6;
|
||||
tab-size: 6;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="7"] {
|
||||
-moz-tab-size: 7;
|
||||
tab-size: 7;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="8"] {
|
||||
-moz-tab-size: 8;
|
||||
tab-size: 8;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="9"] {
|
||||
-moz-tab-size: 9;
|
||||
tab-size: 9;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="10"] {
|
||||
-moz-tab-size: 10;
|
||||
tab-size: 10;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="11"] {
|
||||
-moz-tab-size: 11;
|
||||
tab-size: 11;
|
||||
}
|
||||
|
||||
.markdown-body .tab-size[data-tab-size="12"] {
|
||||
-moz-tab-size: 12;
|
||||
tab-size: 12;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item+.task-list-item {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item input {
|
||||
margin: 0 .2em .25em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.markdown-body hr {
|
||||
border-bottom-color: #eee;
|
||||
}
|
||||
|
||||
.markdown-body .pl-0 {
|
||||
padding-left: 0!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-1 {
|
||||
padding-left: 4px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-2 {
|
||||
padding-left: 8px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-3 {
|
||||
padding-left: 16px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-4 {
|
||||
padding-left: 24px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-5 {
|
||||
padding-left: 32px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-6 {
|
||||
padding-left: 40px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-7 {
|
||||
padding-left: 48px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-8 {
|
||||
padding-left: 64px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-9 {
|
||||
padding-left: 80px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-10 {
|
||||
padding-left: 96px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-11 {
|
||||
padding-left: 112px!important;
|
||||
}
|
||||
|
||||
.markdown-body .pl-12 {
|
||||
padding-left: 128px!important;
|
||||
}
|
3
documents/combine_test.md
Normal file
3
documents/combine_test.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Combine_Test
|
||||
|
||||
## テスト
|
2
documents/files.txt
Normal file
2
documents/files.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
main.md
|
||||
combine_test.md
|
120
documents/main.md
Normal file
120
documents/main.md
Normal file
|
@ -0,0 +1,120 @@
|
|||
|
||||
# Markdown Example
|
||||
|
||||
## 1. **Basic Formatting**
|
||||
|
||||
You can make text **bold** or *italic*.
|
||||
|
||||
**Bold and _Italic_** can be combined.
|
||||
|
||||
---
|
||||
|
||||
## 2. **Lists**
|
||||
|
||||
### Unordered List:
|
||||
- Item 1
|
||||
- Subitem 1.1
|
||||
- Subitem 1.2
|
||||
- Item 2
|
||||
|
||||
### Ordered List:
|
||||
1. First item
|
||||
2. Second item
|
||||
1. Subitem 2.1
|
||||
2. Subitem 2.2
|
||||
|
||||
---
|
||||
|
||||
## 3. **Links and Images**
|
||||
|
||||
[OpenAI](https://www.openai.com)
|
||||
|
||||
<!-- ![OpenAI Logo](https://www.openai.com/favicon.ico) -->
|
||||
|
||||
---
|
||||
|
||||
## 4. **Blockquotes**
|
||||
|
||||
> "The only limit to our realization of tomorrow is our doubts of today."
|
||||
> — *Franklin D. Roosevelt*
|
||||
|
||||
---
|
||||
|
||||
## 5. **Code Blocks**
|
||||
|
||||
Inline code: `print("Hello, World!")`
|
||||
|
||||
Python code block:
|
||||
```python
|
||||
def greet(name):
|
||||
print(f"Hello, {name}!")
|
||||
greet("Markdown")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. **Tables**
|
||||
|
||||
| Name | Age | Country |
|
||||
|----------|-----|---------|
|
||||
| Alice | 24 | USA |
|
||||
| Bob | 30 | UK |
|
||||
| Charlie | 28 | Canada |
|
||||
|
||||
---
|
||||
|
||||
## 7. **Task Lists**
|
||||
|
||||
- [x] Write a markdown example
|
||||
- [ ] Review the document
|
||||
- [ ] Submit the assignment
|
||||
|
||||
---
|
||||
|
||||
## 8. **Footnotes**
|
||||
|
||||
This is a statement with a footnote.[^1]
|
||||
|
||||
[^1]: This is the footnote explaining the statement.
|
||||
|
||||
---
|
||||
|
||||
## 9. **Horizontal Rules**
|
||||
|
||||
---
|
||||
|
||||
## 10. **Emojis**
|
||||
|
||||
Let's celebrate :tada: and have some fun :smile:!
|
||||
|
||||
---
|
||||
|
||||
## 11. **Heading with ID**
|
||||
|
||||
### Custom Heading {#custom-heading}
|
||||
|
||||
You can link to [this heading](#custom-heading) using its ID.
|
||||
|
||||
---
|
||||
|
||||
## 12. **Highlighting**
|
||||
|
||||
==This text is highlighted== for emphasis.
|
||||
|
||||
---
|
||||
|
||||
## 13. **Mathematical Expressions**
|
||||
|
||||
You can include math using LaTeX:
|
||||
$$ E = mc^2 $$
|
||||
|
||||
---
|
||||
|
||||
## 14. **HTML Elements**
|
||||
|
||||
You can also use HTML elements:
|
||||
<kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.
|
||||
|
||||
---
|
||||
|
||||
Enjoy experimenting with **Markdown**!
|
5539
package-lock.json
generated
Normal file
5539
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
34
package.json
Normal file
34
package.json
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"name": "md2pdf-meow",
|
||||
"version": "1.0.0",
|
||||
"description": "Convert Markdown documents to PDF🐱",
|
||||
"scripts": {
|
||||
"build:step1": "npx minicat $(sed 's|^|documents/|' documents/files.txt) > work/all.md",
|
||||
"build:step2": "npx doctoc --notitle --maxlevel 3 work/all.md",
|
||||
"build:step3": "node scripts/mdit.js work/all.md work/all_md.html",
|
||||
"build:step4": "node scripts/ejs.js template/template.html work/all.html",
|
||||
"build:step5": "npx html-inline work/all.html -b doc -o dist/all.html",
|
||||
"build:step6": "npx tsx scripts/convert.ts",
|
||||
"build": "npm run build:step1 && npm run build:step2 && npm run build:step3 && npm run build:step4 && npm run build:step5 && npm run build:step6"
|
||||
},
|
||||
"author": "rca",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"anchor-markdown-header": "^0.5.7",
|
||||
"doctoc": "^1.4.0",
|
||||
"ejs": "^2.6.1",
|
||||
"eslint": "^5.16.0",
|
||||
"html-inline": "^1.2.0",
|
||||
"htmltidy2": "^0.3.0",
|
||||
"markdown-it": "^8.4.2",
|
||||
"markdown-it-implicit-figures": "^0.9.0",
|
||||
"markdown-it-named-headers": "0.0.4",
|
||||
"minicat": "^1.0.0",
|
||||
"tsc": "^2.0.4",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"puppeteer-html-pdf": "^4.0.8",
|
||||
"tsx": "^4.17.0"
|
||||
}
|
||||
}
|
29
scripts/convert.ts
Normal file
29
scripts/convert.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import PuppeteerHTMLPDF from 'puppeteer-html-pdf';
|
||||
|
||||
async function generatePDF() {
|
||||
const htmlPdf = new PuppeteerHTMLPDF();
|
||||
|
||||
htmlPdf.setOptions({
|
||||
format: "A4",
|
||||
margin: {
|
||||
top: "16mm",
|
||||
right: "16mm",
|
||||
bottom: "16mm",
|
||||
left: "16mm"
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
const html = await htmlPdf.readFile(`${__dirname}/../dist/all.html`, "utf8");
|
||||
|
||||
const pdfBuffer = await htmlPdf.create(html);
|
||||
const path = `${__dirname}/../dist/result.pdf`;
|
||||
await htmlPdf.writeFile(pdfBuffer, path);
|
||||
|
||||
console.log("PDF created successfully");
|
||||
} catch (error) {
|
||||
console.error("Error creating PDF", error);
|
||||
}
|
||||
}
|
||||
|
||||
generatePDF();
|
37
scripts/ejs.js
Executable file
37
scripts/ejs.js
Executable file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* md2html
|
||||
* Copyright 2019 2SC1815J, MIT license
|
||||
*/
|
||||
'use strict';
|
||||
if (process.argv.length < 4) {
|
||||
console.error('Usage: node ejs.js template.html output.html');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const { promisify } = require('util');
|
||||
const ejs = require('ejs');
|
||||
const tidy = require('htmltidy2');
|
||||
const fs = require('fs');
|
||||
|
||||
(async () => {
|
||||
const text = await promisify(ejs.renderFile)(process.argv[2]);
|
||||
const options = {
|
||||
doctype: 'html5',
|
||||
indent: 'auto',
|
||||
wrap: 0,
|
||||
tidyMark: false,
|
||||
quoteAmpersand: false,
|
||||
hideComments: true,
|
||||
dropEmptyElements: false,
|
||||
newline: 'LF'
|
||||
};
|
||||
const tidied = await promisify(tidy.tidy)(text, options);
|
||||
await promisify(fs.writeFile)(process.argv[3], tidied, 'utf8');
|
||||
})()
|
||||
.then(() => {
|
||||
console.log('Done.');
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
46
scripts/mdit.js
Executable file
46
scripts/mdit.js
Executable file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* md2html
|
||||
* Copyright 2019 2SC1815J, MIT license
|
||||
*/
|
||||
'use strict';
|
||||
if (process.argv.length < 4) {
|
||||
console.error('Usage: node mdit.js input.md output.html');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const header_instances = {};
|
||||
const anchor = require('anchor-markdown-header');
|
||||
const mdit = require('markdown-it')(
|
||||
{
|
||||
html: true
|
||||
})
|
||||
.use(require('markdown-it-named-headers'), {
|
||||
slugify: function(header) {
|
||||
if (header_instances[header] !== void 0) {
|
||||
header_instances[header]++;
|
||||
} else {
|
||||
header_instances[header] = 0;
|
||||
}
|
||||
const match = anchor(header, 'github.com', header_instances[header]).match(/]\(#(.+?)\)$/);
|
||||
return match ? decodeURI(match[1]) : header;
|
||||
}
|
||||
})
|
||||
.use(require('markdown-it-implicit-figures'), {
|
||||
figcaption: true
|
||||
});
|
||||
|
||||
const { promisify } = require('util');
|
||||
const fs = require('fs');
|
||||
|
||||
(async () => {
|
||||
const md = await promisify(fs.readFile)(process.argv[2], 'utf8');
|
||||
const html = mdit.render(md);
|
||||
await promisify(fs.writeFile)(process.argv[3], html, 'utf8');
|
||||
})()
|
||||
.then(() => {
|
||||
console.log('Done.');
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
28
template/template.html
Normal file
28
template/template.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="openaction" content="#view=fit">
|
||||
<meta name="author" content="r-ca" />
|
||||
<title>Template</title>
|
||||
<link rel="stylesheet" href="../css/github-markdown.css">
|
||||
<link rel="stylesheet" href="../css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="FrontCover">
|
||||
<h1>Template</h1>
|
||||
<div class="Published">0000/000/00</div>
|
||||
<div class="Author">ろむねこ</div>
|
||||
</div>
|
||||
<article class="markdown-body">
|
||||
<%- include('../work/all_md.html') %>
|
||||
</article>
|
||||
<div class="BackCover">
|
||||
<div class="Colophon">
|
||||
<span class="Title">Template</span><br>
|
||||
<span class="PubDate">0000/000/00</span><br>
|
||||
<span class="Copyright">template</span>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
17
tsconfig.json
Normal file
17
tsconfig.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"module": "es2022",
|
||||
"strict": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"typeRoots": ["./node_modules/@types", "./src/types"],
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/*.ts"],
|
||||
"ts-node": {
|
||||
"esm": true,
|
||||
"experimentalSpecifierResolution": "node"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user