Skip to content

Instantly share code, notes, and snippets.

@andrewmcodes
Created May 5, 2022 17:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewmcodes/6267a3fdf50ac0869f7d52894ac8a7b2 to your computer and use it in GitHub Desktop.
Save andrewmcodes/6267a3fdf50ac0869f7d52894ac8a7b2 to your computer and use it in GitHub Desktop.
Add dashboard in Obsidian with App note example

Requires Dataview and MetaEdit

Inbox

const { update } = this.app.plugins.plugins["metaedit"].api;
const { createButton } = app.plugins.plugins["buttons"];

dv.table(
  [
    "Image",
    "Note",
    "Link",
    "",
  ],
  dv
    .pages('"lib/apps"')
    .where((p) => p.status == "inbox")
    .map((p) => [
      "![image|64](" + p.image_url + ")",
      p.file.link,
      "**[" + "🔗 " + "App Store" + "](" + p.app_store_url + ")**",
      createButton({
        app,
        el: this.container,
        args: { name: "Move to Using" },
        clickOverride: {
          click: update,
          params: ["status", "using", p.file.path],
        },
      }),
    ])
);

Using

const { update } = this.app.plugins.plugins["metaedit"].api;
const { createButton } = app.plugins.plugins["buttons"];

dv.table(
  [
    "Image",
    "Note",
    "Link",
    "",
  ],
  dv
    .pages('"lib/apps"')
    .where((p) => p.status == "using")
    .map((p) => [
      "![image|64](" + p.image_url + ")",
      p.file.link,
      "**[" + "🔗 " + "App Store" + "](" + p.app_store_url + ")**",
      createButton({
        app,
        el: this.container,
        args: { name: "Archive" },
        clickOverride: {
          click: update,
          params: ["status", "archive", p.file.path],
        },
      }),
    ])
);

Archive

const { update } = this.app.plugins.plugins["metaedit"].api;
const { createButton } = app.plugins.plugins["buttons"];

dv.table(
  [
    "Image",
    "Note",
    "Link",
    "",
  ],
  dv
    .pages('"lib/apps"')
    .where((p) => p.status == "archive")
    .map((p) => [
      "![image|64](" + p.image_url + ")",
      p.file.link,
      "**[" + "🔗 " + "App Store" + "](" + p.app_store_url + ")**",
      createButton({
        app,
        el: this.container,
        args: { name: "Move to Using" },
        clickOverride: {
          click: update,
          params: ["status", "using", p.file.path],
        },
      }),
    ])
);
publish status name universal price apple_store_id apple_store_url image_url
false
using
true
Free
1557175442
1557175442

Obsidian|256x256

[!METADATA]+ Type:: [[App]] Category:: [[Productivity]] Authors:: [[Dynalist Inc.]] Source:: [[App Store]] Links:: App Store, Apple Media Description:: Obsidian is a powerful knowledge base that works on top of a local folder of plain text Markdown files.

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment