LuloDev / logseq-book-fetch

Logseq plugin that fetches book data based on an ISBN using the Google Books API.
MIT License
5 stars 0 forks source link

[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] Icon # LOGSEQ-BOOK-FETCH This is a Logseq plugin that fetches book data based on an ISBN using the Google Books API. [Report error](https://github.com/LuloDev/logseq-book-fetch/issues) · [Suggest something](https://github.com/LuloDev/logseq-book-fetch/issues)

Usage

Demo

  1. Open Logseq.
  2. Enter the ISBN of the book you want to fetch data for.
  3. Use the slash command /Book Fetch in the editor.

The plugin will fetch the book data and insert it into the current block.

(Go Top)

Features

Availability Data

Data Description
Title The title of the book.
Author The author(s) of the book.
Publisher The publisher of the book.
Publication The publication date of the book.
Description A brief description of the book.
Categories The categories or genres of the book.
Page Count The total number of pages in the book.
Language The language in which the book is written.
Image The cover image of the book.
ISBN The ISBN of the book.
Maturity Rating The Maturity Rating of the book.

Template Configuration

The template is used to format the fetched book data that is inserted into the current block in Logseq. You can customize the template to fit your needs.

The template is a string that contains various keys enclosed in double curly braces ({{key}}). Each key is replaced by the corresponding value from the book data. The available keys are:

You can use \n to insert a line break in the template. For example, the following template:

Note: If you edit the content directly in the settings.json file of the Logseq plugin configurations, you should use \\n for line breaks. However, if you edit it through the Logseq app, you only need to use \n.

Examples

Here are some examples of how you can use the template configuration:

Example 1: Simple Template

{{title}} by {{authors}}

Example 1

Example 2: Detailed Template with Line Breaks

- Title: {{title}}\n- Authors: {{authors}}\n- ISBN: {{isbn}}\n- Published At: {{publishedAt}}\n- Categories: {{categories}}\n- Pages: {{pages}}\n- Language: {{language}}\n- Publisher: {{publisher}}\n- Maturity Rating: {{maturityRating}}\n- Description: {{description}}

Note: If you edit the content directly in the settings.json file of the Logseq plugin configurations, you should use \\n for line breaks. However, if you edit it through the Logseq app, you only need to use \n.

Example 2

Example 3: Detailed Template table row

| ![Book Cover]({{thumbnail}}) | {{title}} | {{isbn}} | {{authors}} | {{publishedAt}} | {{categories}} | {{pages}} |

Example 3

(Go Top)

Development

To build the project, run

pnpm run build

To start the development, run

pnpm run dev

(Go Top)

Dependencies

Author

LuloDev

LICENSE

MIT License

(Go Top)