diff --git a/README.md b/README.md index 46b5bd9..86ae940 100644 --- a/README.md +++ b/README.md @@ -1,222 +1,68 @@ -# Obsidian Book Search Plugin +# Obsidian Wikidata Sidebar Plugin -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/anpigon/obsidian-book-search-plugin/Release%20Obsidian%20plugin?logo=github) -![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/anpigon/obsidian-book-search-plugin?sort=semver) -[![Korean](https://img.shields.io/badge/Language-한국어-blueviolet)](README.ko.md) - -Easily create book notes. +Load data from wikidata to a sidebar, using a direct text search or via mapped frontmatter properties.
## Changelog -### [0.5.8](https://github.com/anpigon/obsidian-book-search-plugin/compare/0.5.8-beta.2...0.5.8) (2022-09-13) +### 0.1.0 Initial revision ### Features -- Add locale selection for Google searches. -- Can use the [Templater plugin](https://github.com/SilentVoid13/Templater) with. -- Enables [Inline scripts](https://github.com/anpigon/obsidian-book-search-plugin#inline-script) for templates. - -
+- Specify frontmatter mappings (eg DOI - [P356](https://www.wikidata.org/wiki/Property:P356)) +- Specify frontmatter property that holds a wikidata entity ID (Q-number) +- Simple text search +- Navigation through linked wikidata entities in the sidebar +- Links to external conent (to wikidata and using identifiers attached to an entity ## Demo -https://user-images.githubusercontent.com/3969643/184918274-8ad24546-2e01-4288-a855-c8eeb1feca7d.mp4 - -
+TBC ## 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. - -
+TBC ## How to install -Click the link to install the Book Search plugin: [Install Link](https://obsidian.md/plugins?id=obsidian-book-search-plugin) +Click the link to install the Wikidata sidebar plugin: [Install Link](https://obsidian.md/plugins?id=obsidian-wikidata-sidebar-plugin) 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. +### 1. To use frontmatter properties to retrieve associated wikidata entities +Click the ribbon icon 🌍, or excute the command "Wikidata sidebar: Load wikidata from frontmatter". - +### 2. To search wikidata +Use the command "Wikidata sidebar: Search wikidata for sidebar". -### 3. Select the book from the search results. +### 3. Select the wikidata entity from the search results. - - -### 4. Voila! A note has been created. - - - -
+### 4. The entity will be loaded in a sidebar. ## 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](https://blacksmithgu.github.io/obsidian-dataview/data-annotation/#pages). 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](#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 +### Frontmatter property mapping -```dataview -TABLE WITHOUT ID - status as Status, - rows.file.link as Book -FROM #📚Book -WHERE !contains(file.path, "Templates") -GROUP BY status -SORT status +By default this is: ``` - -## 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 +{ + orcid: 'P496', + doi: 'P356', + ipni_name_id: 'P961', + ihcode: 'P5858', +} ``` -```` - -The banner at the top of the document is rendered using [Obsidian-banners](https://github.com/noatpad/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 +### Frontmatter property for the wikidata entity ID -### 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(', ')%> -``` - -
+This defaults to `wikidata_entity_id` ## License -[Obsidian Book Search Plugin](https://github.com/anpigon/obsidian-book-search-plugin) is licensed under the GNU AGPLv3 license. Refer to [LICENSE](https://github.com/SilentVoid13/Templater/blob/master/LICENSE.TXT) for more information. +[Wikidata sidebar plugin](https://github.com/echinopscis/obsidian-wikidata-plugin) is licensed under the MIT license. Refer to [LICENSE](/LICENSE.TXT) for more information.
@@ -224,17 +70,10 @@ authors: <%=book.authors.map(author => `[[${author}]]`).join(', ')%> Feel free to contribute. -You can create an [issue](https://github.com/anpigon/obsidian-book-search-plugin/issues) to report a bug, suggest an improvement for this plugin, ask a question, etc. - -You can make a [pull request](https://github.com/anpigon/obsidian-book-search-plugin/pulls) to contribute to this plugin development. - -
- -## Support +You can create an [issue](https://github.com/echinopscis/obsidian-wikidata-plugin/issues) to report a bug, suggest an improvement for this plugin, ask a question, etc. -If this plugin helped you and you wish to contribute :) +You can make a [pull request](https://github.com/echinopscis/obsidian-wikidata-plugin/pulls) to contribute to this plugin development. -Buy me coffee on [buymeacoffee.com/anpigon](https://www.buymeacoffee.com/anpigon) +## Credits -Buy Me A Coffee  - +Sincere thanks to Toby Hudson (AKA [9909](https://github.com/99of9)) for his work on the browser plugin [Entity Explosion](https://github.com/99of9/Entity-Explosion) which inspired this plugin, and to [anpigon](https://github.com/anpigon) who developed the [obsidian book search plugin](https://github.com/anpigon/obsidian-book-search-plugin) which was used as the basis for this development.