Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurankv committed Feb 14, 2024
1 parent b580519 commit 7c5e83f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .todo
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Features:
Code Referencing:
Codeblock syntax highlighting
reference codeblock syntax highlighting
☐ Local reference
☐ Prevent clicking reading mode external links causing fold (@low)
☐ File watcher? (@low)
☐ External Referencing
☐ base64 encode and bundle font (check license) (@low)
☐ Update button (@medium)
☐ Update inplace
☐ Automatic updating (set frequency in setttings an dupdate if older than that at every plugin load, manual command for updating all, manual update button)
☐ Remove old files? (check if any blocks exist requiring it, if not delete it - how to do this?)
☐ Add colours to settings (@medium)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.17.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"title":".nvmrc","rawUrl":"https://gitlab.com/gitlab-org/gitlab/-/raw/master/.nvmrc","datetime":"2024-02-14 03:40","displayUrl":"https://gitlab.com/gitlab-org/gitlab/-/blob/master/.nvmrc","author":"gitlab-org","repository":"gitlab","path":".nvmrc","fileName":".nvmrc","refInfo":{"ref":"","type":"","hash":"38f241024e79d3e5e7ce3d74c83186aa007f3ae3"}}
3 changes: 0 additions & 3 deletions src/Referencing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ async function accessExternalReference(reference: Reference, plugin: CodeStylerP
async function updateExternalReference(reference: Reference, plugin: CodeStylerPlugin) {
try {
const sourceInfo = await parseExternalReference(reference);
console.log(sourceInfo.rawUrl ?? reference.path);
const content = await request(sourceInfo.rawUrl ?? reference.path);
await plugin.app.vault.adapter.write(reference?.external?.storePath as string, content);
await plugin.app.vault.adapter.write(reference?.external?.storePath as string + EXTERNAL_REFERENCE_INFO_SUFFIX, JSON.stringify(sourceInfo));
Expand All @@ -82,8 +81,6 @@ async function updateExternalReference(reference: Reference, plugin: CodeStylerP

function idExternalReference(fileLink: string): {id: string, website: string} {
const linkInfo = /^https?:\/\/(.+)\.com\/(.+)$/.exec(fileLink);
console.log(fileLink);
console.log(linkInfo);
if (!linkInfo?.[1] || !linkInfo?.[2])
throw Error("No such repository could be found");
return {id: [linkInfo[1], ...linkInfo[2].split("/")].join("-"), website: linkInfo[1]};
Expand Down

0 comments on commit 7c5e83f

Please sign in to comment.