Skip to content

Commit

Permalink
initial revision
Browse files Browse the repository at this point in the history
  • Loading branch information
nickynicolson committed May 23, 2024
1 parent 32704fe commit 082b5de
Show file tree
Hide file tree
Showing 19 changed files with 628 additions and 1,496 deletions.
54 changes: 10 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
# Obsidian Wikidata Sidebar Plugin
# Obsidian Phylotree Plugin

Load data from wikidata to a sidebar, using a direct text search or via mapped frontmatter properties.
Display phylogenetic trees in Obsidian. Tree data is specified in a fenced code block in newick or nexus format, and the tree is visualised using the phylotree library.

<br>

## Changelog

### 0.2.0
- Use selected text as search input, if available ([issue #3](https://github.com/echinopscis/obsidian-wikidata-plugin/issues/3)).
- Add bracketed description text in entity selection list, if available ([issue #4](https://github.com/echinopscis/obsidian-wikidata-plugin/issues/4))
- Correct display in select modal when called from frontmatter (shows full URL for entity id) ([issue #5](https://github.com/echinopscis/obsidian-wikidata-plugin/issues/5))
- Bypass select modal if only one item found ([issue #6](https://github.com/echinopscis/obsidian-wikidata-plugin/issues/6))

### 0.1.0 Initial revision

### Features

- 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
- Adds newick and nexus fenced code blocks to Obsidian to specify phylogenetic trees for visualisation
- Node click constructs a search for the node labels included in the clade

## Demo

Expand All @@ -32,52 +23,27 @@ TBC

## How to install

Download the zip file named "wikidata-sidebar-plugin.zip" attached to the [latest release](https://github.com/echinopscis/obsidian-wikidata-plugin/releases/latest) and unzip in under the `.obsidian/plugins` directory under your Obsidian vault.
Download the zip file named "phylotree-plugin.zip" attached to the [latest release](https://github.com/echinopscis/obsidian-wikidata-plugin/releases/latest) and unzip in under the `.obsidian/plugins` directory under your Obsidian vault.

## How to use

### 1. To use frontmatter properties to retrieve associated wikidata entities
Click the ribbon icon 🌍, or excute the command "Wikidata sidebar: Load wikidata from frontmatter".
Create a fenced code block containing phylogenetic tree data, labelled either "newick" or "nexus" depending on the tree format used. Switch to view mode and you should see a visual representation of the tree. The visualisation is interactive: clicking on a node will execute a search across the Obsidian vault for all included node labels.

### 2. To search wikidata
Use the command "Wikidata sidebar: Search wikidata for sidebar".

### 3. Select the wikidata entity from the search results.

### 4. The entity will be loaded in a sidebar.

## How to use settings

### Frontmatter property mapping

By default this is:
```
{
orcid: 'P496',
doi: 'P356',
ipni_name_id: 'P961',
ihcode: 'P5858',
}
```

### Frontmatter property for the wikidata entity ID

This defaults to `wikidata_entity_id`

## License

[Wikidata sidebar plugin](https://github.com/echinopscis/obsidian-wikidata-plugin) is licensed under the MIT license. Refer to [LICENSE](/LICENSE.TXT) for more information.
[Phylotree plugin](https://github.com/echinopscis/obsidian-phylotree-plugin) is licensed under the MIT license. Refer to [LICENSE](/LICENSE.TXT) for more information.

<br>

## Contributing

Feel free to contribute.

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.
You can create an [issue](https://github.com/echinopscis/obsidian-phylotree-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/echinopscis/obsidian-wikidata-plugin/pulls) to contribute to this plugin development.
You can make a [pull request](https://github.com/echinopscis/obsidian-phylotree-plugin/pulls) to contribute to this plugin development.

## Credits

Sincere thanks to Toby Hudson (AKA [99of9](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.
Thanks to the developers of phylotree, on which this plugin relies.
12 changes: 6 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "obsidian-book-wikidata-sidebar-plugin",
"name": "Wikidata sidebar",
"version": "0.2.0",
"id": "obsidian-phylotree-plugin",
"name": "Phylotree Plugin",
"version": "1.0.0",
"minAppVersion": "0.12.0",
"description": "Wikidata",
"description": "Display newick and nexus code blocks using phylotree.",
"author": "nickynicolson",
"authorUrl": "https://github.com/nickynicolson",
"isDesktopOnly": false
"authorUrl": "https://github.com/echinopscis/obsidian-phylotree",
"isDesktopOnly": true
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"name": "wikidata-sidebar-plugin",
"version": "0.5.11",
"description": "A wikidata plugin",
"homepage": "https://nickynicolson.github.io/wikidata-sidebar-plugin/",
"name": "phylotree-block-plugin",
"version": "0.1.0",
"description": "A phylotree block processor",
"homepage": "https://nickynicolson.github.io/phylotree-block-plugin/",
"main": "main.js",
"standard-version": {
"t": ""
},
"keywords": [
"wikidata",
"sidebar",
"phylotree",
"obsidian",
"plugin"
],
Expand Down Expand Up @@ -47,10 +46,12 @@
"husky": "^8.0.1",
"jest": "^28.1.3",
"obsidian": "latest",
"phylotree": "^2.0.1",
"prettier": "^2.7.1",
"standard-version": "^9.3.2",
"ts-jest": "^28.0.7",
"typescript": "4.4.4"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"dependencies": {}
}
36 changes: 0 additions & 36 deletions src/apis/base_api.ts

This file was deleted.

42 changes: 0 additions & 42 deletions src/apis/models/wikidata_item_by_property_sparql_reponse.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/apis/models/wikidata_item_desc_sparql_response.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/apis/models/wikidata_item_links_sparql_response.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/apis/models/wikidata_item_stmts_sparql_response.ts

This file was deleted.

45 changes: 0 additions & 45 deletions src/apis/models/wikidata_response.ts

This file was deleted.

Loading

0 comments on commit 082b5de

Please sign in to comment.