Skip to content

Commit 427ebb2

Browse files
committed
Initial commit
0 parents  commit 427ebb2

24 files changed

+5521
-0
lines changed

.eslintrc.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
root: true,
3+
parser: "@typescript-eslint/parser",
4+
plugins: ["@typescript-eslint"],
5+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
6+
rules: {
7+
"@typescript-eslint/no-unused-vars": [
8+
2,
9+
{ args: "all", argsIgnorePattern: "^_" },
10+
],
11+
},
12+
};

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: [liamcain]
2+
custom: ["https://paypal.me/hiliam", "https://buymeacoffee.com/liamcain"]

.github/ISSUE_TEMPLATE/bug_report.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: bug, needs-review
6+
assignees: ""
7+
---
8+
9+
> **Before Submitting:** Double-check that you are running the latest version of the plugin. The bug might have already been fixed 😄
10+
11+
### Describe the bug
12+
13+
_A clear and concise description of what the bug is._
14+
15+
### Steps to reproduce
16+
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. See error
20+
21+
### Expected behavior
22+
23+
_A clear and concise description of what you expected to happen_.
24+
25+
### Screenshots
26+
27+
_If applicable, add screenshots to help explain your problem._
28+
29+
### Environment (please specify)
30+
31+
#### OS
32+
33+
[Windows/macOS/Linux]
34+
35+
#### Obsidian Version (e.g. v0.10.6)
36+
37+
`(Settings → About → Current Version)`
38+
39+
### Theme (if applicable):
40+
41+
_If the bug is visual, please provide the name of the Community Theme you're using._
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
> **Before Submitting:** Double-check that you are running the latest version of the plugin. The feature might have already been included 😄
10+
11+
**Is your feature request related to a problem? Please describe.**
12+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13+
14+
**Describe the solution you'd like**
15+
A clear and concise description of what you want to happen.
16+
17+
**Describe alternatives you've considered**
18+
A clear and concise description of any alternative solutions or features you've considered.
19+
20+
**Additional context**
21+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [$default-branch]
6+
pull_request:
7+
branches: [$default-branch]
8+
9+
jobs:
10+
lint-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Install modules
16+
run: yarn
17+
18+
- name: Lint
19+
run: yarn run lint
20+
21+
- name: Run tests
22+
run: yarn run test

.github/workflows/publish.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build plugin
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10
8+
9+
env:
10+
PLUGIN_NAME: calendar
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: "14.x" # You might need to adjust this value to your own version
22+
- name: Build
23+
id: build
24+
run: |
25+
npm install -g yarn
26+
yarn
27+
yarn run build --if-present
28+
mkdir ${{ env.PLUGIN_NAME }}
29+
cp main.js manifest.json ${{ env.PLUGIN_NAME }}
30+
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
31+
ls
32+
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
33+
- name: Create Release
34+
id: create_release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
VERSION: ${{ github.ref }}
39+
with:
40+
tag_name: ${{ github.ref }}
41+
release_name: ${{ github.ref }}
42+
draft: false
43+
prerelease: false
44+
- name: Upload zip file
45+
id: upload-zip
46+
uses: actions/upload-release-asset@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
upload_url: ${{ steps.create_release.outputs.upload_url }}
51+
asset_path: ./${{ env.PLUGIN_NAME }}.zip
52+
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
53+
asset_content_type: application/zip
54+
- name: Upload main.js
55+
id: upload-main
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
asset_path: ./main.js
62+
asset_name: main.js
63+
asset_content_type: text/javascript
64+
- name: Upload manifest.json
65+
id: upload-manifest
66+
uses: actions/upload-release-asset@v1
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
upload_url: ${{ steps.create_release.outputs.upload_url }}
71+
asset_path: ./manifest.json
72+
asset_name: manifest.json
73+
asset_content_type: application/json

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
dist/
3+
data.json
4+
main.js
5+
.vscode/
6+
*.code-workspace

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"svelteSortOrder": "scripts-markup-styles",
3+
"svelteBracketNewLine": true,
4+
"svelteAllowShorthand": true,
5+
"svelteIndentScriptAndStyle": true
6+
}

README.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Weekly Notes
2+
3+
The Weekly Notes plugin mirrors the functionality of the Daily Notes plugin with one noteable difference: it's weekly!
4+
5+
## Features
6+
7+
### Commands
8+
9+
#### Open Weekly Note
10+
11+
Opens the weekly note for the current week. If one doesn't exist, it will create one automatically for you.
12+
13+
#### Next Weekly Note
14+
15+
Navigates to the next weekly note chronologically. Skips over weeks with no weekly note file.
16+
17+
> **Note:** This command is only available if the active focused note is a weekly note.
18+
19+
#### Previous Weekly Note
20+
21+
Navigates to the previous weekly note chronologically. Skips over weeks with no weekly note file.
22+
23+
> **Note:** This command is only available if the active focused note is a weekly note.
24+
25+
### Calendar Plugin Integration
26+
27+
If you have "Week numbers" enabled from the Calendar plugin, the calendar will automatically use your weekly note settings to create a seamless experience.
28+
29+
#### Weekly Notes are moving
30+
31+
If you currently use the Calendar plugin, you might be thinking "doesn't the Calendar plugin already do this?" To which the answer is: **yes**. This plugin provides the same functionality as the Calendar plugin's weekly notes. However, [weekly notes are moving](https://github.com/liamcain/obsidian-calendar-plugin#weekly-notes-have-a-new-home).
32+
33+
#### Migrating
34+
35+
If you currently use weekly notes with the Calendar plugin, your settings will automatically be migrated over and the calendar plugin still function the same way it did before.
36+
37+
You can create a Daily Note either by clicking on the calendar icon in the left panel, or with the Command palette. You can also set a hotkey in Keyboard shortcuts.
38+
39+
## Settings
40+
41+
| Setting | Description |
42+
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
43+
| Folder | The folder that your weekly notes go into. It can be the same or different from your daily notes. By default they are placed in your vault root. |
44+
| Template | Configure a template for weekly notes. Weekly notes have slightly different template tags than daily notes. See here for the list of supported [weekly note template tags](#template-tags). |
45+
| Format | The date format for the weekly note filename. Defaults to `gggg-[W]ww`. If you use `DD` in the week format, this will refer to first day of the week (Sunday or Monday, depending on your settings). |
46+
47+
### Template Tags
48+
49+
| Tag | Description |
50+
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
51+
| `title` | Works the same as the daily note `{{title}}`. It will insert the title of the note |
52+
| `date`, `time` | Works the same as the daily note `{{date}}` and `{{time}}`. It will insert the date and time of the first day of the week. Useful for creating a heading (e.g. `# {{date:gggg [Week] ww}}`). |
53+
| `sunday`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday` | Because weekly tags refer to main days, you can refer to individual days like this `{{sunday:gggg-MM-DD}}` to automatically insert the date for that particular day. Note, you must specify the date format! |
54+
55+
---
56+
57+
## Say Thanks 🙏
58+
59+
If you like this plugin and would like to buy me a coffee, you can!
60+
61+
[<img src="https://cdn.buymeacoffee.com/buttons/v2/default-violet.png" alt="BuyMeACoffee" width="100">](https://www.buymeacoffee.com/liamcain)
62+
63+
Like my work and want to see more like it? You can sponsor me.
64+
65+
[![GitHub Sponsors](https://img.shields.io/github/sponsors/liamcain?style=social)](https://github.com/sponsors/liamcain)

manifest.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": "periodic-notes",
3+
"name": "Periodic Notes",
4+
"description": "",
5+
"version": "0.0.1",
6+
"author": "Liam Cain",
7+
"authorUrl": "https://github.com/liamcain/",
8+
"isDesktopOnly": false,
9+
"minAppVersion": "0.9.11"
10+
}

package.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "obsidian-monthly-notes",
3+
"version": "0.0.1",
4+
"description": "Create and manage monthly notes notes within Obsidian",
5+
"author": "liamcain",
6+
"main": "main.js",
7+
"license": "MIT",
8+
"scripts": {
9+
"lint": "eslint . --ext .ts",
10+
"build": "npm run lint && rollup -c",
11+
"test": "jest",
12+
"test:watch": "yarn test -- --watch"
13+
},
14+
"dependencies": {
15+
"@popperjs/core": "2.6.0",
16+
"obsidian": "obsidianmd/obsidian-api#master",
17+
"obsidian-daily-notes-interface": "../obsidian-daily-notes-interface",
18+
"tslib": "2.0.3"
19+
},
20+
"devDependencies": {
21+
"@rollup/plugin-commonjs": "17.0.0",
22+
"@rollup/plugin-node-resolve": "11.0.0",
23+
"@rollup/plugin-typescript": "8.1.0",
24+
"@testing-library/jest-dom": "5.11.9",
25+
"@types/jest": "26.0.20",
26+
"@types/moment": "2.13.0",
27+
"@types/node": "14.14.21",
28+
"@typescript-eslint/eslint-plugin": "4.13.0",
29+
"@typescript-eslint/parser": "4.13.0",
30+
"eslint": "7.18.0",
31+
"jest": "26.6.3",
32+
"moment": "2.29.1",
33+
"rollup": "2.34.2",
34+
"ts-jest": "26.4.4",
35+
"typescript": "4.1.3"
36+
},
37+
"jest": {
38+
"moduleNameMapper": {
39+
"src/(.*)": "<rootDir>/src/$1"
40+
},
41+
"transform": {
42+
"^.+\\.ts$": "ts-jest"
43+
},
44+
"moduleFileExtensions": [
45+
"js",
46+
"ts"
47+
]
48+
}
49+
}

rollup.config.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import commonjs from "@rollup/plugin-commonjs";
2+
import resolve from "@rollup/plugin-node-resolve";
3+
import typescript from "@rollup/plugin-typescript";
4+
import { env } from "process";
5+
6+
export default {
7+
input: "src/index.ts",
8+
output: {
9+
format: "cjs",
10+
file: "main.js",
11+
exports: "default",
12+
},
13+
external: ["obsidian", "fs", "os", "path"],
14+
plugins: [
15+
typescript({ sourceMap: env.env === "DEV" }),
16+
resolve({
17+
browser: true,
18+
}),
19+
commonjs(),
20+
],
21+
};

0 commit comments

Comments
 (0)