Skip to content

Commit e8833aa

Browse files
committed
chore: comply with obsidian guideline
1 parent b88fff0 commit e8833aa

11 files changed

Lines changed: 78 additions & 54 deletions

README.md

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,107 @@
11
# Flakepiles for Obsidian
22

3-
An Obsidian plugin to put small stickies / cards in a single file, and manage them in masonry layout.
3+
An Obsidian plugin to put small notes / stickies / cards in a dedicated file, and manage them in masonry layout.
44

5-
The underlying file format (`.flakes`) is JSON. The plugin is in early development, though basic features should now work properly.
5+
A "flake" means a small piece of note, and a "flakepile" is a pile of those flakes.
6+
7+
Can be used to store ideas, diaries, code snippets, and more.
8+
9+
*The preview image is in horizontal layout. You can change this to vertical layout.*
610

711
![preview](docs/preview.jpg)
812

9-
## Installation
13+
## Why
1014

11-
The plugin is not published as Obsidian's community plugin yet. Please use [BRAT](https://github.com/TfTHacker/obsidian42-brat) to install the plugin. I might (or might not) submit the plugin later.
15+
I don't want 100 `.md` files with 1 sentence each.
1216

1317
## Status
1418

15-
Basic features. I've tested many edge cases I can think of, and [I myself am using it currently](https://en.wikipedia.org/wiki/Eating_your_own_dog_food), but please expect bugs exist.
19+
The plugin is in early development, though basic features should now work properly. I've tested many cases I can think of, and [I myself am using it currently](https://en.wikipedia.org/wiki/Eating_your_own_dog_food), but please expect bug exists in corner cases.
1620

17-
## Why
21+
## Installation
1822

19-
I don't want 100 `.md` files with 1 sentence each.
23+
The plugin is not published as Obsidian's community plugin yet. Please use [BRAT](https://github.com/TfTHacker/obsidian42-brat) to install the plugin, or copy the files under the release tag to the plugin folder of your Obsidian application. You can also [build it from source](#build-from-source).
2024

2125
## Tech Stack
2226

2327
Vite + Vue 3 + TypeScript + Sass
2428

25-
Using Vite as I'm using Vue, using Vue as I'm mostly familiar with it.
29+
The underlying file format (`.flakes`) is JSON. See the [non-goals](#non-goals) section for explanation.
30+
31+
## Roadmap
2632

27-
## Goals
33+
Inside a flakepile:
2834

2935
- [x] Mount Vue into Obsidian
3036
- [x] Flakepile
3137
- [x] Masonry layout
3238
- [x] Masonry direction (vertical / horizontal)
33-
- [x] (Sort of) Mobile-adaptive layout
39+
- [x] (Sort of) mobile-adaptive layout
3440
- [x] Flake size
3541
- [x] Flake elastic sizing
3642
- [x] Flake sorting (name, time created, time modified)
3743
- [x] Flake
3844
- [x] Flake creation, update, deletion
3945
- [x] Flake markdown rendering
40-
- [x] Text Flake
41-
- [x] Code Flake
42-
- [x] Image Flake
43-
- [x] Search filter inside a Flakepile
46+
- [x] Text flake
47+
- [x] Image flake
48+
- [x] Code flake
49+
- [x] Search filter inside a flakepile
4450
- [ ] Flake colors (theme)
4551
- [ ] Flake labels
4652
- [ ] Label creation, update, deletion
47-
- [ ] Add / remove label to Flake
53+
- [ ] Add / remove label to flake
4854
- [ ] Label color
49-
- [ ] Hide specific label (display as `+N`)
55+
- [ ] Hide some labels (display as `+N`)
5056
- [ ] Label filtering
57+
58+
Obsidian-wise:
59+
60+
- [x] "Create new flakepile" file menu option
61+
- [x] "Flake count" status bar item [1]
5162
- Limited support to internal plugins
5263
- [x] Preview other markdown file
53-
- [x] Jump to global search when clicking on a tag.
64+
- [x] Jump to global search when clicking on a tag
65+
66+
[1] Due to the nature of this plugin, other status bar items are hided in flakepile view. Please let me know if you think some status bar item should be displayed.
5467

5568
## Long term goals
5669

5770
- Search keywords highlight
58-
- Copy Flake across Flakepile (the Copy Raw botton is for this)
71+
- Copy flake across flakepiles (the "copy raw" botton is for this)
72+
- Export files to markdown files
73+
- Export as a single markdown file
74+
- Export as a `.zip` archive, each flake as a markdown file
75+
- Import the `.zip` archive to a flakepile
5976
- Import multiple markdown files to Flakes
60-
- Import `.zip` archive to a Flakepile
61-
- Import as a new Flakepile
62-
- Import into an existing Flakepile
63-
- Export files to a `.zip` archive, each Flake as a markdown file
64-
- Transition animation (investigated a bit, mostly jank, needs help)
6577

6678
## Non-goals
6779

68-
- Very large Flakepile support (not the very intended way)
69-
- Live editing of Flake (too complex)
80+
- Freedom / manual layout (consider using Canvas)
81+
- Very large flakepile support (not the very intended way)
82+
- Live editing of a flake (too complex)
7083
- Cross-file searching / Obsidian-wise searching (restricted by API)
71-
- Global search indexing support (restricted by API)
72-
- Unit testing (do not have time)
84+
- Global search indexing (restricted by API)
85+
- Unit testing (do not have enough time)
86+
87+
I recognize that this plugin is not so an Obsidian-style plugin, as it does not leverage markdown file like many other plugins do. On the other hand, this has the benefit of not having to juggle with black magics that makes a markdown file look like other layout (when the layout itself is quite complicated).
88+
89+
Also, this plugin is primarily to fulfill my specific need. For this reason, I would prioritize maintainability over adding unplanned features. I'm open to suggestions, though feature requests might be considered only when it's aligned to my own use case. 🙏
7390

7491
## Build from source
7592

7693
If you want to take a look inside the development of the plugin, or just want to ensure maximum safety, you can clone this repository and build from source:
7794

7895
```
7996
npm i
80-
npm run dev // watch mode, works with hot reload [1]
81-
npm run build:dev // one-time dev build without minification
82-
npm run build // build for production
97+
npm run dev // Watch mode, works with hot reload [1]
98+
npm run build:dev // One-time dev build without minification
99+
npm run build // Build for production
83100
```
84101

85102
[1] [Hot reload](https://github.com/pjeby/hot-reload)
86103

87-
With `npm run build`, the output files will be copied to `dist` folder.
104+
WHen running `npm run build`, the output files will be copied to `dist` folder.
88105

89106
## License
90107

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default defineConfig(
7777
},
7878
},
7979
rules: {
80-
'obsidianmd/ui/sentence-case': 'off',
80+
'obsidianmd/ui/sentence-case': 'warn',
8181
},
8282
},
8383
{

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"id": "flakepiles",
33
"name": "Flakepiles",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"minAppVersion": "0.15.0",
6-
"description": "Put small stickies / cards in a single file. Manage them in masonry layout.",
6+
"description": "Put small stickies / cards in a dedicated file. Manage them in masonry layout.",
77
"author": "i'DLisT",
88
"authorUrl": "https://idl.ist",
99
"isDesktopOnly": false

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "flakepiles",
3-
"version": "0.1.2",
4-
"description": "Put small stickies / cards in a single file. Manage them in masonry layout.",
3+
"version": "0.1.3",
4+
"description": "Put small stickies / cards in a dedicated file. Manage them in masonry layout.",
55
"main": "main.js",
66
"type": "module",
77
"scripts": {

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export class FlakepileApp extends TextFileView {
205205
this.parsed.value = true
206206
} catch (e) {
207207
this.parsed.value = false
208-
new Notice('Cannot parse Flakepile file. Check dev console for more info.', 0)
208+
new Notice('Cannot parse the flakepile. Check dev console for more info.', 0)
209209
console.error('Cannot parse Flakepile file: ', e)
210210
return
211211
}

src/data.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface FlakeLabel {
4444
id: string
4545
name: string
4646
color: FlakeLabelColor
47+
show: boolean
4748
filter: boolean
4849
}
4950

@@ -52,6 +53,7 @@ export const createLabel = (): FlakeLabel => {
5253
id: nanoid(8),
5354
name: '',
5455
color: 'none',
56+
show: true,
5557
filter: false,
5658
}
5759
}

src/globals.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
}
118118

119119
>.plugin-flakepiles,
120-
>.plugin-remotely-sync {
120+
>.plugin-remotely-save {
121121
display: block;
122122
}
123123
}

src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class Flakepiles extends Plugin {
2222

2323
menu.addItem((item) => {
2424
item
25-
.setTitle('Create new Flakepile')
25+
.setTitle('Create new flakepile')
2626
.setIcon('sticker')
2727
.onClick(async () => {
2828
await this.createFlakepileFile(file)
@@ -79,8 +79,8 @@ export default class Flakepiles extends Plugin {
7979

8080
await this.app.workspace.getLeaf().openFile(newFile)
8181
} catch (e) {
82-
new Notice('Failed to create Flakepile. Check dev console for more info.', 0)
83-
console.error('Failed to create Flakepile: ', e)
82+
new Notice('Failed to create flakepile. Check dev console for more info.', 0)
83+
console.error('Failed to create flakepile: ', e)
8484
}
8585
}
8686

@@ -101,6 +101,6 @@ export default class Flakepiles extends Plugin {
101101
const flakepile = this.app.workspace.getActiveViewOfType(FlakepileApp)
102102
if (!flakepile) return
103103

104-
this.flakeCount?.setText(`${flakepile.pile.value.flakes.length} Flake(s)`)
104+
this.flakeCount?.setText(`${flakepile.pile.value.flakes.length} flake(s)`)
105105
}
106106
}

src/vue/FlakeView.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ const copyContent = async () => {
209209
await navigator.clipboard.writeText(props.flake.content)
210210
new Notice('Content copied.', 1000)
211211
} catch (e) {
212-
console.warn(`Failed to copy the content of Flake ${props.flake.id}: `, e)
212+
console.warn(`Failed to copy the content of flake ${props.flake.id}: `, e)
213213
new Notice('Failed to copy content. Check dev console for detail.', 0)
214214
}
215215
}
@@ -219,7 +219,7 @@ const copyJson = async () => {
219219
await navigator.clipboard.writeText(JSON.stringify(props.flake, null, 2))
220220
new Notice('Raw JSON copied.', 1000)
221221
} catch (e) {
222-
console.warn(`Failed to copy the raw JSON of Flake ${props.flake.id}: `, e)
222+
console.warn(`Failed to copy the raw JSON of flake ${props.flake.id}: `, e)
223223
new Notice('Failed to copy raw JSON. Check dev console for detail.', 0)
224224
}
225225
}
@@ -300,7 +300,7 @@ const cssTypeIsImage = useCssIf(isImage, 'selected')
300300
<div ref="el-content"
301301
:class="['flake-content', cssViewImage]">
302302
<div v-if="isView && isEmpty" class="none">
303-
No Content
303+
No content
304304
</div>
305305

306306
<div v-if="isView"
@@ -384,7 +384,7 @@ const cssTypeIsImage = useCssIf(isImage, 'selected')
384384
<div class="expand"></div>
385385

386386
<label class="withlabel -atleft">
387-
<span>Image Only</span>
387+
<span>Image only</span>
388388
<input v-model="flake.imageOnly" type="checkbox" />
389389
</label>
390390
</div>

src/vue/FlakepileView.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const cssNoLabel = useCssIf(isViewportSmall, '-nolabel')
186186
<MenuButton
187187
:class="['fp-btn-icon-label', cssNoLabel]"
188188
icon="plus"
189-
label="Add Flake"
189+
label="Add flake"
190190
@click="addFlake" />
191191

192192
<ObSearch v-model="searchQuery" class="wfull" />
@@ -208,11 +208,11 @@ const cssNoLabel = useCssIf(isViewportSmall, '-nolabel')
208208

209209
<div class="expand"></div>
210210

211-
<label>Sort By</label>
211+
<label>Sort by</label>
212212
<select v-model="pile.sortBy" class="dropdown">
213213
<option value="name">Name</option>
214-
<option value="createdAt">Time Created</option>
215-
<option value="modifiedAt">Time Modified</option>
214+
<option value="createdAt">Time created</option>
215+
<option value="modifiedAt">Time modified</option>
216216
</select>
217217
<button
218218
v-if="pile.sortOrder == 'desc'"
@@ -274,7 +274,7 @@ const cssNoLabel = useCssIf(isViewportSmall, '-nolabel')
274274

275275
<div class="content">
276276
<div ref="el-canvas" :class="['sub-layout', cssAdaptiveFlow]">
277-
<div v-if="!pile.flakes.length" class="no-flakes">No Flakes</div>
277+
<div v-if="!pile.flakes.length" class="no-flakes">No flakes.</div>
278278

279279
<MasonryUnified v-else
280280
:id="pile.id"

0 commit comments

Comments
 (0)