Skip to content

Commit e75ada6

Browse files
Initial Commit
1 parent 7debf02 commit e75ada6

21 files changed

+3103
-123
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = tab
9+
indent_size = 4
10+
tab_width = 4

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
3+
main.js

.eslintrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"env": { "node": true },
5+
"plugins": [
6+
"@typescript-eslint"
7+
],
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:@typescript-eslint/recommended"
12+
],
13+
"parserOptions": {
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"no-unused-vars": "off",
18+
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
19+
"@typescript-eslint/ban-ts-comment": "off",
20+
"no-prototype-builtins": "off",
21+
"@typescript-eslint/no-empty-function": "off"
22+
}
23+
}

.github/workflows/pull-request.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build Pull Request
2+
3+
on: pull_request
4+
5+
env:
6+
PLUGIN_NAME: obsidian-canvas-dailynote
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: "20.x"
16+
- name: Build
17+
id: build
18+
run: |
19+
npm ci
20+
npm run build
21+
zip -r ${{ env.PLUGIN_NAME }}.zip dist
22+
ls
23+
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Obsidian Plugin
2+
3+
on: workflow_dispatch
4+
5+
env:
6+
PLUGIN_NAME: obsidian-canvas-dailynote
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: "20.x"
16+
- name: Get Package Version
17+
id: get_package_version
18+
run: echo "PACKAGE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
19+
- name: Build
20+
id: build
21+
run: |
22+
echo Building for version PACKAGE_VERSION
23+
npm ci
24+
npm run build
25+
zip -jr ${{ env.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}.zip dist/*
26+
ls
27+
- name: Release
28+
uses: softprops/action-gh-release@v1
29+
with:
30+
tag_name: ${{ env.PACKAGE_VERSION }}
31+
files: |
32+
${{ env.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}.zip
33+
dist/main.js
34+
dist/manifest.json
35+
dist/styles.css

.gitignore

Lines changed: 18 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,25 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
.pnpm-debug.log*
1+
# vscode
2+
.vscode
93

10-
# Diagnostic reports (https://nodejs.org/api/report.html)
11-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
4+
# Intellij
5+
*.iml
6+
.idea
127

13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
*.pid.lock
8+
# npm
9+
node_modules
1810

19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
11+
# Don't include the compiled main.js file in the repo.
12+
# They should be uploaded to GitHub releases instead.
13+
main.js
2114

22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
*.lcov
15+
# Exclude sourcemaps
16+
*.map
2517

26-
# nyc test coverage
27-
.nyc_output
18+
# obsidian
19+
data.json
2820

29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
21+
# Exclude macOS Finder (System Explorer) View States
22+
.DS_Store
3123

32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
38-
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
40-
41-
# Dependency directories
42-
node_modules/
43-
jspm_packages/
44-
45-
# Snowpack dependency directory (https://snowpack.dev/)
46-
web_modules/
47-
48-
# TypeScript cache
49-
*.tsbuildinfo
50-
51-
# Optional npm cache directory
52-
.npm
53-
54-
# Optional eslint cache
55-
.eslintcache
56-
57-
# Optional stylelint cache
58-
.stylelintcache
59-
60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
66-
# Optional REPL history
67-
.node_repl_history
68-
69-
# Output of 'npm pack'
70-
*.tgz
71-
72-
# Yarn Integrity file
73-
.yarn-integrity
74-
75-
# dotenv environment variable files
76-
.env
77-
.env.development.local
78-
.env.test.local
79-
.env.production.local
80-
.env.local
81-
82-
# parcel-bundler cache (https://parceljs.org/)
83-
.cache
84-
.parcel-cache
85-
86-
# Next.js build output
87-
.next
88-
out
89-
90-
# Nuxt.js build / generate output
91-
.nuxt
92-
dist
93-
94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
100-
# vuepress build output
101-
.vuepress/dist
102-
103-
# vuepress v2.x temp and cache directory
104-
.temp
105-
.cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# TernJS port file
120-
.tern-port
121-
122-
# Stores VSCode versions used for testing VSCode extensions
123-
.vscode-test
124-
125-
# yarn v2
126-
.yarn/cache
127-
.yarn/unplugged
128-
.yarn/build-state.yml
129-
.yarn/install-state.gz
130-
.pnp.*
24+
# Remove local builds
25+
dist/

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tag-version-prefix=""

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Obsidian Ribbon Divider
2+
3+
A plugin for Obsidian.MD that allows you to add a daily note node to the canvas that will always show todays note.
4+
5+
![A screenshot of a daily note on the canvas and the "add daily note" button in the bottom controls](canvas.png)
6+
7+
## How to Install
8+
9+
Plugin will be added to official repository shortly.
10+
11+
## How to Use
12+
13+
On a canvas view, a new button will be added. When you click this button, it will add a new file node for your daily note. The plugin will automatically keep this file node up to date with the latest daily note whenever you open the canvas.
14+
15+
![A screenshot showing the "add daily note" button](add_button.png)
16+
17+
> [!NOTE]
18+
> This plugin works by adding a special metadata (`unknownData`) to the file node. It will only work on these nodes crated via the plugin and will not work on existing file nodes.
19+
20+
> [!WARNING]
21+
> The updating of the daily note to today's note involved removing the existing canvas node and replacing it with a new one. As a result, the plugin currently doesn't support connections from the daily note node to other nodes.
22+
23+
## Settings
24+
25+
When inserting a new node, or updating en existing node to today's daily note, the plugin by default will create the daily note if it does not already exist.
26+
27+
If you would like the plugin to not do this, or not do it on specific days of the week, you can update this in settings.
28+
29+
![A screenshot of the settings screen](settings.png)
30+
31+
## Customization
32+
33+
To customize the appearance of a daily note node, you can utilize CSS to target the element.
34+
35+
```css
36+
/* Change look of Button */
37+
.canvas-button-adddailynote {
38+
}
39+
/* Change look of daily note node */
40+
.canvas-node-dailynote {
41+
}
42+
/* Change look of daily note node label */
43+
.canvas-node-dailynote .canvas-node-label {
44+
}
45+
/* Change look of daily note node label pre-text */
46+
.canvas-node-dailynote .canvas-node-label:before {
47+
}
48+
```
49+
50+
## Reporting Issues
51+
52+
If you run into any issues with this plugin, please [open an issue](https://github.com/andrewmcgivery/obsidian-ribbon-divider/issues/new) and incude as much detail as possible, including screenshots.

add_button.png

3.1 KB
Loading

canvas.png

15.9 KB
Loading

0 commit comments

Comments
 (0)