Skip to content

Obsidian plugin that automatically creates notes by searching for books

License

Notifications You must be signed in to change notification settings

prestsauce/obsidian-book-search-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obsidian Book Search Plugin

GitHub Workflow Status GitHub release (latest SemVer) Korean

Easily create book notes.


Changelog

0.5.8 (2022-09-13)

Features


Demo

-.-2022-08-17-.-12.19.21.mp4

Description

Use to query book using :

  • A book title, author, publisher or ISBN (10 or 13).

Use Google Books API to get the book information.


How to install

Click the link to install the Book Search plugin: Install Link

Or, Search in the Obsidian Community plugin. And install it.


How to use

1. Click the ribbon icon, or excute the command "Create new book note".

2. Search for books by keywords.

3. Select the book from the search results.

4. Voila! A note has been created.


How to use settings

New file location

Set the folder location where the new file is created. Otherwise, a new file is created in the Obsidian Root folder.

New file name

You can set the file name format. The default format is {{title}} - {{author}}. You can use {{DATE}} or {{DATE:YYYYMMDD}} to set a unique file name.

Template file

You can set the template file location. There is an example template at the bottom.

Service Provider

You can set up the services that you use to search for books. Only Google and Naver(네이버) are available now. To use Naver Book Search, clientId and clientSecret are required. I will explain how to get clientId and clientSecret from Naver on my blog.

(Deprecated) Text to insert into front matter

You can add the following to the default Front Matter, or create a new Front Matter with the structure you want. Please use the template file described below.

(Deprecated) Text to insert into content

You can add text to the content for Dataview inline metadata. Please use the template file described below.


Example template

Please also find a definition of the variables used in this template below (see: Template variables definitions).

---
tag: 📚Book
title: "{{title}}"
author: [{{author}}]
publisher: {{publisher}}
publish: {{publishDate}}
total: {{totalPage}}
isbn: {{isbn10}} {{isbn13}}
cover: {{coverUrl}}
status: unread
created: {{DATE:YYYY-MM-DD HH:mm:ss}}
updated: {{DATE:YYYY-MM-DD HH:mm:ss}}
---

![cover|150]({{coverUrl}})

# {{title}}


Dataview rendering

Here is the dataview query used in the demo

# 📚 My Bookshelf

```dataview
TABLE WITHOUT ID
	status as Status,
	rows.file.link as Book
FROM  #📚Book
WHERE !contains(file.path, "Templates")
GROUP BY status
SORT status
```

## List of all books

```dataview
TABLE WITHOUT ID
	status as Status,
	"![|60](" + cover + ")" as Cover,
	link(file.link, title) as Title,
	author as Author,
	join(list(publisher, publish)) as Publisher
FROM #📚Book
WHERE !contains(file.path, "Templates")
SORT status DESC, file.ctime ASC
```

The banner at the top of the document is rendered using Obsidian-banners plugin.


Template variables definitions

Please find here a definition of the possible variables to be used in your template. Simply write {{name}} in your template, and replace name by the desired book data, including:

name description
title The title of the book.
author The name of the book author. It can be multiple people.
category Book category.
description Book description.
publisher The publisher of the book.
totalPage The total number of pages in the book.
coverUrl Book cover image URL.
publishDate The year the book was published.
isbn10 ISBN10
isbn13 ISBN13

Advanced

Inline Script

To print out a book object:

```json
<%=book%>
```

or

```json
<%=JSON.stringify(book, null, 2)%>
```

When you want to list or link authors:

---
authors: <%=book.authors.map(author=>`\n  - ${author}`).join('')%>
---

authors: <%=book.authors.map(author => `[[${author}]]`).join(', ')%>

License

Obsidian Book Search Plugin is licensed under the GNU AGPLv3 license. Refer to LICENSE for more information.


Contributing

Feel free to contribute.

You can create an issue to report a bug, suggest an improvement for this plugin, ask a question, etc.

You can make a pull request to contribute to this plugin development.


Support

If this plugin helped you and you wish to contribute :)

Buy me coffee on buymeacoffee.com/anpigon

Buy Me A Coffee 

About

Obsidian plugin that automatically creates notes by searching for books

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.6%
  • JavaScript 4.4%
  • Other 2.0%