From ba85815b7e384c7b08b512856778054ee5d105eb Mon Sep 17 00:00:00 2001 From: javalsai Date: Mon, 30 Sep 2024 22:26:29 +0200 Subject: [PATCH] feat: add notes --- components/md-post.html | 4 +++ components/md-pre.html | 19 ++++++++++ notes/example.html | 30 ++++++++++++++++ notes/example.md | 31 ++++++++++++++++ notes/index.html | 28 +++++++++++++++ notes/make-views.sh | 18 ++++++++++ notes/math/.gitkeep | 0 notes/physics/.gitkeep | 0 notes/tech/.gitkeep | 0 styles/bundles/markdown.css | 59 +++++++++++++++++++++++++++++++ styles/code-highlight/default.css | 28 +++++++++++++++ 11 files changed, 217 insertions(+) create mode 100644 components/md-post.html create mode 100644 components/md-pre.html create mode 100644 notes/example.html create mode 100644 notes/example.md create mode 100644 notes/index.html create mode 100755 notes/make-views.sh create mode 100644 notes/math/.gitkeep create mode 100644 notes/physics/.gitkeep create mode 100644 notes/tech/.gitkeep create mode 100644 styles/bundles/markdown.css create mode 100644 styles/code-highlight/default.css diff --git a/components/md-post.html b/components/md-post.html new file mode 100644 index 0000000..7f64157 --- /dev/null +++ b/components/md-post.html @@ -0,0 +1,4 @@ + + + + diff --git a/components/md-pre.html b/components/md-pre.html new file mode 100644 index 0000000..5124422 --- /dev/null +++ b/components/md-pre.html @@ -0,0 +1,19 @@ + + + + + + + + Javalsai's Website + + + + + + + + + + +
diff --git a/notes/example.html b/notes/example.html new file mode 100644 index 0000000..ca38581 --- /dev/null +++ b/notes/example.html @@ -0,0 +1,30 @@ + +

Test Document

+

This is a text markdown document with even code, +LaTeX=xyLaTeX = \frac{x}{y},

+
console.log('language codeblocks');
+

and +LaTeXBlocks=xy +LaTeX~Blocks = \frac{x}{y} +

+

and ofc

+

a complex syntax example

+
struct Handler<T: surrealdb::Connection> {
+    config: crate::config::Schema,
+    #[allow(dead_code)]
+    db: surrealdb::Surreal<T>,
+}
+
+// This is a comment
+/* And this
+is multiline
+*/
+#[async_trait]
+impl<T: surrealdb::Connection> EventHandler for Handler<T> {
+    async fn message(&self, ctx: Context, msg: Message) {
+        let maybe_cmds =
+            commands::parser::MsgParser::new(&self.config.prefix.to_string(), &msg.content).parse();
+    }
+}
+ diff --git a/notes/example.md b/notes/example.md new file mode 100644 index 0000000..0ffb2d2 --- /dev/null +++ b/notes/example.md @@ -0,0 +1,31 @@ +# Test Document +This is a text markdown document with even `code`, $LaTeX = \frac{x}{y}$, +```js +console.log('language codeblocks'); +``` +and +$$ +LaTeX~Blocks = \frac{x}{y} +$$ + +## and ofc +a complex syntax example +```rust +struct Handler { + config: crate::config::Schema, + #[allow(dead_code)] + db: surrealdb::Surreal, +} + +// This is a comment +/* And this +is multiline +*/ +#[async_trait] +impl EventHandler for Handler { + async fn message(&self, ctx: Context, msg: Message) { + let maybe_cmds = + commands::parser::MsgParser::new(&self.config.prefix.to_string(), &msg.content).parse(); + } +} +``` diff --git a/notes/index.html b/notes/index.html new file mode 100644 index 0000000..e923ae1 --- /dev/null +++ b/notes/index.html @@ -0,0 +1,28 @@ + + + + + + + Javalsai's Website - Notes + + + + + +
+

Notes

+

This will just contain markdown notes about academic stuff. Will try to use nice web stuff as much as + possible, like idk, integrate qalc graphs and that into formulas or smth.

+ +

Just for my record, my idea is to name everything as in + U<unit>_<name>.<md/html>

+

Also, example of the markdown to html thing right now, from this to this

+
+ + + diff --git a/notes/make-views.sh b/notes/make-views.sh new file mode 100755 index 0000000..164121a --- /dev/null +++ b/notes/make-views.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -e; + +MYSELF=$(realpath "$0"); +MYDIR=$(dirname "$MYSELF"); + +PRE_IMPORT=${PRE_IMPORT:-/components/md-pre.html} +POST_IMPORT=${POST_IMPORT:-/components/md-post.html} + +find "${1-$MYDIR}" -iname '*.md' | while read -r line; do + # target=${line//\.md/.html} + target=$(sed 's/\.md$/\.html/' <<< "$line") + + echo "$line -> $target"; + echo "" > "$target" + pandoc --mathml "$line" -o - >> "$target" + echo "" >> "$target" +done diff --git a/notes/math/.gitkeep b/notes/math/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/notes/physics/.gitkeep b/notes/physics/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/notes/tech/.gitkeep b/notes/tech/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/styles/bundles/markdown.css b/styles/bundles/markdown.css new file mode 100644 index 0000000..fed9638 --- /dev/null +++ b/styles/bundles/markdown.css @@ -0,0 +1,59 @@ +@import url('/styles/common.css'); +@import url('/styles/classes/breaks.css'); +@import url('/styles/classes/flex.css'); +@import url('/styles/classes/ul-directions.css'); + +@import url('/styles/components/footer.css'); +@import url('/styles/components/header.css'); +@import url('/styles/components/pre-icon.css'); +@import url('/styles/components/reference.css'); + +@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap'); + +body { + max-width: 800px; + min-width: 300px; + padding: 4em; + margin: 4.5em auto auto; + + background: var(--background); + font-family: var(--mono-font); + font-weight: 400; + font-size: 15px; + color: var(--text); + caret-color: var(--primary); +} + +math { + font-family: "Crimson Text"; +} + +pre.sourceCode { + width: 100%; + counter-reset: line-numbering; +} + +code.sourceCode { + width: 100%; + padding: 1em; + display: inline-block; + overflow: scroll; +} + +code.sourceCode > span { + counter-increment: line-numbering; +} + +code.sourceCode > span::before { + content: counter(line-numbering); + display: inline-block; + width: 2em; + margin-right: 1em; + text-align: right; + color: #888; + user-select: none; +} + +*, *::before, *::after { + transition: all .3s ease-out; +} diff --git a/styles/code-highlight/default.css b/styles/code-highlight/default.css new file mode 100644 index 0000000..25d13d5 --- /dev/null +++ b/styles/code-highlight/default.css @@ -0,0 +1,28 @@ +.sourceCode { + color: lightblue; +} + +.sourceCode .bu, .sourceCode .pp { + color: khaki; +} + +.sourceCode .op { + color: var(--text); +} + +.sourceCode .fu { + color: dodgerblue; +} + +.sourceCode .kw, .sourceCode .cf { + color: var(--primary); +} + +.sourceCode .co { + color: #aaa; + font-style: italic; +} + +.sourceCode .st { + color: orange; +}