commit 42857daa1f9492af24383efb684892a9c8dfe875
parent 6b598735c2ff342d1beb92c2fb20cb468cae9e91
Author: Abdul Rahim <abdul.rahim@myyahoo.com>
Date: Mon, 21 Oct 2024 19:05:05 +0530
update
Diffstat:
10 files changed, 35 insertions(+), 13 deletions(-)
diff --git a/cJSON.o b/cJSON.o
Binary files differ.
diff --git a/get_lang.o b/get_lang.o
Binary files differ.
diff --git a/reallocarray.o b/reallocarray.o
Binary files differ.
diff --git a/stagit b/stagit
Binary files differ.
diff --git a/stagit-index b/stagit-index
Binary files differ.
diff --git a/stagit-index.o b/stagit-index.o
Binary files differ.
diff --git a/stagit.c b/stagit.c
@@ -534,24 +534,46 @@ writeheader(FILE *fp, const char *title)
/*
* syntax highlight
*/
- fputs("<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/base16/tender.css\">\n", fp);
+ fputs("<script>\n"
+ "const prefersLightTheme = window.matchMedia('(prefers-color-scheme: light)');\n"
+ "if (prefersLightTheme.matches) {\n"
+ "var link = document.createElement('link');\n"
+ "link.rel = 'stylesheet';\n"
+ "link.href = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/xcode.css'; // brown-paper, intellij-light.css\n"
+ "document.head.appendChild(link);\n"
+ "}\n"
+ "else {\n"
+ "var link = document.createElement('link');\n"
+ "link.rel = 'stylesheet';\n"
+ "link.href = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/base16/tender.css';\n"
+ "document.head.appendChild(link);\n"
+ "}\n"
+ "</script>\n",fp);
- fputs("<script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script>\n", fp);
+ fputs("<script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script>\n", fp);
fputs("<script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js\"></script>\n", fp);
-
fputs("<script> hljs.highlightAll() ;</script>\n", fp);
- // for fixing the nextline issues
- fputs("<style>pre code.hljs {display: inline;padding: 0; font-family: \"Source Code Pro\", monospace;"
- "font-optical-sizing: auto;"
- "font-weight: 500;"
- "font-style: normal; } code.hljs {padding: 0;}"
- " .hljs {background: initial;} .hljs-comment{color: rgb(96, 96, 96);}</style>", fp);
- // Doesnt make sense to change these properties, insted, change
- // your style.css to match the theme
- // .hljs::selection, .hljs ::selection {background-color: initial;}
-
+
+ /*fix nextline code issue*/
+ fputs("<style>\n"
+ "pre code.hljs {\n"
+ "display: inline;\n"
+ "padding: 0;\n"
+ "font-family: \"Source Code Pro\", monospace;\n"
+ "font-optical-sizing: auto;\n"
+ "font-weight: 500;\n"
+ "font-style: normal;\n"
+ "}\n"
+ "code.hljs {padding: 0;}\n"
+ ".hljs {background: initial;}\n"
+ "@media (prefers-color-scheme: dark) {\n"
+ ".hljs-comment{color: rgb(100, 100, 100);}\n"
+ "}\n"
+ "</style>\n",fp);
+
+
/*
* add vim keybindings
*/
diff --git a/stagit.o b/stagit.o
Binary files differ.
diff --git a/strlcat.o b/strlcat.o
Binary files differ.
diff --git a/strlcpy.o b/strlcpy.o
Binary files differ.