Skip to content

Commit

Permalink
Merge pull request #4 from chrisgrieser/main
Browse files Browse the repository at this point in the history
Added pages for Tooltips, Notices, Mobile, and Hub Guide...
  • Loading branch information
mgmeyers authored Dec 21, 2021
2 parents 11c886b + 4a895cc commit 4d277d1
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Mac
.DS_Store
4 changes: 3 additions & 1 deletion .obsidian/community-plugins.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
[]
[
"obsidian-theme-design-utilities"
]
113 changes: 113 additions & 0 deletions .obsidian/plugins/obsidian-theme-design-utilities/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __export = (target, all) => {
__markAsModule(target);
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __reExport = (target, module2, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && key !== "default")
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
}
return target;
};
var __toModule = (module2) => {
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
};
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};

// main.ts
__export(exports, {
default: () => themeDesignUtilities
});
var import_obsidian = __toModule(require("obsidian"));
var themeDesignUtilities = class extends import_obsidian.Plugin {
onload() {
return __async(this, null, function* () {
const freezeDelaySecs = 4;
console.log("Theme Design Utilities Plugin loaded.");
this.addCommand({
id: "freeze-obsidian",
name: "Freeze Obsidian (triggered with " + freezeDelaySecs.toString() + "s delay)",
callback: () => {
new import_obsidian.Notice("Will freeze Obsidian in " + freezeDelaySecs.toString() + "s (if the console is open.)", 3e3);
setTimeout(() => {
debugger;
}, freezeDelaySecs * 1e3);
}
});
this.addCommand({
id: "test-notice",
name: "Test Notice",
callback: () => new import_obsidian.Notice("I am a test notice. \u{1F44B} \n\nI will stay here until you click me.", 0)
});
this.addCommand({
id: "toggle-emulate-mobile",
name: "Toggle mobile emulation",
callback: () => this.app.emulateMobile(!this.app.isMobile)
});
this.addCommand({
id: "cheatsheet-css-classes",
name: "Cheatsheet: Obsidian CSS Classes",
callback: () => window.open("https://raw.githubusercontent.com/chrisgrieser/obsidian-theme-design-utilities/master/cheatsheets/css-classes.png")
});
this.addCommand({
id: "toggle-dark-light-mode",
name: "Toggle Dark/Light Mode",
callback: () => {
const isDarkMode = this.app.vault.getConfig("theme") === "obsidian";
if (isDarkMode)
this.useLightMode();
else
this.useDarkMode();
}
});
});
}
onunload() {
return __async(this, null, function* () {
console.log("Theme Design Utilities Plugin unloaded.");
});
}
useDarkMode() {
this.app.setTheme("obsidian");
this.app.vault.setConfig("theme", "obsidian");
this.app.workspace.trigger("css-change");
}
useLightMode() {
this.app.setTheme("moonstone");
this.app.vault.setConfig("theme", "moonstone");
this.app.workspace.trigger("css-change");
}
};
10 changes: 10 additions & 0 deletions .obsidian/plugins/obsidian-theme-design-utilities/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "obsidian-theme-design-utilities",
"name": "Theme Design Utilities",
"version": "0.13.0",
"minAppVersion": "0.12.0",
"description": "Some Utilities and Quality-of-Life Features for Designers of Obsidian Themes.",
"author": "pseudometa",
"authorUrl": "https://github.com/chrisgrieser/theme-design-utilities",
"isDesktopOnly": true
}
35 changes: 21 additions & 14 deletions .obsidian/workspace
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"main": {
"id": "efc0445b96737385",
"id": "f29caaa31a257a8c",
"type": "split",
"children": [
{
"id": "dcc0c61a7c95b93a",
"id": "2ed38844c1a1e30c",
"type": "leaf",
"state": {
"type": "empty",
"state": {}
"type": "markdown",
"state": {
"file": "How To/Guides for Theme Design.md",
"mode": "source"
}
}
}
],
Expand Down Expand Up @@ -73,6 +76,7 @@
"state": {
"type": "backlink",
"state": {
"file": "How To/Guides for Theme Design.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -89,6 +93,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "How To/Guides for Theme Design.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand All @@ -110,7 +115,9 @@
"type": "leaf",
"state": {
"type": "outline",
"state": {}
"state": {
"file": "How To/Guides for Theme Design.md"
}
}
}
],
Expand All @@ -120,17 +127,17 @@
"direction": "horizontal",
"width": 175
},
"active": "dcc0c61a7c95b93a",
"active": "2ed38844c1a1e30c",
"lastOpenFiles": [
"Plugins/Core - Search.md",
"How To/Guides for Theme Design.md",
"How To/Use the developer tools.md",
"Mobile.md",
"Tooltips and Notices.md",
"Page With Metadata.md",
"Markdown Syntax.md",
"Headings.md",
"Embeds.md",
"README.md",
"How To/Show the rename file dialog.md",
"Theme Colors.md",
"Plugins/Kanban 01.md",
"How To/Use the developer tools.md",
"How To/Target fullscreen mode.md"
"Footnotes.md",
"Plugins/Core - Search.md",
"Markdown Syntax.md"
]
}
7 changes: 7 additions & 0 deletions Embeds copy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
![[obsidian.jpeg]]

![[test-unknown-file.fake]]

![[Headings#^038507]]

![[Headings#h1 Heading 2]]
1 change: 1 addition & 0 deletions How To/Guides for Theme Design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check out the [Guides for Theme Designers at the Obsidian Hub](https://publish.obsidian.md/hub/04+-+Guides%2C+Workflows%2C+%26+Courses/for+Theme+Designers).
3 changes: 3 additions & 0 deletions Mobile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Use the command `Theme Design Utilities: Toggle Mobile Emulation` in the command palette.

As the name says, this will emulate the mobile Obsidian app in this vault. Run the command again, to end the emulation.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Obsidian Theme Dev Vault

The purpose of this vault is to aid in theme development by demonstraiting and exercising as many features of Obsidian as possible.
The purpose of this vault is to aid in theme development by demonstrating and exercising as many features of Obsidian as possible.

This vault is currently incomplete. Please help update it by submitting pull requests.


## Guidelines for contributing

- Keep plugins turned off by default
- ....TODO....
- ....TODO....
16 changes: 16 additions & 0 deletions Tooltips and Notices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Tooltips & Notices

## Tooltips
%% Enable Preview Mode to see buttons with the different tooltips. %%

<button aria-label="Lorem Ipsum">Bottom Tooltip</button>

<button aria-label="Lorem Ipsum" aria-label-position="top">Top Tooltip</button>

<button aria-label="Lorem Ipsum" aria-label-position="right">Right Tooltip</button>

<button aria-label="Lorem Ipsum" aria-label-position="left">Left Tooltip</button>

## Notices

Use the command `Theme Design Utilities: Test Notice` in the command palette.

0 comments on commit 4d277d1

Please sign in to comment.