From 1537a59c6bf8e02bf60115f4ce02edebfb828ecc Mon Sep 17 00:00:00 2001 From: Zijun Yang Date: Sat, 13 Aug 2022 16:14:20 +0800 Subject: [PATCH 1/3] add inline code support --- CMakeLists.txt | 2 +- MarkdownSource.cpp | 14 ++++++ MarkdownSource.h | 3 +- settings.cpp | 4 +- source/dark.css | 1 + source/darkCompact.css | 1 + source/darkCompactCss.html | 81 --------------------------------- source/darkCss.html | 80 --------------------------------- source/default.css | 0 source/defaultCss.html | 19 -------- source/githubDark.css | 1 + source/githubDarkCss.html | 89 ------------------------------------- source/githubLight.css | 1 + source/githubLightCss.html | 88 ------------------------------------ source/light.css | 1 + source/lightCompact.css | 1 + source/lightCompactCss.html | 81 --------------------------------- source/lightCss.html | 81 --------------------------------- stringProcess.cpp | 11 +++-- 19 files changed, 34 insertions(+), 525 deletions(-) create mode 100644 source/dark.css create mode 100644 source/darkCompact.css delete mode 100644 source/darkCompactCss.html delete mode 100644 source/darkCss.html create mode 100644 source/default.css delete mode 100644 source/defaultCss.html create mode 100644 source/githubDark.css delete mode 100644 source/githubDarkCss.html create mode 100644 source/githubLight.css delete mode 100644 source/githubLightCss.html create mode 100644 source/light.css create mode 100644 source/lightCompact.css delete mode 100644 source/lightCompactCss.html delete mode 100644 source/lightCss.html diff --git a/CMakeLists.txt b/CMakeLists.txt index cb29ab6..5815e75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0.0) -project(markdown2html VERSION 1.1.0) +project(markdown2html VERSION 1.1.1) add_compile_options(-Wall -Wextra -Wpedantic -std=c++1z) diff --git a/MarkdownSource.cpp b/MarkdownSource.cpp index 795de34..48948ec 100644 --- a/MarkdownSource.cpp +++ b/MarkdownSource.cpp @@ -83,8 +83,13 @@ void MarkdownSource::convertTo(ofstream& outFile) { } continue; } + bool isInInlineCode = false; while (i < len) { + // remember to add i Type theType = startWith(l, i); + if (isInInlineCode && (theType != InlineCode)) { + theType = Text; + } if (theType == Hr) { outFile << "
"; break; @@ -143,6 +148,15 @@ void MarkdownSource::convertTo(ofstream& outFile) { outFile << "
  • " << endl; i = (theType == Uli) ? indentCnt + 2 : findChar(l, indentCnt, '.', "") + 2; } + if (theType == InlineCode) { + if (!isInInlineCode) { + outFile << ""; + } else { + outFile << ""; + } + isInInlineCode = !isInInlineCode; + i++; + } if (theType == Text) { outFile << l[i]; i++; diff --git a/MarkdownSource.h b/MarkdownSource.h index 3f242cf..c84cb98 100644 --- a/MarkdownSource.h +++ b/MarkdownSource.h @@ -31,7 +31,8 @@ enum Type { Img, ImgBracket, Hyper, - CodeBlock // start with + CodeBlock, // start with + InlineCode }; #include diff --git a/settings.cpp b/settings.cpp index 86c4a49..f272364 100644 --- a/settings.cpp +++ b/settings.cpp @@ -91,14 +91,16 @@ void Settings::afterBody() { } file.close(); // select style - file.open("./source/" + selectTheme() + "Css.html"); + file.open("./source/" + selectTheme() + ".css"); if (!(file.is_open())) { cout << "Error opening css file" << endl; return; } + outFile << "" << endl; } diff --git a/source/dark.css b/source/dark.css new file mode 100644 index 0000000..cb51e4d --- /dev/null +++ b/source/dark.css @@ -0,0 +1 @@ +body{margin:0;padding:0;height:100%;width:100%;background:#151515}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#aaa;font-size:16px;font-weight:400;line-height:24px}h1{color:#eee;font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;color:#eee;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;color:#bbb;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:underline;color:#ddd;font-weight:100}a:hover{color:#fff}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #444;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #fff}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#080808;padding:12px;border-radius:4px}code{background-color:#080808;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file diff --git a/source/darkCompact.css b/source/darkCompact.css new file mode 100644 index 0000000..13cab73 --- /dev/null +++ b/source/darkCompact.css @@ -0,0 +1 @@ +body{margin:0;padding:0;height:100%;width:100%;background:#151515}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#aaa;font-size:16px;font-weight:400;line-height:20px}h1{color:#eee;font-size:32px;font-weight:600;line-height:36px;margin:5px 0 5px 0}h2{margin:5px 0 5px 0;color:#eee;font-size:24px;font-weight:600;line-height:24px}h3{margin:5px 0 5px 0;color:#bbb;font-size:18px;line-height:18px;font-weight:600}a{text-decoration:underline;color:#ddd;font-weight:100}a:hover{color:#fff}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #444;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #fff}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#080808;padding:12px;border-radius:4px}code{background-color:#080808;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file diff --git a/source/darkCompactCss.html b/source/darkCompactCss.html deleted file mode 100644 index 8b2ecc6..0000000 --- a/source/darkCompactCss.html +++ /dev/null @@ -1,81 +0,0 @@ - diff --git a/source/darkCss.html b/source/darkCss.html deleted file mode 100644 index 3300f2a..0000000 --- a/source/darkCss.html +++ /dev/null @@ -1,80 +0,0 @@ - diff --git a/source/default.css b/source/default.css new file mode 100644 index 0000000..e69de29 diff --git a/source/defaultCss.html b/source/defaultCss.html deleted file mode 100644 index 9ac4f51..0000000 --- a/source/defaultCss.html +++ /dev/null @@ -1,19 +0,0 @@ - - diff --git a/source/githubDark.css b/source/githubDark.css new file mode 100644 index 0000000..5495833 --- /dev/null +++ b/source/githubDark.css @@ -0,0 +1 @@ +body{margin:0;padding:0;height:100%;width:100%;background:#0d1117}#app{margin:0;padding:0}*{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";color:#c9d1d9;font-size:16px;font-weight:400;line-height:24px}h1{font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:none;color:#58a6ff;font-weight:400}a:hover{text-decoration:underline}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #21262d;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{padding:12px;background-color:#161b22;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:13.6px;font-weight:400;line-height:19.72px;border-radius:8px}code{background-color:#343942;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:13.6px;font-weight:400;line-height:20.4px;padding:2.72px 5.44px;border-radius:6px} \ No newline at end of file diff --git a/source/githubDarkCss.html b/source/githubDarkCss.html deleted file mode 100644 index 7023fbd..0000000 --- a/source/githubDarkCss.html +++ /dev/null @@ -1,89 +0,0 @@ - diff --git a/source/githubLight.css b/source/githubLight.css new file mode 100644 index 0000000..b10369f --- /dev/null +++ b/source/githubLight.css @@ -0,0 +1 @@ +body{margin:0;padding:0;height:100%;width:100%;background:#fff}#app{margin:0;padding:0}*{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";color:#24292f;font-size:16px;font-weight:400;line-height:24px}h1{font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:none;color:#0969da;font-weight:400}a:hover{text-decoration:underline}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #d8dee4;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;background-color:#f6f8fa;padding:12px;font-size:13.6px;font-weight:400;line-height:19.72px;border-radius:8px}code{background-color:#eff1f3;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:13.6px;font-weight:400;line-height:20.4px;padding:2.72px 5.44px;border-radius:6px} \ No newline at end of file diff --git a/source/githubLightCss.html b/source/githubLightCss.html deleted file mode 100644 index 1a7a659..0000000 --- a/source/githubLightCss.html +++ /dev/null @@ -1,88 +0,0 @@ - diff --git a/source/light.css b/source/light.css new file mode 100644 index 0000000..1093744 --- /dev/null +++ b/source/light.css @@ -0,0 +1 @@ +body{margin:0;padding:0;height:100%;width:100%;background:#eaeaea}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#555;font-size:16px;font-weight:400;line-height:24px}h1{color:#111;font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;color:#111;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;color:#444;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:underline;color:#222;font-weight:100}a:hover{color:#000}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #bbb;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#f5f5f5;padding:12px;border-radius:4px}code{background-color:#f5f5f5;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file diff --git a/source/lightCompact.css b/source/lightCompact.css new file mode 100644 index 0000000..0623e29 --- /dev/null +++ b/source/lightCompact.css @@ -0,0 +1 @@ +body{margin:0;padding:0;height:100%;width:100%;background:#eaeaea}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#555;font-size:16px;font-weight:400;line-height:20px}h1{color:#111;font-size:32px;font-weight:600;line-height:36px;margin:5px 0 5px 0}h2{margin:5px 0 5px 0;color:#111;font-size:24px;font-weight:600;line-height:24px}h3{margin:5px 0 5px 0;color:#444;font-size:18px;line-height:18px;font-weight:600}a{text-decoration:underline;color:#222;font-weight:100}a:hover{color:#000}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #bbb;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#f5f5f5;padding:12px;border-radius:4px}code{background-color:#f5f5f5;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file diff --git a/source/lightCompactCss.html b/source/lightCompactCss.html deleted file mode 100644 index 7918695..0000000 --- a/source/lightCompactCss.html +++ /dev/null @@ -1,81 +0,0 @@ - diff --git a/source/lightCss.html b/source/lightCss.html deleted file mode 100644 index 7aedf52..0000000 --- a/source/lightCss.html +++ /dev/null @@ -1,81 +0,0 @@ - diff --git a/stringProcess.cpp b/stringProcess.cpp index af77c0e..c91ffa3 100644 --- a/stringProcess.cpp +++ b/stringProcess.cpp @@ -62,9 +62,6 @@ int findChar(string& s, int startFrom, char c, string exclude) { return -1; } Type startWith(string& s, int startFrom) { - if (s.substr(startFrom, 4) == " preProcess(ifstream& inFile) { From 7779c7a74ad56c04e4a18128bca682d51f1ccdb4 Mon Sep 17 00:00:00 2001 From: Zijun Yang Date: Sat, 13 Aug 2022 16:32:27 +0800 Subject: [PATCH 2/3] feat: change theme, now support inlinecode --- source/dark.css | 102 ++++++++++++++++++++++++++++++++++++++- source/darkCompact.css | 103 +++++++++++++++++++++++++++++++++++++++- source/default.css | 1 + source/githubDark.css | 2 +- source/githubLight.css | 2 +- source/light.css | 102 ++++++++++++++++++++++++++++++++++++++- source/lightCompact.css | 103 +++++++++++++++++++++++++++++++++++++++- 7 files changed, 409 insertions(+), 6 deletions(-) diff --git a/source/dark.css b/source/dark.css index cb51e4d..f79b59d 100644 --- a/source/dark.css +++ b/source/dark.css @@ -1 +1,101 @@ -body{margin:0;padding:0;height:100%;width:100%;background:#151515}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#aaa;font-size:16px;font-weight:400;line-height:24px}h1{color:#eee;font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;color:#eee;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;color:#bbb;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:underline;color:#ddd;font-weight:100}a:hover{color:#fff}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #444;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #fff}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#080808;padding:12px;border-radius:4px}code{background-color:#080808;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file +body { + margin: 0; + padding: 0; + height: 100%; + width: 100%; + background: #151515 +} + +#app { + margin: 0; + padding: 0 +} + +* { + font-family: monospace, "Courier New", Courier; + color: #aaa; + font-size: 16px; + font-weight: 400; + line-height: 24px +} + +h1 { + color: #eee; + font-size: 32px; + font-weight: 600; + line-height: 40px +} + +h2 { + margin: 5px 0 5px 0; + color: #eee; + font-size: 24px; + font-weight: 600; + line-height: 30px +} + +h3 { + margin: 5px 0 5px 0; + color: #bbb; + font-size: 18px; + line-height: 24px; + font-weight: 600 +} + +a { + text-decoration: underline; + color: #ddd; + font-weight: 100 +} + +a:hover { + color: #fff +} + +ul { + margin: 5px 0 5px 0 +} + +li { + margin: 3px 0 3px 0 !important +} + +hr { + border: none; + border-top: 1px solid #444; + margin: 15px 0 15px 0 +} + +#realBody { + max-width: 900px; + margin: 3% auto 8% auto; + padding: 40px 20px 0 20px +} + +#avatar { + width: 20%; + margin-bottom: 3%; + border: 3px dashed #fff +} + +li { + margin-bottom: 10px +} + +img { + max-width: 100% +} + +pre { + background-color: #080808; + padding: 12px; + border-radius: 4px +} + +code { + background-color: #080808; + padding: .2em .4em; + font-size: 85%; + border-radius: 3px; + font-family: "Courier New", Courier, monospace +} diff --git a/source/darkCompact.css b/source/darkCompact.css index 13cab73..43d3203 100644 --- a/source/darkCompact.css +++ b/source/darkCompact.css @@ -1 +1,102 @@ -body{margin:0;padding:0;height:100%;width:100%;background:#151515}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#aaa;font-size:16px;font-weight:400;line-height:20px}h1{color:#eee;font-size:32px;font-weight:600;line-height:36px;margin:5px 0 5px 0}h2{margin:5px 0 5px 0;color:#eee;font-size:24px;font-weight:600;line-height:24px}h3{margin:5px 0 5px 0;color:#bbb;font-size:18px;line-height:18px;font-weight:600}a{text-decoration:underline;color:#ddd;font-weight:100}a:hover{color:#fff}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #444;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #fff}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#080808;padding:12px;border-radius:4px}code{background-color:#080808;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file +body { + margin: 0; + padding: 0; + height: 100%; + width: 100%; + background: #151515 +} + +#app { + margin: 0; + padding: 0 +} + +* { + font-family: monospace, "Courier New", Courier; + color: #aaa; + font-size: 16px; + font-weight: 400; + line-height: 20px +} + +h1 { + color: #eee; + font-size: 32px; + font-weight: 600; + line-height: 36px; + margin: 5px 0 5px 0 +} + +h2 { + margin: 5px 0 5px 0; + color: #eee; + font-size: 24px; + font-weight: 600; + line-height: 24px +} + +h3 { + margin: 5px 0 5px 0; + color: #bbb; + font-size: 18px; + line-height: 18px; + font-weight: 600 +} + +a { + text-decoration: underline; + color: #ddd; + font-weight: 100 +} + +a:hover { + color: #fff +} + +ul { + margin: 5px 0 5px 0 +} + +li { + margin: 3px 0 3px 0 !important +} + +hr { + border: none; + border-top: 1px solid #444; + margin: 15px 0 15px 0 +} + +#realBody { + max-width: 900px; + margin: 3% auto 8% auto; + padding: 40px 20px 0 20px +} + +#avatar { + width: 20%; + margin-bottom: 3%; + border: 3px dashed #fff +} + +li { + margin-bottom: 10px +} + +img { + max-width: 100% +} + +pre { + background-color: #080808; + padding: 12px; + border-radius: 4px +} + +code { + background-color: #080808; + padding: .2em .4em; + font-size: 85%; + border-radius: 3px; + font-family: "Courier New", Courier, monospace +} diff --git a/source/default.css b/source/default.css index e69de29..8b13789 100644 --- a/source/default.css +++ b/source/default.css @@ -0,0 +1 @@ + diff --git a/source/githubDark.css b/source/githubDark.css index 5495833..4868e22 100644 --- a/source/githubDark.css +++ b/source/githubDark.css @@ -1 +1 @@ -body{margin:0;padding:0;height:100%;width:100%;background:#0d1117}#app{margin:0;padding:0}*{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";color:#c9d1d9;font-size:16px;font-weight:400;line-height:24px}h1{font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:none;color:#58a6ff;font-weight:400}a:hover{text-decoration:underline}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #21262d;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{padding:12px;background-color:#161b22;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:13.6px;font-weight:400;line-height:19.72px;border-radius:8px}code{background-color:#343942;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:13.6px;font-weight:400;line-height:20.4px;padding:2.72px 5.44px;border-radius:6px} \ No newline at end of file +body{margin:0;padding:0;height:100%;width:100%;background:#0d1117}#app{margin:0;padding:0}*{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";color:#c9d1d9;font-size:16px;font-weight:400;line-height:24px}h1{font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:none;color:#58a6ff;font-weight:400}a:hover{text-decoration:underline}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #21262d;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{padding:12px;background-color:#161b22;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:85%;font-weight:400;line-height:145%;border-radius:8px}code{background-color:#343942;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:85%;font-weight:400;line-height:145%;padding:.2em .4em;border-radius:6px} \ No newline at end of file diff --git a/source/githubLight.css b/source/githubLight.css index b10369f..0c8f5e1 100644 --- a/source/githubLight.css +++ b/source/githubLight.css @@ -1 +1 @@ -body{margin:0;padding:0;height:100%;width:100%;background:#fff}#app{margin:0;padding:0}*{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";color:#24292f;font-size:16px;font-weight:400;line-height:24px}h1{font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:none;color:#0969da;font-weight:400}a:hover{text-decoration:underline}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #d8dee4;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;background-color:#f6f8fa;padding:12px;font-size:13.6px;font-weight:400;line-height:19.72px;border-radius:8px}code{background-color:#eff1f3;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:13.6px;font-weight:400;line-height:20.4px;padding:2.72px 5.44px;border-radius:6px} \ No newline at end of file +body{margin:0;padding:0;height:100%;width:100%;background:#fff}#app{margin:0;padding:0}*{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";color:#24292f;font-size:16px;font-weight:400;line-height:24px}h1{font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:none;color:#0969da;font-weight:400}a:hover{text-decoration:underline}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #d8dee4;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;background-color:#f6f8fa;padding:12px;font-size:85%;font-weight:400;line-height:145%;border-radius:8px}code{background-color:#eff1f3;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:85%;font-weight:400;line-height:145%;padding:.2em .4em;border-radius:6px} \ No newline at end of file diff --git a/source/light.css b/source/light.css index 1093744..667052f 100644 --- a/source/light.css +++ b/source/light.css @@ -1 +1,101 @@ -body{margin:0;padding:0;height:100%;width:100%;background:#eaeaea}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#555;font-size:16px;font-weight:400;line-height:24px}h1{color:#111;font-size:32px;font-weight:600;line-height:40px}h2{margin:5px 0 5px 0;color:#111;font-size:24px;font-weight:600;line-height:30px}h3{margin:5px 0 5px 0;color:#444;font-size:18px;line-height:24px;font-weight:600}a{text-decoration:underline;color:#222;font-weight:100}a:hover{color:#000}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #bbb;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#f5f5f5;padding:12px;border-radius:4px}code{background-color:#f5f5f5;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file +body { + margin: 0; + padding: 0; + height: 100%; + width: 100%; + background: #eaeaea +} + +#app { + margin: 0; + padding: 0 +} + +* { + font-family: monospace, "Courier New", Courier; + color: #555; + font-size: 16px; + font-weight: 400; + line-height: 24px +} + +h1 { + color: #111; + font-size: 32px; + font-weight: 600; + line-height: 40px +} + +h2 { + margin: 5px 0 5px 0; + color: #111; + font-size: 24px; + font-weight: 600; + line-height: 30px +} + +h3 { + margin: 5px 0 5px 0; + color: #444; + font-size: 18px; + line-height: 24px; + font-weight: 600 +} + +a { + text-decoration: underline; + color: #222; + font-weight: 100 +} + +a:hover { + color: #000 +} + +ul { + margin: 5px 0 5px 0 +} + +li { + margin: 3px 0 3px 0 !important +} + +hr { + border: none; + border-top: 1px solid #bbb; + margin: 15px 0 15px 0 +} + +#realBody { + max-width: 900px; + margin: 3% auto 8% auto; + padding: 40px 20px 0 20px +} + +#avatar { + width: 20%; + margin-bottom: 3%; + border: 3px dashed #000 +} + +li { + margin-bottom: 10px +} + +img { + max-width: 100% +} + +pre { + background-color: #f5f5f5; + padding: 12px; + border-radius: 4px +} + +code { + background-color: #f5f5f5; + padding: .2em .4em; + font-size: 85%; + border-radius: 3px; + font-family: "Courier New", Courier, monospace +} diff --git a/source/lightCompact.css b/source/lightCompact.css index 0623e29..c5c45c3 100644 --- a/source/lightCompact.css +++ b/source/lightCompact.css @@ -1 +1,102 @@ -body{margin:0;padding:0;height:100%;width:100%;background:#eaeaea}#app{margin:0;padding:0}*{font-family:monospace,"Courier New",Courier;color:#555;font-size:16px;font-weight:400;line-height:20px}h1{color:#111;font-size:32px;font-weight:600;line-height:36px;margin:5px 0 5px 0}h2{margin:5px 0 5px 0;color:#111;font-size:24px;font-weight:600;line-height:24px}h3{margin:5px 0 5px 0;color:#444;font-size:18px;line-height:18px;font-weight:600}a{text-decoration:underline;color:#222;font-weight:100}a:hover{color:#000}ul{margin:5px 0 5px 0}li{margin:3px 0 3px 0 !important}hr{border:none;border-top:1px solid #bbb;margin:15px 0 15px 0}#realBody{max-width:900px;margin:3% auto 8% auto;padding:40px 20px 0 20px}#avatar{width:20%;margin-bottom:3%;border:3px dashed #000}li{margin-bottom:10px}img{max-width:100%}pre{background-color:#f5f5f5;padding:12px;border-radius:4px}code{background-color:#f5f5f5;padding:.2em .4em;font-size:85%;border-radius:3px;font-family:"Courier New",Courier,monospace} \ No newline at end of file +body { + margin: 0; + padding: 0; + height: 100%; + width: 100%; + background: #eaeaea +} + +#app { + margin: 0; + padding: 0 +} + +* { + font-family: monospace, "Courier New", Courier; + color: #555; + font-size: 16px; + font-weight: 400; + line-height: 20px +} + +h1 { + color: #111; + font-size: 32px; + font-weight: 600; + line-height: 36px; + margin: 5px 0 5px 0 +} + +h2 { + margin: 5px 0 5px 0; + color: #111; + font-size: 24px; + font-weight: 600; + line-height: 24px +} + +h3 { + margin: 5px 0 5px 0; + color: #444; + font-size: 18px; + line-height: 18px; + font-weight: 600 +} + +a { + text-decoration: underline; + color: #222; + font-weight: 100 +} + +a:hover { + color: #000 +} + +ul { + margin: 5px 0 5px 0 +} + +li { + margin: 3px 0 3px 0 !important +} + +hr { + border: none; + border-top: 1px solid #bbb; + margin: 15px 0 15px 0 +} + +#realBody { + max-width: 900px; + margin: 3% auto 8% auto; + padding: 40px 20px 0 20px +} + +#avatar { + width: 20%; + margin-bottom: 3%; + border: 3px dashed #000 +} + +li { + margin-bottom: 10px +} + +img { + max-width: 100% +} + +pre { + background-color: #f5f5f5; + padding: 12px; + border-radius: 4px +} + +code { + background-color: #f5f5f5; + padding: .2em .4em; + font-size: 85%; + border-radius: 3px; + font-family: "Courier New", Courier, monospace +} From abebb859628d14b4b16234fb291aa6b6195cb6cf Mon Sep 17 00:00:00 2001 From: Zijun Yang Date: Sat, 13 Aug 2022 16:37:13 +0800 Subject: [PATCH 3/3] docs(inline code): update readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d38f9c1..a2d8602 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,9 @@ Unordered/ordered list Plain text -Code blocks (` ``` `) +Code blocks (` ``` ``` `) + +Inline code blocks (` `` `) ## How to compile