Skip to content

Commit 6c2d234

Browse files
committed
updates
1 parent 9d4b0b1 commit 6c2d234

22 files changed

+379
-10
lines changed

docs/.obsidian/app.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"defaultViewMode": "source",
33
"newFileLocation": "current",
44
"livePreview": false,
5-
"alwaysUpdateLinks": true
5+
"alwaysUpdateLinks": true,
6+
"showLineNumber": true,
7+
"tabSize": 2,
8+
"vimMode": false
69
}

docs/.obsidian/backlink.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"backlinkInDocument": false
3+
}

docs/.obsidian/community-plugins.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
22
"obsidian-linter",
3-
"obsifetch"
3+
"obsifetch",
4+
"change-case"
45
]

docs/.obsidian/hotkeys.json

+29-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,37 @@
1111
"obsifetch:show": [
1212
{
1313
"modifiers": [
14-
"Alt"
14+
"Alt",
15+
"Mod"
1516
],
1617
"key": "\\"
1718
}
19+
],
20+
"keyshots:toggle-snake-case": [
21+
{
22+
"modifiers": [
23+
"Alt",
24+
"Mod"
25+
],
26+
"key": "-"
27+
}
28+
],
29+
"change-case:snake": [
30+
{
31+
"modifiers": [
32+
"Alt",
33+
"Shift"
34+
],
35+
"key": "-"
36+
}
37+
],
38+
"change-case:capital": [
39+
{
40+
"modifiers": [
41+
"Alt",
42+
"Shift"
43+
],
44+
"key": "="
45+
}
1846
]
1947
}
+271
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
/*
2+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3+
if you want to view the source, please visit the github repository of this plugin
4+
*/
5+
6+
var __defProp = Object.defineProperty;
7+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8+
var __getOwnPropNames = Object.getOwnPropertyNames;
9+
var __hasOwnProp = Object.prototype.hasOwnProperty;
10+
var __export = (target, all) => {
11+
for (var name in all)
12+
__defProp(target, name, { get: all[name], enumerable: true });
13+
};
14+
var __copyProps = (to, from, except, desc) => {
15+
if (from && typeof from === "object" || typeof from === "function") {
16+
for (let key of __getOwnPropNames(from))
17+
if (!__hasOwnProp.call(to, key) && key !== except)
18+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19+
}
20+
return to;
21+
};
22+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23+
24+
// src/main.mts
25+
var main_exports = {};
26+
__export(main_exports, {
27+
default: () => ChangeCasePlugin
28+
});
29+
module.exports = __toCommonJS(main_exports);
30+
var import_obsidian = require("obsidian");
31+
32+
// node_modules/.pnpm/[email protected]/node_modules/change-case/dist/index.js
33+
var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
34+
var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
35+
var SPLIT_SEPARATE_NUMBER_RE = /(\d)\p{Ll}|(\p{L})\d/u;
36+
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
37+
var SPLIT_REPLACE_VALUE = "$1\0$2";
38+
var DEFAULT_PREFIX_SUFFIX_CHARACTERS = "";
39+
function split(value) {
40+
let result = value.trim();
41+
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
42+
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
43+
let start = 0;
44+
let end = result.length;
45+
while (result.charAt(start) === "\0")
46+
start++;
47+
if (start === end)
48+
return [];
49+
while (result.charAt(end - 1) === "\0")
50+
end--;
51+
return result.slice(start, end).split(/\0/g);
52+
}
53+
function splitSeparateNumbers(value) {
54+
var _a;
55+
const words = split(value);
56+
for (let i = 0; i < words.length; i++) {
57+
const word = words[i];
58+
const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
59+
if (match) {
60+
const offset = match.index + ((_a = match[1]) != null ? _a : match[2]).length;
61+
words.splice(i, 1, word.slice(0, offset), word.slice(offset));
62+
}
63+
}
64+
return words;
65+
}
66+
function noCase(input, options) {
67+
var _a;
68+
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
69+
return prefix + words.map(lowerFactory(options == null ? void 0 : options.locale)).join((_a = options == null ? void 0 : options.delimiter) != null ? _a : " ") + suffix;
70+
}
71+
function camelCase(input, options) {
72+
var _a;
73+
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
74+
const lower = lowerFactory(options == null ? void 0 : options.locale);
75+
const upper = upperFactory(options == null ? void 0 : options.locale);
76+
const transform = (options == null ? void 0 : options.mergeAmbiguousCharacters) ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
77+
return prefix + words.map((word, index) => {
78+
if (index === 0)
79+
return lower(word);
80+
return transform(word, index);
81+
}).join((_a = options == null ? void 0 : options.delimiter) != null ? _a : "") + suffix;
82+
}
83+
function pascalCase(input, options) {
84+
var _a;
85+
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
86+
const lower = lowerFactory(options == null ? void 0 : options.locale);
87+
const upper = upperFactory(options == null ? void 0 : options.locale);
88+
const transform = (options == null ? void 0 : options.mergeAmbiguousCharacters) ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
89+
return prefix + words.map(transform).join((_a = options == null ? void 0 : options.delimiter) != null ? _a : "") + suffix;
90+
}
91+
function pascalSnakeCase(input, options) {
92+
return capitalCase(input, { delimiter: "_", ...options });
93+
}
94+
function capitalCase(input, options) {
95+
var _a;
96+
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
97+
const lower = lowerFactory(options == null ? void 0 : options.locale);
98+
const upper = upperFactory(options == null ? void 0 : options.locale);
99+
return prefix + words.map(capitalCaseTransformFactory(lower, upper)).join((_a = options == null ? void 0 : options.delimiter) != null ? _a : " ") + suffix;
100+
}
101+
function constantCase(input, options) {
102+
var _a;
103+
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
104+
return prefix + words.map(upperFactory(options == null ? void 0 : options.locale)).join((_a = options == null ? void 0 : options.delimiter) != null ? _a : "_") + suffix;
105+
}
106+
function dotCase(input, options) {
107+
return noCase(input, { delimiter: ".", ...options });
108+
}
109+
function kebabCase(input, options) {
110+
return noCase(input, { delimiter: "-", ...options });
111+
}
112+
function pathCase(input, options) {
113+
return noCase(input, { delimiter: "/", ...options });
114+
}
115+
function sentenceCase(input, options) {
116+
var _a;
117+
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
118+
const lower = lowerFactory(options == null ? void 0 : options.locale);
119+
const upper = upperFactory(options == null ? void 0 : options.locale);
120+
const transform = capitalCaseTransformFactory(lower, upper);
121+
return prefix + words.map((word, index) => {
122+
if (index === 0)
123+
return transform(word);
124+
return lower(word);
125+
}).join((_a = options == null ? void 0 : options.delimiter) != null ? _a : " ") + suffix;
126+
}
127+
function snakeCase(input, options) {
128+
return noCase(input, { delimiter: "_", ...options });
129+
}
130+
function trainCase(input, options) {
131+
return capitalCase(input, { delimiter: "-", ...options });
132+
}
133+
function lowerFactory(locale) {
134+
return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
135+
}
136+
function upperFactory(locale) {
137+
return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
138+
}
139+
function capitalCaseTransformFactory(lower, upper) {
140+
return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
141+
}
142+
function pascalCaseTransformFactory(lower, upper) {
143+
return (word, index) => {
144+
const char0 = word[0];
145+
const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
146+
return initial + lower(word.slice(1));
147+
};
148+
}
149+
function splitPrefixSuffix(input, options = {}) {
150+
var _a, _b, _c;
151+
const splitFn = (_a = options.split) != null ? _a : options.separateNumbers ? splitSeparateNumbers : split;
152+
const prefixCharacters = (_b = options.prefixCharacters) != null ? _b : DEFAULT_PREFIX_SUFFIX_CHARACTERS;
153+
const suffixCharacters = (_c = options.suffixCharacters) != null ? _c : DEFAULT_PREFIX_SUFFIX_CHARACTERS;
154+
let prefixIndex = 0;
155+
let suffixIndex = input.length;
156+
while (prefixIndex < input.length) {
157+
const char = input.charAt(prefixIndex);
158+
if (!prefixCharacters.includes(char))
159+
break;
160+
prefixIndex++;
161+
}
162+
while (suffixIndex > prefixIndex) {
163+
const index = suffixIndex - 1;
164+
const char = input.charAt(index);
165+
if (!suffixCharacters.includes(char))
166+
break;
167+
suffixIndex = index;
168+
}
169+
return [
170+
input.slice(0, prefixIndex),
171+
splitFn(input.slice(prefixIndex, suffixIndex)),
172+
input.slice(suffixIndex)
173+
];
174+
}
175+
176+
// src/commands.mts
177+
var wrap = (id, fn) => ({
178+
id,
179+
name: fn(id + " case", { locale: false }),
180+
fn
181+
});
182+
var commands = [
183+
wrap("lower", (s, o) => s.toLocaleLowerCase((o == null ? void 0 : o.locale) || void 0)),
184+
wrap("upper", (s, o) => s.toLocaleUpperCase((o == null ? void 0 : o.locale) || void 0)),
185+
wrap("camel", camelCase),
186+
wrap("capital", capitalCase),
187+
wrap("constant", constantCase),
188+
wrap("dot", dotCase),
189+
wrap("kebab", kebabCase),
190+
wrap("no", noCase),
191+
wrap("pascal", pascalCase),
192+
wrap("pascalSnake", pascalSnakeCase),
193+
wrap("path", pathCase),
194+
wrap("sentence", sentenceCase),
195+
wrap("snake", snakeCase),
196+
wrap("train", trainCase)
197+
];
198+
199+
// src/language.mts
200+
var OBSIDIAN_LANG;
201+
try {
202+
OBSIDIAN_LANG = self.localStorage.getItem("language");
203+
} catch (e) {
204+
}
205+
var getLang = () => {
206+
let lang = OBSIDIAN_LANG;
207+
try {
208+
lang || (lang = self.navigator.language);
209+
} catch (e) {
210+
}
211+
return lang || void 0;
212+
};
213+
214+
// src/main.mts
215+
var normalizeSelection = ({
216+
anchor,
217+
head
218+
}) => anchor.line < head.line ? [anchor, head] : anchor.line > head.line ? [head, anchor] : anchor.ch < head.ch ? [anchor, head] : [head, anchor];
219+
var replaceAllSelections = (editor, fn) => {
220+
if (editor.somethingSelected()) {
221+
const locale = getLang();
222+
editor.transaction({
223+
changes: editor.listSelections().map((selection) => {
224+
const [from, to] = normalizeSelection(selection);
225+
const str = editor.getRange(from, to).normalize();
226+
return { from, to, text: fn(str, { locale }) };
227+
})
228+
});
229+
}
230+
};
231+
var SelectCaseModal = class extends import_obsidian.FuzzySuggestModal {
232+
constructor(app, editor) {
233+
super(app);
234+
this._editor = editor;
235+
}
236+
getItems() {
237+
return commands;
238+
}
239+
getItemText(cmd) {
240+
return cmd.name;
241+
}
242+
onChooseItem(cmd) {
243+
replaceAllSelections(this._editor, cmd.fn);
244+
}
245+
};
246+
var ChangeCasePlugin = class extends import_obsidian.Plugin {
247+
async onload() {
248+
this.addCommand({
249+
id: "select",
250+
name: "Select from list",
251+
icon: "case-sensitive",
252+
editorCallback: (editor) => {
253+
const modal = new SelectCaseModal(this.app, editor);
254+
modal.setPlaceholder("Choose a format for the selection");
255+
modal.open();
256+
}
257+
});
258+
for (const { id, name, fn } of commands) {
259+
this.addCommand({
260+
id,
261+
name,
262+
icon: "case-sensitive",
263+
editorCallback: (editor) => {
264+
replaceAllSelections(editor, fn);
265+
}
266+
});
267+
}
268+
}
269+
};
270+
271+
/* nosourcemap */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": "change-case",
3+
"name": "Change Case",
4+
"version": "2.0.139",
5+
"minAppVersion": "0.15.0",
6+
"description": "Plugin to let you change the case (UPPER CASE, camelCase, snake_case, etc) of the current selection.",
7+
"author": "David Brockman",
8+
"isDesktopOnly": false
9+
}

docs/projects/Building a Personal Blog Site.md docs/projects/building_a_personal_blog_site.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
tags:
33
- WIP
44
date: 2024-11-12
5-
title: Building a Personal Blog Site
5+
title: Building A Personal Blog Site
66
---
77

88
# Background
@@ -11,7 +11,19 @@ I've always liked the idea of keeping notes organized and together (whether that
1111

1212
## Requirements
1313

14-
I needed a static site generator that could easily integrate with my notes and ideally bring some functionality from Obsidian itself. I initially started with a barebones mkdocs setup, eventually adding some Obsidian-esque plugins to make the experience browsing the site as similar. I eventually came across Quartz
14+
I needed something that could:
15+
- Easily integrate with my notes
16+
- Ideally my notes can be kept separate, and all I need to d
17+
- Ideally bring some functionality from Obsidian itself
18+
- Namely the visualizations and tagging, I liked how the graph drew links between relevant notes
19+
20+
## Rev. 1
21+
22+
I initially started with a barebones mkdocs setup, a popular static site generator for documentation. I eventually added some Obsidian-esque plugins to make the experience browsing the site as similar.
23+
24+
## Rev. 2
25+
26+
I eventually came across Quartz which does some of the visualizations out of the box. I was also a fan of its design and decided to switch SSGs.
1527

1628
# Media
1729

docs/projects/ideas.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
tags:
3+
- stub
4+
- WIP
5+
date: 2025-01-12
6+
title: ideas
7+
---
8+
9+
Wanted to keep track of various ideas for projects. Hopefully I find some time to start them... one day...
10+
11+
- Digital calendar for home
12+
- Habit tracker (git activity style)
13+
- Fun reskin of kube-ops-view
14+
- Static site generator for Obsidian
15+
- Guitar tab builder

0 commit comments

Comments
 (0)