From 64e866c8354673a286b3629dd52abb27ee787d2f Mon Sep 17 00:00:00 2001 From: Aayush Bajaj Date: Wed, 1 Jan 2025 17:36:01 +1100 Subject: [PATCH] implement code line nums --- assets/js/prism.js | 2 + config/_default/config.toml | 13 ++- config/_default/module.toml | 6 +- content/projects/_index.org | 4 +- content/projects/dl/perceptron/_index.org | 109 +++++++++++++++++++++ content/projects/dl/perceptron/_index.org~ | 80 +++++++++++++++ layouts/shortcodes/.#collapse.html | 1 + 7 files changed, 206 insertions(+), 9 deletions(-) create mode 100644 content/projects/dl/perceptron/_index.org create mode 100644 content/projects/dl/perceptron/_index.org~ create mode 120000 layouts/shortcodes/.#collapse.html diff --git a/assets/js/prism.js b/assets/js/prism.js index b5a9f63..39829aa 100644 --- a/assets/js/prism.js +++ b/assets/js/prism.js @@ -8,4 +8,6 @@ import Prism from "prismjs"; import "prismjs/plugins/{{ . }}/prism-{{ . }}"; {{ end }} +const alias = "jupyter-python"; +Prism.languages[alias] = Prism.languages.python; Prism.highlightAll(); diff --git a/config/_default/config.toml b/config/_default/config.toml index e10ab55..07a5b35 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -62,24 +62,29 @@ enableGitInfo = true "markup", "css", "clike", + "c", "javascript", "latex", "python", "bash", "csharp", - "hcl", - "ignore", "json", "markdown", "powershell", "toml", - "yaml" + "yaml", + "docker", + "git" ] plugins = [ "normalize-whitespace", "toolbar", "copy-to-clipboard", - "command-line" + "command-line", + "line-highlight", + "line-numbers", + "show-language", + "treeview" ] # Social share links for posts: diff --git a/config/_default/module.toml b/config/_default/module.toml index 1cdfa7c..78c664a 100644 --- a/config/_default/module.toml +++ b/config/_default/module.toml @@ -30,9 +30,9 @@ [[mounts]] source = "static" target = "static" -#[[mounts]] -# source = "node_modules/prismjs" -# target = "assets/prismjs" +[[mounts]] + source = "node_modules/prismjs" + target = "assets/prismjs" [[mounts]] source = "node_modules/prism-themes/themes" target = "assets/prism-themes" diff --git a/content/projects/_index.org b/content/projects/_index.org index fce5ab8..e3bcfb6 100644 --- a/content/projects/_index.org +++ b/content/projects/_index.org @@ -126,8 +126,8 @@ These projects are all those that have had a lifecycle. :CUSTOM_ID: deep-learning :END: - [[/projects/dl/benchmarking][Hardware Benchmarking]] -- Perceptron #classification -- Multilayer Perceptron +- [[/projects/dl/perceptron][Perceptron]] #classification +- [[/projects/dl/mlp][Multilayer Perceptron]] - [[/projects/dl/KiTS19][KiTS19 Kidney and Kidney Tumour Segmentation]] - [[/projects/dl/llm-tune][Fine Tuning LLM]] - [[/projects/dl/rag][RAG]] diff --git a/content/projects/dl/perceptron/_index.org b/content/projects/dl/perceptron/_index.org new file mode 100644 index 0000000..8424340 --- /dev/null +++ b/content/projects/dl/perceptron/_index.org @@ -0,0 +1,109 @@ ++++ +title = "Perceptron" ++++ + +This is tomorrow's work, but for now I just want to test some codeblocks: + + +#+begin_src sh +pwd +#+end_src + +#+begin_src command-line +pwd +#+end_src + +#+begin_src treeview +. +├── LICENSE +├── README.md +├── archetypes +├── assets +├── backup +├── config +├── content +├── data +├── eslint.config.mjs +├── go.mod +├── go.sum +├── hugo-mod-json-resume +├── hugo-theme-gruvbox-inkscape.svg +├── hugo-theme-gruvbox.svg +├── hugo_stats.json +├── i18n +├── layouts +├── node_modules +├── package-lock.json +├── package.hugo.json +├── package.json +├── postcss.config.js +├── public +├── resources +├── static +└── theme.toml + +14 directories, 13 files + +#+end_src + +#+RESULTS: +| ./ | | | | +| ├── | _index.org | | | +| └── | _index.org~ | | | +| | | | | +| 1 | directory, | 2 | files | + + +#+ATTR_HTML: :class line-numbers +#+begin_src c + #include + + int main() { + char a[5] = "hello"; + printf("%s world!\n", a); + return 0; + } + +#+end_src + +#+begin_export html +
+  
+    cd /usr/local/etc
+    cp php.ini php.ini.bak
+    vi php.ini
+  
+
+ +
+  
+    pwd
+    /usr/home/chris/bin
+    ls -la
+    total 2
+    drwxr-xr-x   2 chris  chris     11 Jan 10 16:48 .
+    drwxr--r-x  45 chris  chris     92 Feb 14 11:10 ..
+    -rwxr-xr-x   1 chris  chris    444 Aug 25  2013 backup
+    -rwxr-xr-x   1 chris  chris    642 Jan 17 14:42 deploy
+  
+
+#+end_export + + +#+begin_export html +
+  
+    Hello,
+    World!
+
+    Foo
+    Bar
+  
+
+ +#+end_export diff --git a/content/projects/dl/perceptron/_index.org~ b/content/projects/dl/perceptron/_index.org~ new file mode 100644 index 0000000..e2463de --- /dev/null +++ b/content/projects/dl/perceptron/_index.org~ @@ -0,0 +1,80 @@ ++++ +title = "Perceptron" ++++ + +This is tomorrow's work, but for now I just want to test some codeblocks: + + +#+begin_src sh +pwd +#+end_src + +#+begin_src command-line +pwd +#+end_src + +#+begin_src bash + tree -F +#+end_src + +#+RESULTS: +| ./ | | | | +| ├── | _index.org | | | +| └── | _index.org~ | | | +| | | | | +| 1 | directory, | 2 | files | + + +#+ATTR_HTML: :class line-numbers +#+begin_src c + #include + + int main() { + char a[5] = "hello"; + printf("%s world!\n", a); + return 0; + } + +#+end_src + +#+begin_export html +
+  
+    cd /usr/local/etc
+    cp php.ini php.ini.bak
+    vi php.ini
+  
+
+ +
+  
+    pwd
+    /usr/home/chris/bin
+    ls -la
+    total 2
+    drwxr-xr-x   2 chris  chris     11 Jan 10 16:48 .
+    drwxr--r-x  45 chris  chris     92 Feb 14 11:10 ..
+    -rwxr-xr-x   1 chris  chris    444 Aug 25  2013 backup
+    -rwxr-xr-x   1 chris  chris    642 Jan 17 14:42 deploy
+  
+
+#+end_export + + +#+begin_export html +
+  
+    Hello,
+    World!
+
+    Foo
+    Bar
+  
+
+ +#+end_export diff --git a/layouts/shortcodes/.#collapse.html b/layouts/shortcodes/.#collapse.html new file mode 120000 index 0000000..5bbc242 --- /dev/null +++ b/layouts/shortcodes/.#collapse.html @@ -0,0 +1 @@ +aayushbajaj@Aayushs-MacBook-Pro.local.88980 \ No newline at end of file