Skip to content

Commit

Permalink
(fix) address PR feedback
Browse files Browse the repository at this point in the history
obsidianmd/obsidian-releases#3124

- removed fundingUrl
- removed yaml dependency in favor of obsidian's parseYaml function
- removed (unneeded) ribbon icon/action
- removed logging
  • Loading branch information
Ashton Eby committed Feb 28, 2024
1 parent 5d5feea commit 2022b05
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 34 deletions.
17 changes: 1 addition & 16 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@ export default class EgoRock extends Plugin {
settings: Settings;

async onload() {
this.addRibbonIcon('dice', 'Task lookup', () => {
exec('wsl task list limit:1', (error, stdout, stderr) => {
console.log(stdout)
if (error) new Notice(error.message)
else if (stderr && !stdout) new Notice(stderr)
else new Notice(stdout/*.split('\n').join('\t')*/)
})
})
await this.loadSettings();

this.registerMarkdownCodeBlockProcessor('task-table', (source, element, context) => {
console.debug('input:', JSON.stringify(parse(source)))
this.doCommandReturnString(parse(source).command, element)
this.doCommandReturnString(parseYaml(source).command, element, this.settings.taskBinaryPath)

Check failure on line 20 in main.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'parseYaml'.
})
}

Expand Down Expand Up @@ -78,10 +69,6 @@ export default class EgoRock extends Plugin {
}
}

for(let i = 0; i < indices.length; i++) {
console.log(indices[i].columnName, header.slice(indices[i].startIndex, indices[i].endIndex))
}

for(let rowIndex = 1; rowIndex < table.length; rowIndex++) {
let rowObj: Record<string, any> = {}
for (let columnIndex = 0; columnIndex < indices.length; columnIndex++) {
Expand Down Expand Up @@ -110,7 +97,6 @@ export default class EgoRock extends Plugin {
if (line.match(/^\d+ tasks, \d+ shown*$/)) return false
return true
})
console.log(newCommand)
return this.buildTable(this.buildTableDescription(asciiTable), el)
} else {
throw new Error(`Taskwarrior command must be a report, was: ${report}.`)
Expand All @@ -122,7 +108,6 @@ export default class EgoRock extends Plugin {
const report = commandString.split(' ')[0]
if (reports.includes(report)) {
const newCommand = `${taskwarriorBin.trim()} ${this.buildCommandForReport(report)}`
console.log(newCommand)
return JSON.parse(execSync(newCommand).toString())
} else if (report === 'export') {
return JSON.parse(execSync(`${taskwarriorBin.trim()} ${commandString}`).toString())
Expand Down
5 changes: 2 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"id": "ego-rock",
"name": "Ego Rock",
"version": "1.0.2",
"version": "1.0.3",
"minAppVersion": "0.15.0",
"description": "A basic taskwarrior UI for listing and modifying tasks.",
"author": "Ashton Eby",
"authorUrl": "https://blog.echobravoyahoo.net",
"fundingUrl": "https://blog.echobravoyahoo.net",
"isDesktopOnly": true
}
}
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ego-rock",
"version": "1.0.2",
"version": "1.0.3",
"description": "A plugin for Obsidian that allows viewing taskwarrior tasks.",
"main": "main.js",
"scripts": {
Expand All @@ -20,8 +20,5 @@
"obsidian": "latest",
"tslib": "2.4.0",
"typescript": "4.7.4"
},
"dependencies": {
"yaml": "^2.3.4"
}
}

0 comments on commit 2022b05

Please sign in to comment.