Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Hygiene on how it looks in Obsidian #54

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.0.11 (Sat July 15 2023)

#### 🐛 General Hygeine Cleanup

- fix: Readme and Field text.

# 2.0.10 (Thu May 25 2023)

#### 🐛 Bug Fix
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Obsidian ibook Plugin
# Obsidian iBooks Plugin

It allows you to export your mac ibook hightlights and annotations into your obsidian vault.

Expand All @@ -8,9 +8,9 @@ It allows you to export your mac ibook hightlights and annotations into your obs

# Attention

- If you want to use highlighted text's color from ibook, use [this template](https://github.com/bingryan/obsidian-ibook-plugin/blob/master/docs/example.md#ibook-selected-colors)
- If you want to use highlighted text's color from iBook, use [this template](https://github.com/bingryan/obsidian-ibook-plugin/blob/master/docs/example.md#ibook-selected-colors)

# Requirements(exists default)
# Requirements (exists default)

The data of mac ibook exists in local sqlite3. and this plugin select database use the local SQLite3

Expand All @@ -20,39 +20,39 @@ brew install sqlite3

# How to Use

### export all
### Export All

`cmd + p` and input `ibook export`
`cmd + p` and input `iBooks Export`

### export single book by search
### Export a Single Book by Searching Your Library

`cmd + shift + b` and search by `book name/author`
`cmd + shift + b` and search by `Book Title or Author`

![](docs/images/screenshot-3.png)

### export book info by search [goodreads](https://www.goodreads.com/)
### Export Book Info by Search [goodreads](https://www.goodreads.com/)

`cmd + shift + i` use file name to search book info, and insert current cursor position

![](docs/images/screenshot-4.png)

# Features

[✓] support export by search book name/author
[✓] Support Export by Search Book Name/Author

[✓] export ibook hightlights and annotations into your obsidian vault.
[✓] Export iBooks hightlights and annotations into your Obsidian vault

[✓] user-defined template
[✓] User-defined Template Option (Default Provided)

[✓] search book info by [goodreads](https://www.goodreads.com/)
[✓] Search book info by [goodreads](https://www.goodreads.com/)

[✗] More...

# For User-Defined Templates

1. templating language: [https://handlebarsjs.com/](https://handlebarsjs.com/)
1. built-in loaded [handlebars-helpers](https://github.com/helpers/handlebars-helpers), [handlebars-group-by](https://github.com/shannonmoeller/handlebars-group-by)
2. available parameters: [docs/parameters.md](docs/parameters.md)
1. Templating Language: [https://handlebarsjs.com/](https://handlebarsjs.com/)
1. Built-in Loaded [handlebars-helpers](https://github.com/helpers/handlebars-helpers), [handlebars-group-by](https://github.com/shannonmoeller/handlebars-group-by)
2. Available Parameters: [docs/parameters.md](docs/parameters.md)

If you don't know how to use these, you can visit [example](docs/example.md), and anyone is welcome to provide templates by PR

Expand All @@ -64,6 +64,6 @@ you can activate this plugin within Obsidian by doing the following:
- Open Settings > Third-party plugin
- Make sure Safe mode is **off**
- Click Browse community plugins
- Search for "Obsidian ibook"
- Search for "Apple iBooks Highlight and Note Importer"
- Click Install
- Once installed, close the community plugins window and activate the newly installed plugin
10 changes: 5 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "ibook",
"name": "ibook",
"version": "2.0.10",
"id": "apple-ibooks-highlighter",
"name": "Apple iBooks Highlight and Note Importer",
"version": "2.0.11",
"minAppVersion": "0.15.0",
"description": "plugin for apple ibook.",
"description": "Plugin to import Highlight and Notes from Apple iBooks.",
"author": "bingryan",
"authorUrl": "https://github.com/bingryan",
"isDesktopOnly": true
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "obsidian-ibook-plugin",
"version": "1.0.4",
"description": "plugin for apple ibook.",
"version": "1.0.5",
"description": "Plugin to import Highlight and Notes from Apple iBooks.",
"main": "main.js",
"scripts": {
"dev": "node esbuild.config.mjs",
Expand All @@ -16,7 +16,8 @@
},
"keywords": [
"obsidian",
"ibook"
"apple",
"iBooks"
],
"author": "bingryan",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tags:
`

export const DEFAULT_SETTINGS: IbookPluginSettings = {
output: 'ibook',
output: 'apple-ibooks-highlighter',
notExportNoAnnotation: true,
backupWhenExist: true,
template: defaultTemplate
Expand Down
8 changes: 4 additions & 4 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ export default class IbookPlugin extends Plugin {
this.export = new IBookExport(this.settings, this);

this.addCommand({
id: "export all",
name: "ibook export all",
id: "Export All Highlights",
name: "Export all highlights from iBooks",
callback: () => {
this.export.all();
},
});

this.addCommand({
id: "export-by-search",
name: "export by search",
name: "Export by Search",
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "b" }],
callback: () => {
tryCreateFolder(this, this.settings.output);
Expand All @@ -44,7 +44,7 @@ export default class IbookPlugin extends Plugin {

this.addCommand({
id: "insert-annotion-by-search",
name: "insert annotion by search",
name: "Insert Annotion by Search",
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "i" }],
editorCallback: (editor) => {
this.handleIbookAnnotationForActiveFile(editor);
Expand Down
16 changes: 8 additions & 8 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ export class IbookSettingTab extends PluginSettingTab {
display(): void {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h1", { text: "Obsidian ibook" });
containerEl.createEl("h1", { text: "Obsidian iBooks Plugin" });
containerEl.createEl("p", { text: "Created by " }).createEl("a", {
text: "bingryan 🤓",
href: "https://github.com/bingryan",
});
containerEl.createEl("h2", { text: "Obsidian ibook Settings" });
containerEl.createEl("h2", { text: "Settings" });


new Setting(containerEl)
.setName("Custom default output path")
.setDesc("default directory for ibook note export")
.setName("Custom Default Highlight Path")
.setDesc("Highlights and Notes will be placed here.")
.addText((text) =>
text
.setPlaceholder("Enter default output path")
Expand All @@ -38,9 +38,9 @@ export class IbookSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Not export no annotation book")
.setName("Omit books with zero annotations")
.setDesc(
"When the book has no annotations, it will not be exported"
"When a book has no annotations, note will not be created"
)
.addToggle((toggle) =>
toggle
Expand All @@ -52,9 +52,9 @@ export class IbookSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("backup old export markdown when exist")
.setName("Backup old highlights if they exist")
.setDesc(
"if a export book with the same name is found, the previous export markdown will be backed up: bookname.md -> bookname.bk.time.md"
"If any previously imported highlights .md exist, they will be backed up as: bookname.md -> bookname.bk.time.md"
)
.addToggle((toggle) =>
toggle
Expand Down
8 changes: 4 additions & 4 deletions src/ui/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export class IBookSearchModal extends IbookFuzzySuggestModal {
this.setInstructions([
{
command: "↵",
purpose: "to export select book note",
purpose: "to export selected book to a note",
},
{ command: "esc", purpose: "to dismiss" },
]);
this.setPlaceholder("Search by book's title or author");
this.setPlaceholder("Search by Book's Title or Author");
}

onChooseItem(item: LibraryAsset, evt: MouseEvent | KeyboardEvent): void {
Expand Down Expand Up @@ -89,7 +89,7 @@ export class GoodReadBookFuzzySuggestModal extends FuzzySuggestModal<GoodReadBoo
},
{ command: "esc", purpose: "to dismiss" },
]);
this.setPlaceholder("Search by book's info by goodreads");
this.setPlaceholder("Search by Book's info via goodreads");
}
onOpen() {
super.onOpen();
Expand All @@ -106,4 +106,4 @@ export class GoodReadBookFuzzySuggestModal extends FuzzySuggestModal<GoodReadBoo
this.editor.replaceSelection(JSON.stringify(item));
}
}
}
}
5 changes: 0 additions & 5 deletions styles.css

This file was deleted.