commit 5128a9ce0f23ded28aa874dafbd7b5b47b63d039 Author: Leon Liu Date: Mon Nov 18 04:20:00 2024 +0000 Snapshot diff --git a/.silverbullet.db b/.silverbullet.db new file mode 100644 index 0000000..80a244e Binary files /dev/null and b/.silverbullet.db differ diff --git a/.silverbullet.db-shm b/.silverbullet.db-shm new file mode 100644 index 0000000..1eb87cf Binary files /dev/null and b/.silverbullet.db-shm differ diff --git a/.silverbullet.db-wal b/.silverbullet.db-wal new file mode 100644 index 0000000..6d6791f Binary files /dev/null and b/.silverbullet.db-wal differ diff --git a/Car Inspection.md b/Car Inspection.md new file mode 100644 index 0000000..2d93ddf --- /dev/null +++ b/Car Inspection.md @@ -0,0 +1,7 @@ +#life-routine #japan + +- [ ] Car inspection πŸ“…2025-12-01 + +* Every 2 years +* Book with Tesla app +* Inspection at [Tokyo Bay](https://www.tesla.com/findus/location/service/tokyobay). \ No newline at end of file diff --git a/Car Insurance.md b/Car Insurance.md new file mode 100644 index 0000000..1cb4fc1 --- /dev/null +++ b/Car Insurance.md @@ -0,0 +1,9 @@ +#life-routine #japan + +- [ ] Car insurance continuation πŸ“…2025-12-26 + +* Every year +* SBI損保 + * [Login page](https://pc.sbisonpo.co.jp/cs/GCWS206CControl?KEIRO=1&CAMP_CD=2401000&RENKEI9=) + * ID: 020075730492 + * Password saved in Chrome \ No newline at end of file diff --git a/Driver License Update.md b/Driver License Update.md new file mode 100644 index 0000000..2f59ff6 --- /dev/null +++ b/Driver License Update.md @@ -0,0 +1,5 @@ +#life-routine #japan + +* [ ] Driver license update πŸ“…2027-01-04 + +* Post card will be delivered to mailbox before date to update \ No newline at end of file diff --git a/Library/Core/New Page/Page Template.md b/Library/Core/New Page/Page Template.md new file mode 100644 index 0000000..6e19acd --- /dev/null +++ b/Library/Core/New Page/Page Template.md @@ -0,0 +1,12 @@ +--- +description: Create a New Page template +tags: template +hooks.newPage: + suggestedName: "Library/Personal/New Page/" + confirmName: true +frontmatter: | + tags: template + displayName: "|^|" + hooks.newPage: + suggestedName: "" +--- diff --git a/Library/Core/New Page/Quick Note.md b/Library/Core/New Page/Quick Note.md new file mode 100644 index 0000000..16a85d6 --- /dev/null +++ b/Library/Core/New Page/Quick Note.md @@ -0,0 +1,9 @@ +--- +description: "Create a quick note" +tags: template +hooks.newPage: + suggestedName: "Inbox/{{today}}/{{safeTime}}" + confirmName: false + command: "Quick Note" + key: "Alt-Shift-n" +--- diff --git a/Library/Core/New Page/Snippet Template.md b/Library/Core/New Page/Snippet Template.md new file mode 100644 index 0000000..e3899b4 --- /dev/null +++ b/Library/Core/New Page/Snippet Template.md @@ -0,0 +1,11 @@ +--- +tags: template +description: Create a new Snippet template +hooks.newPage: + suggestedName: Library/Personal/Snippet/ + confirmName: true +frontmatter: | + tags: template + hooks.snippet: + slashCommand: "|^|" +--- diff --git a/Library/Core/Page/Maintenance.md b/Library/Core/Page/Maintenance.md new file mode 100644 index 0000000..0e4f5b4 --- /dev/null +++ b/Library/Core/Page/Maintenance.md @@ -0,0 +1,37 @@ +#meta + +We would like to keep our space clean, these are some tools that help you do that. + +# Aspiring pages +This shows all page links that link to a page that does not (yet) exist. These could be broken links or just pages _aspiring_ to be created. + +```template +{{#let @brokenLinks = {aspiring-page}}} +{{#if @brokenLinks}} +{{#each @brokenLinks}} +* [[{{ref}}]]: broken link to [[{{name}}]] +{{/each}} +{{else}} +No aspiring pages, all good! +{{/if}} +{{/let}} +``` + +# Conflict copies +These are pages that have conflicted copies (as a result of sync), have a look at them as well as their original (non-conflicted versions) and decide which one to keep. + +```template +{{#let @conflictPages = { + page where name =~ /\.conflicted\.\d+$/ + select name as conflictedName, + replace(name, /\.conflicted\.\d+$/, "") as cleanName +}}} +{{#if @conflictPages}} +{{#each @conflictPages}} +* [[{{cleanName}}]]: confict copy [[{{conflictedName}}]] +{{/each}} +{{else}} +No conflicting pages! +{{/if}} +{{/let}} +``` diff --git a/Library/Core/Page/Meta Index.md b/Library/Core/Page/Meta Index.md new file mode 100644 index 0000000..d9264dc --- /dev/null +++ b/Library/Core/Page/Meta Index.md @@ -0,0 +1,7 @@ +#meta + +This page lists all `#meta` tagged pages currently available in your space. You can also navigate to them via the {[Navigate: Meta Picker]}. + +```query +page where tags = "meta" render [[Library/Core/Query/Page]] +``` \ No newline at end of file diff --git a/Library/Core/Page/Space Overview.md b/Library/Core/Page/Space Overview.md new file mode 100644 index 0000000..f250881 --- /dev/null +++ b/Library/Core/Page/Space Overview.md @@ -0,0 +1,39 @@ +#meta + +This page compiles some useful things about your space and may also be useful for debugging things. + +# Stats +```template +**Total pages:** {{count({page select name})}} +**Total attachments:** {{count({attachment select name})}} +**Total tags:** {{count({tag select name})}} +``` + +# Active [[!silverbullet.md/Space Script]] +```template +{{#each {space-script}}} +* [[{{ref}}]] +{{/each}} +``` + +# Active [[!silverbullet.md/Space Style]] +```template +{{#each {space-style}}} +* [[{{ref}}]] +{{/each}} +``` + +# Active [[!silverbullet.md/Space Config]] +You have space config defined on the following pages: +```template +{{#each {space-config select replace(ref, /@.+/, "") as page}}} +* [[{{page}}]] +{{/each}} +``` + +Composed, this leads to the following active configuration: +```template +~~~yaml +{{yaml(@config)}} +~~~ +``` diff --git a/Library/Core/Page/Template Index.md b/Library/Core/Page/Template Index.md new file mode 100644 index 0000000..d269fa2 --- /dev/null +++ b/Library/Core/Page/Template Index.md @@ -0,0 +1,52 @@ +#meta + +This page lists all templates currently available in your space. You can also navigate to them via the {[Navigate: Meta Picker]}. More information on templates can be found [[!silverbullet.md/Templates]] + +# New Page +These [[!silverbullet.md/Page Templates]] are available through the {[Page: From Template]} command: + +```query +template where hooks.newPage render [[Library/Core/Query/Template]] +``` + +# Snippets +These can be used as [[!silverbullet.md/Snippets]] via [[!silverbullet.md/Slash Commands]]: + +```template +{{#each { + template + where hooks.snippet + order by hooks.snippet.slashCommand +}}} +* [[{{ref}}|/{{hooks.snippet.slashCommand}}]] {{description}} +{{/each}} +``` + +# Widgets +Widgets can either be automatically attached to the top or bottom of pages (matching certain criteria) or used inline via [[!silverbullet.md/Live Templates]]. + +## Top +```query +template +where hooks.top +order by order +render [[Library/Core/Query/Template]] +``` + +## Bottom +```query +template +where hooks.bottom +order by order +render [[Library/Core/Query/Template]] +``` + +## Inline +Use with [[!silverbullet.md/Live Templates#Include]] to render useful things in your pages: + +```query +template +where name =~ /\/Widget\// and not hooks.top and not hooks.bottom +order by order +render [[Library/Core/Query/Template]] +``` diff --git a/Library/Core/Query/Full Page.md b/Library/Core/Query/Full Page.md new file mode 100644 index 0000000..0357f1c --- /dev/null +++ b/Library/Core/Query/Full Page.md @@ -0,0 +1,5 @@ +--- +tags: template +description: A page reference link as a list item showing the full page path +--- +* [[{{name}}|{{name}}]] \ No newline at end of file diff --git a/Library/Core/Query/Page.md b/Library/Core/Query/Page.md new file mode 100644 index 0000000..ee67153 --- /dev/null +++ b/Library/Core/Query/Page.md @@ -0,0 +1,5 @@ +--- +tags: template +description: A page reference link as a list item +--- +* [[{{name}}]] \ No newline at end of file diff --git a/Library/Core/Query/Task.md b/Library/Core/Query/Task.md new file mode 100644 index 0000000..4c80103 --- /dev/null +++ b/Library/Core/Query/Task.md @@ -0,0 +1,5 @@ +--- +tags: template +description: Generic task template that supports updating the status back in the origin page +--- +* [{{state}}] [[{{ref}}]] {{name}} \ No newline at end of file diff --git a/Library/Core/Query/Template.md b/Library/Core/Query/Template.md new file mode 100644 index 0000000..51dee54 --- /dev/null +++ b/Library/Core/Query/Template.md @@ -0,0 +1,8 @@ +--- +tags: template +--- + +* [[{{ref}}]] {{description}} +{{#if usage}} + * **Usage:** {{usage}} +{{/if}} \ No newline at end of file diff --git a/Library/Core/Quick Notes.md b/Library/Core/Quick Notes.md new file mode 100644 index 0000000..55bb148 --- /dev/null +++ b/Library/Core/Quick Notes.md @@ -0,0 +1,8 @@ +This is your {[Quick Note]} inbox. + +```query +page + where name =~ /^Inbox\// + render [[Library/Core/Query/Full Page]] + order by lastModified desc +``` diff --git a/Library/Core/Snippet/code.md b/Library/Core/Snippet/code.md new file mode 100644 index 0000000..4c75c52 --- /dev/null +++ b/Library/Core/Snippet/code.md @@ -0,0 +1,8 @@ +--- +description: Insert a fenced code block +tags: template +hooks.snippet.slashCommand: code +--- +```|^| + +``` diff --git a/Library/Core/Snippet/each-directive.md b/Library/Core/Snippet/each-directive.md new file mode 100644 index 0000000..a10fb5e --- /dev/null +++ b/Library/Core/Snippet/each-directive.md @@ -0,0 +1,10 @@ +--- +description: (Template) Insert an `#each` directive +tags: template +hooks.snippet: + slashCommand: "#each" + order: 10 +--- +{{escapeDirective("#each |^|")}} + +{{escapeDirective("/each")}} \ No newline at end of file diff --git a/Library/Core/Snippet/frontmatter.md b/Library/Core/Snippet/frontmatter.md new file mode 100644 index 0000000..4e7d87b --- /dev/null +++ b/Library/Core/Snippet/frontmatter.md @@ -0,0 +1,11 @@ +--- +tags: template +description: Insert Frontmatter +hooks.snippet: + slashCommand: frontmatter + insertAt: page-start + command: "Insert Frontmatter" +--- +--- +|^| +--- diff --git a/Library/Core/Snippet/h1.md b/Library/Core/Snippet/h1.md new file mode 100644 index 0000000..55fc849 --- /dev/null +++ b/Library/Core/Snippet/h1.md @@ -0,0 +1,8 @@ +--- +tags: template +description: Make this a level 1 heading +hooks.snippet: + slashCommand: h1 + matchRegex: "^#*\\s*" +--- +# \ No newline at end of file diff --git a/Library/Core/Snippet/h2.md b/Library/Core/Snippet/h2.md new file mode 100644 index 0000000..e2b5a4e --- /dev/null +++ b/Library/Core/Snippet/h2.md @@ -0,0 +1,8 @@ +--- +tags: template +description: Make this a level 2 heading +hooks.snippet: + slashCommand: h2 + matchRegex: "^#*\\s*" +--- +## \ No newline at end of file diff --git a/Library/Core/Snippet/h3.md b/Library/Core/Snippet/h3.md new file mode 100644 index 0000000..5c23af5 --- /dev/null +++ b/Library/Core/Snippet/h3.md @@ -0,0 +1,8 @@ +--- +tags: template +description: Make this a level 3 heading +hooks.snippet: + slashCommand: h3 + matchRegex: "^#*\\s*" +--- +### \ No newline at end of file diff --git a/Library/Core/Snippet/h4.md b/Library/Core/Snippet/h4.md new file mode 100644 index 0000000..f9a47fc --- /dev/null +++ b/Library/Core/Snippet/h4.md @@ -0,0 +1,8 @@ +--- +tags: template +description: Make this a level 4 heading +hooks.snippet: + slashCommand: h4 + matchRegex: "^#*\\s*" +--- +#### \ No newline at end of file diff --git a/Library/Core/Snippet/hr.md b/Library/Core/Snippet/hr.md new file mode 100644 index 0000000..b2ce4af --- /dev/null +++ b/Library/Core/Snippet/hr.md @@ -0,0 +1,6 @@ +--- +tags: template +description: Insert a horizontal rule +hooks.snippet.slashCommand: hr +--- +--- diff --git a/Library/Core/Snippet/if-directive.md b/Library/Core/Snippet/if-directive.md new file mode 100644 index 0000000..003990a --- /dev/null +++ b/Library/Core/Snippet/if-directive.md @@ -0,0 +1,10 @@ +--- +description: (Template) Insert an `#if` directive +tags: template +hooks.snippet: + slashCommand: "#if" + order: 10 +--- +{{escapeDirective("#if |^|")}} + +{{escapeDirective("/if")}} \ No newline at end of file diff --git a/Library/Core/Snippet/if-else-directive.md b/Library/Core/Snippet/if-else-directive.md new file mode 100644 index 0000000..638a231 --- /dev/null +++ b/Library/Core/Snippet/if-else-directive.md @@ -0,0 +1,12 @@ +--- +description: (Template) Insert `#if` directive with 'else' +tags: template +hooks.snippet: + slashCommand: "#if-else" + order: 10 +--- +{{escapeDirective("#if |^|")}} + +{{escapeDirective("else")}} + +{{escapeDirective("/if")}} \ No newline at end of file diff --git a/Library/Core/Snippet/include-page.md b/Library/Core/Snippet/include-page.md new file mode 100644 index 0000000..1d6d259 --- /dev/null +++ b/Library/Core/Snippet/include-page.md @@ -0,0 +1,8 @@ +--- +tags: template +description: Add a live preview of a page +hooks.snippet.slashCommand: include-page +--- +```include +raw: "[[|^|]]" +``` diff --git a/Library/Core/Snippet/item.md b/Library/Core/Snippet/item.md new file mode 100644 index 0000000..553b042 --- /dev/null +++ b/Library/Core/Snippet/item.md @@ -0,0 +1,10 @@ +--- +tags: template +description: Make this a bullet item +hooks.snippet: + slashCommand: item + matchRegex: "^(\\s*)[\\-\\*]?\\s*" + command: "Text: Turn into a bullet item" + key: "Ctrl-q i" +--- +$1* \ No newline at end of file diff --git a/Library/Core/Snippet/let-directive.md b/Library/Core/Snippet/let-directive.md new file mode 100644 index 0000000..d0c0d80 --- /dev/null +++ b/Library/Core/Snippet/let-directive.md @@ -0,0 +1,10 @@ +--- +description: (Template) Insert a `#let` directive +tags: template +hooks.snippet: + slashCommand: "#let" + order: 10 +--- +{{escapeDirective("#let @|^| = ")}} + +{{escapeDirective("/let")}} \ No newline at end of file diff --git a/Library/Core/Snippet/note-admonition.md b/Library/Core/Snippet/note-admonition.md new file mode 100644 index 0000000..f02355c --- /dev/null +++ b/Library/Core/Snippet/note-admonition.md @@ -0,0 +1,7 @@ +--- +tags: template +description: Insert a "note" admonition +hooks.snippet.slashCommand: note-admonition +--- +> **note** Note +> |^| diff --git a/Library/Core/Snippet/query.md b/Library/Core/Snippet/query.md new file mode 100644 index 0000000..0648b34 --- /dev/null +++ b/Library/Core/Snippet/query.md @@ -0,0 +1,8 @@ +--- +description: Insert a live query +tags: template +hooks.snippet.slashCommand: query +--- +```query +|^| +``` diff --git a/Library/Core/Snippet/table.md b/Library/Core/Snippet/table.md new file mode 100644 index 0000000..0761950 --- /dev/null +++ b/Library/Core/Snippet/table.md @@ -0,0 +1,8 @@ +--- +tags: template +description: Insert a table +hooks.snippet.slashCommand: table +--- +| Header A | Header B | +|----------|----------| +| Cell A|^| | Cell B | \ No newline at end of file diff --git a/Library/Core/Snippet/task.md b/Library/Core/Snippet/task.md new file mode 100644 index 0000000..108e4b4 --- /dev/null +++ b/Library/Core/Snippet/task.md @@ -0,0 +1,10 @@ +--- +tags: template +description: Make this a task +hooks.snippet: + slashCommand: task + matchRegex: "^(\\s*)[\\-\\*]?\\s*(\\[[ xX]\\])?\\s*" + command: "Text: Turn into task" + key: "Ctrl-q t" +--- +$1* [ ] \ No newline at end of file diff --git a/Library/Core/Snippet/template.md b/Library/Core/Snippet/template.md new file mode 100644 index 0000000..90ba62b --- /dev/null +++ b/Library/Core/Snippet/template.md @@ -0,0 +1,8 @@ +--- +description: Insert a template +tags: template +hooks.snippet.slashCommand: "template" +--- +```template +|^| +``` diff --git a/Library/Core/Snippet/today.md b/Library/Core/Snippet/today.md new file mode 100644 index 0000000..a8f31e7 --- /dev/null +++ b/Library/Core/Snippet/today.md @@ -0,0 +1,6 @@ +--- +tags: template +description: "Today's date" +hooks.snippet.slashCommand: today +--- +{{today}} \ No newline at end of file diff --git a/Library/Core/Snippet/tomorrow.md b/Library/Core/Snippet/tomorrow.md new file mode 100644 index 0000000..82fb4c6 --- /dev/null +++ b/Library/Core/Snippet/tomorrow.md @@ -0,0 +1,6 @@ +--- +tags: template +description: "Tomorrow's date" +hooks.snippet.slashCommand: tomorrow +--- +{{tomorrow}} \ No newline at end of file diff --git a/Library/Core/Snippet/warning-admonition.md b/Library/Core/Snippet/warning-admonition.md new file mode 100644 index 0000000..b1ddfc1 --- /dev/null +++ b/Library/Core/Snippet/warning-admonition.md @@ -0,0 +1,7 @@ +--- +description: Insert a "warning" admonition +tags: template +hooks.snippet.slashCommand: warning-admonition +--- +> **warning** Warning +> |^| diff --git a/Library/Core/Widget/Federated Template Copy.md b/Library/Core/Widget/Federated Template Copy.md new file mode 100644 index 0000000..5bb011c --- /dev/null +++ b/Library/Core/Widget/Federated Template Copy.md @@ -0,0 +1,9 @@ +--- +description: > + Adds a convenient "Copy to my space" button to any + template found via federation +tags: template +hooks.bottom.where: 'name =~ /^!/ and tags="template"' +--- +# Template actions +* {[Page: Copy|Copy to my space]}: use this template in your space by making a local copy of it (and tweaking it as you like) \ No newline at end of file diff --git a/Library/Core/Widget/Linked Mentions.md b/Library/Core/Widget/Linked Mentions.md new file mode 100644 index 0000000..8bb4e84 --- /dev/null +++ b/Library/Core/Widget/Linked Mentions.md @@ -0,0 +1,13 @@ +--- +description: Adds Linked Mentions to pages +tags: template +hooks.bottom.where: 'true' +--- +{{#let @linkedMentions = {link where toPage = @page.name and page != @page.name order by page}}} +{{#if @linkedMentions}} +# Linked Mentions +{{#each @linkedMentions}} +* [[{{ref}}]]: β€œ{{snippet}}” +{{/each}} +{{/if}} +{{/let}} diff --git a/Library/Core/Widget/Linked Tasks.md b/Library/Core/Widget/Linked Tasks.md new file mode 100644 index 0000000..66884b6 --- /dev/null +++ b/Library/Core/Widget/Linked Tasks.md @@ -0,0 +1,16 @@ +--- +tags: template +description: | + Shows all tasks that contain a link the current page. For instance a task that references `[[John]]` in its name, would appear on the `John` page. +hooks.top: + where: 'true' + order: 1 +--- +{{#let @linkedTasks = {task where not done and (contains(name, "[[" + @page.name + "]]") or contains(name, "[[" + @page.name + "|"))}}} +{{#if @linkedTasks}} +# Linked Tasks +{{#each @linkedTasks}} +{{template([[Library/Core/Query/Task]], .)}} +{{/each}} +{{/if}} +{{/let}} diff --git a/Library/Core/Widget/Table of Contents.md b/Library/Core/Widget/Table of Contents.md new file mode 100644 index 0000000..22ff719 --- /dev/null +++ b/Library/Core/Widget/Table of Contents.md @@ -0,0 +1,11 @@ +--- +description: Adds a Table of Contents to pages +tags: template +hooks.top: + where: 'not pageDecoration.disableTOC' + # Show all the way at the top + order: 0 +--- +```toc +minHeaders: 3 +``` diff --git a/Library/Core/Widget/Tagged Tasks.md b/Library/Core/Widget/Tagged Tasks.md new file mode 100644 index 0000000..f696607 --- /dev/null +++ b/Library/Core/Widget/Tagged Tasks.md @@ -0,0 +1,9 @@ +--- +tags: template +description: Queries all tasks tagged with a specific tag. +usage: Pass in the tag to filter on as the `value` of this template +--- + +```query +task where tags = "{{.}}" and not done render [[Library/Core/Query/Task]] +``` \ No newline at end of file diff --git a/PLUGS.md b/PLUGS.md new file mode 100644 index 0000000..4388285 --- /dev/null +++ b/PLUGS.md @@ -0,0 +1,5 @@ +This file lists all plugs that SilverBullet will load. Run the {[Plugs: Update]} command to update and reload this list of plugs. + +```yaml +- github:silverbulletmd/silverbullet-git/git.plug.js +``` \ No newline at end of file diff --git a/SETTINGS.md b/SETTINGS.md new file mode 100644 index 0000000..dbfa9ad --- /dev/null +++ b/SETTINGS.md @@ -0,0 +1,14 @@ +#meta + +This page contains some configuration overrides for SilverBullet. A list of configs and their documentation [[!silverbullet.md/SETTINGS|can be found here]]. + +To update the [[!silverbullet.md/Libraries|libraries]] specified below, run {[Libraries: Update]} + +```yaml +indexPage: "[[index]]" +libraries: +- import: "[[!silverbullet.md/Library/Core/*]]" +git: + autoCommitMinutes: 5 + autoSync: true +``` diff --git a/Year-end Tax Adjustment.md b/Year-end Tax Adjustment.md new file mode 100644 index 0000000..9b98f85 --- /dev/null +++ b/Year-end Tax Adjustment.md @@ -0,0 +1,4 @@ +#life-routine #japan + +* Have to do it myself when yearly income > 20,000,000 yen +* [etax](https://www.e-tax.nta.go.jp/) \ No newline at end of file diff --git a/_plug/git.plug.js b/_plug/git.plug.js new file mode 100644 index 0000000..1130d7f --- /dev/null +++ b/_plug/git.plug.js @@ -0,0 +1 @@ +var T=Object.defineProperty;var p=(e,t)=>{for(var o in t)T(e,o,{get:t[o],enumerable:!0})};var u=e=>{throw new Error("Not initialized yet")},g=typeof window>"u"&&typeof globalThis.WebSocketPair>"u";typeof Deno>"u"&&(self.Deno={args:[],build:{arch:"x86_64"},env:{get(){}}});var f=new Map,d=0;g&&(globalThis.syscall=async(e,...t)=>await new Promise((o,n)=>{d++,f.set(d,{resolve:o,reject:n}),u({type:"sys",id:d,name:e,args:t})}));function P(e,t,o){g&&(u=o,self.addEventListener("message",n=>{(async()=>{let i=n.data;switch(i.type){case"inv":{let m=e[i.name];if(!m)throw new Error(`Function not loaded: ${i.name}`);try{let c=await Promise.resolve(m(...i.args||[]));u({type:"invr",id:i.id,result:c})}catch(c){console.error("An exception was thrown as a result of invoking function",i.name,"error:",c.message),u({type:"invr",id:i.id,error:c.message})}}break;case"sysr":{let m=i.id,c=f.get(m);if(!c)throw Error("Invalid request id");f.delete(m),i.error?c.reject(new Error(i.error)):c.resolve(i.result)}break}})().catch(console.error)}),u({type:"manifest",manifest:t}))}function k(e){let t=atob(e),o=t.length,n=new Uint8Array(o);for(let i=0;i0?x(o):void 0;t={method:e.method,headers:Object.fromEntries(e.headers.entries()),base64Body:n},e=e.url}return syscall("sandboxFetch.fetch",e,t)}globalThis.nativeFetch=globalThis.fetch;function R(){globalThis.fetch=async function(e,t){let o=t&&t.body?x(new Uint8Array(await new Response(t.body).arrayBuffer())):void 0,n=await U(e,t&&{method:t.method,headers:t.headers,base64Body:o});return new Response(n.base64Body?k(n.base64Body):null,{status:n.status,headers:n.headers})}}g&&R();var s={};p(s,{confirm:()=>ae,copyToClipboard:()=>xe,deleteLine:()=>he,dispatch:()=>ie,downloadFile:()=>I,filterBox:()=>J,flashNotification:()=>z,fold:()=>ue,foldAll:()=>de,getCurrentPage:()=>E,getCursor:()=>L,getSelection:()=>N,getText:()=>D,getUiOption:()=>me,goHistory:()=>Y,hidePanel:()=>Z,insertAtCursor:()=>ne,insertAtPos:()=>ee,moveCursor:()=>re,moveCursorToLine:()=>oe,navigate:()=>j,newWindow:()=>V,openCommandPalette:()=>B,openPageNavigator:()=>W,openSearchPanel:()=>Pe,openUrl:()=>Q,prompt:()=>se,redo:()=>ye,reloadConfigAndCommands:()=>$,reloadPage:()=>O,reloadUI:()=>_,replaceRange:()=>te,save:()=>q,setSelection:()=>G,setText:()=>K,setUiOption:()=>ce,showPanel:()=>X,toggleFold:()=>pe,undo:()=>ge,unfold:()=>le,unfoldAll:()=>fe,uploadFile:()=>H,vimEx:()=>ve});typeof self>"u"&&(self={syscall:()=>{throw new Error("Not implemented here")}});function r(e,...t){return globalThis.syscall(e,...t)}function E(){return r("editor.getCurrentPage")}function D(){return r("editor.getText")}function K(e,t=!1){return r("editor.setText",e,t)}function L(){return r("editor.getCursor")}function N(){return r("editor.getSelection")}function G(e,t){return r("editor.setSelection",e,t)}function q(){return r("editor.save")}function j(e,t=!1,o=!1){return r("editor.navigate",e,t,o)}function W(e="page"){return r("editor.openPageNavigator",e)}function B(){return r("editor.openCommandPalette")}function O(){return r("editor.reloadPage")}function _(){return r("editor.reloadUI")}function $(){return r("editor.reloadConfigAndCommands")}function Q(e,t=!1){return r("editor.openUrl",e,t)}function V(){return r("editor.newWindow")}function Y(e){return r("editor.goHistory",e)}function I(e,t){return r("editor.downloadFile",e,t)}function H(e,t){return r("editor.uploadFile",e,t)}function z(e,t="info"){return r("editor.flashNotification",e,t)}function J(e,t,o="",n=""){return r("editor.filterBox",e,t,o,n)}function X(e,t,o,n=""){return r("editor.showPanel",e,t,o,n)}function Z(e){return r("editor.hidePanel",e)}function ee(e,t){return r("editor.insertAtPos",e,t)}function te(e,t,o){return r("editor.replaceRange",e,t,o)}function re(e,t=!1){return r("editor.moveCursor",e,t)}function oe(e,t=1,o=!1){return r("editor.moveCursorToLine",e,t,o)}function ne(e){return r("editor.insertAtCursor",e)}function ie(e){return r("editor.dispatch",e)}function se(e,t=""){return r("editor.prompt",e,t)}function ae(e){return r("editor.confirm",e)}function me(e){return r("editor.getUiOption",e)}function ce(e,t){return r("editor.setUiOption",e,t)}function ue(){return r("editor.fold")}function le(){return r("editor.unfold")}function pe(){return r("editor.toggleFold")}function de(){return r("editor.foldAll")}function fe(){return r("editor.unfoldAll")}function ge(){return r("editor.undo")}function ye(){return r("editor.redo")}function Pe(){return r("editor.openSearchPanel")}function xe(e){return r("editor.copyToClipboard",e)}function he(){return r("editor.deleteLine")}function ve(e){return r("editor.vimEx",e)}var l={};p(l,{applyAttributeExtractors:()=>Te,getEnv:()=>Ee,getMode:()=>De,getSpaceConfig:()=>ke,getVersion:()=>Ke,invokeCommand:()=>Ae,invokeFunction:()=>Ce,invokeSpaceFunction:()=>Fe,listCommands:()=>Se,listSyscalls:()=>Me,reloadConfig:()=>Re,reloadPlugs:()=>Ue});function Ce(e,...t){return r("system.invokeFunction",e,...t)}function Ae(e,t){return r("system.invokeCommand",e,t)}function Se(){return r("system.listCommands")}function Me(){return r("system.listSyscalls")}function Fe(e,...t){return r("system.invokeSpaceFunction",e,...t)}function Te(e,t,o){return r("system.applyAttributeExtractors",e,t,o)}async function ke(e,t){return await r("system.getSpaceConfig",e)??t}function Ue(){return r("system.reloadPlugs")}function Re(){return r("system.reloadConfig")}function Ee(){return r("system.getEnv")}function De(){return r("system.getMode")}function Ke(){return r("system.getVersion")}var a={};p(a,{run:()=>_e});function _e(e,t){return r("shell.run",e,t)}async function y(e){e||(e="Snapshot"),console.log("Snapshotting the current space to git with commit message",e);let{code:t}=await a.run("git",["add","./*"]);console.log("Git add code",t);try{await a.run("git",["commit","-a","-m",e])}catch{}console.log("Done!")}async function h(){let e=await s.prompt("Revision name:");e||(e="Snapshot"),console.log("Revision name",e),await y(e),await s.flashNotification("Done!")}async function v(){await s.flashNotification("Syncing with git"),await b(),await s.flashNotification("Git sync complete!")}async function b(){console.log("Going to sync with git"),await y(),console.log("Then pulling from remote"),await a.run("git",["pull"]),console.log("And then pushing to remote"),await a.run("git",["push"]),console.log("Done!")}async function w(e,t,o){let n=e.join("/")+".git";await s.flashNotification("Now going to clone the project, this may take some time."),await a.run("mkdir",["-p","_checkout"]),await a.run("git",["clone",n,"_checkout"]),await a.run("bash",["-c","mv -f _checkout/{.,}* . 2> /dev/null; true"]),await a.run("rm",["-rf","_checkout"]),await a.run("git",["config","user.name",t]),await a.run("git",["config","user.email",o]),await s.flashNotification("Done. Now just wait for sync to kick in to get all the content.")}async function C(){let e=await s.prompt("Github project URL:");if(!e)return;let t=await s.prompt("Github token:");if(!t)return;let o=await s.prompt("Your name:");if(!o)return;let n=await s.prompt("Your email:");if(!n)return;let i=e.split("/");i[2]=`${t}@${i[2]}`,await w(i,o,n)}async function A(){let e=await s.prompt("Gitlab project URL:");if(!e)return;let t=await s.prompt("Gitlab Username:");if(!t)return;let o=await s.prompt("Gitlab token:");if(!o)return;let n=await s.prompt("Your name:");if(!n)return;let i=await s.prompt("Your email:");if(!i)return;let m=e.split("/");m[2]=`${t}:${o}@${m[2]}`,await w(m,n,i)}async function S(){let e=await l.getSpaceConfig("git",{});e.autoCommitMinutes&&(console.log("Triggered auto commit with config",e),new Date().getMinutes()%e.autoCommitMinutes===0&&(console.log("Auto commit time!"),e.autoSync?await b():await y("Auto commit")))}var M={autoCommit:S,githubCloneCommand:C,gitlabCloneCommand:A,snapshotCommand:h,syncCommand:v},F={name:"git",requiredPermissions:["shell"],functions:{autoCommit:{path:"git.ts:autoCommit",env:"server",cron:"* * * * *"},githubCloneCommand:{path:"./git.ts:githubCloneCommand",command:{name:"Github: Clone"}},gitlabCloneCommand:{path:"./git.ts:gitlabCloneCommand",command:{name:"Gitlab: Clone"}},snapshotCommand:{path:"./git.ts:snapshotCommand",command:{name:"Git: Snapshot"}},syncCommand:{path:"./git.ts:syncCommand",command:{name:"Git: Sync"}}},assets:{}},kt={manifest:F,functionMapping:M};P(M,F,self.postMessage);export{kt as plug}; diff --git a/index.md b/index.md new file mode 100644 index 0000000..f35acd9 --- /dev/null +++ b/index.md @@ -0,0 +1,19 @@ +# Leon’s Notes + +## Next +```template +| Deadline | Task | Ref | +| --- | ----- | ---- | +{{#each {task where deadline order by deadline}}} +|{{deadline}}|{{name}}|[[{{ref}}]]| +{{/each}} +``` + +## Life Routines +```template +{{#each {page where tags = 'life-routine'}}} +* [[{{name}}]] +{{/each}} +``` + +