|
1 | | -## Obsidian Sample Plugin |
| 1 | +<img align="right" width="550" src="https://media.discordapp.net/attachments/796853434397360128/847198380878069771/Screen_Shot_2021-05-26_at_12.43.43_PM.png?width=736&height=676"> |
2 | 2 |
|
3 | | -This is a sample plugin for Obsidian (https://obsidian.md). |
| 3 | +# Obsidian Dictionary Plugin [](https://github.com/phibr0/obsidian-dictionary/releases)  |
4 | 4 |
|
5 | | -This project uses Typescript to provide type checking and documentation. |
6 | | -The repo depends on the latest plugin API (obsidian.d.ts) in Typescript Definition format, which contains TSDoc comments describing what it does. |
| 5 | +This Plugin adds a Dictionary to the [Obsidian](https://obsidian.md) Note-Taking tool. |
7 | 6 |
|
8 | | -**Note:** The Obsidian API is still in early alpha and is subject to change at any time! |
| 7 | +## Usage |
9 | 8 |
|
10 | | -This sample plugin demonstrates some of the basic functionality the plugin API can do. |
11 | | -- Changes the default font color to red using `styles.css`. |
12 | | -- Adds a ribbon icon, which shows a Notice when clicked. |
13 | | -- Adds a command "Open Sample Modal" which opens a Modal. |
14 | | -- Adds a plugin setting tab to the settings page. |
15 | | -- Registers a global click event and output 'click' to the console. |
16 | | -- Registers a global interval which logs 'setInterval' to the console. |
| 9 | +Open the *Command Palette* (default: `ctrl` + `p`), search for *Open Dictionary View* and run the command. You will see that a new View appears in the right Sidebar of Obsidian. You can set your default Language in Obsidian's Settings under *Plugin Options* > *Obsidian Dictionary* > *Default Language*. |
17 | 10 |
|
18 | | -### First time developing plugins? |
| 11 | +## Supported Languages |
19 | 12 |
|
20 | | -Quick starting guide for new plugin devs: |
| 13 | +The following Languages are currently supported: |
21 | 14 |
|
22 | | -- Make a copy of this repo as a template with the "Use this template" button (login to GitHub if you don't see it). |
23 | | -- Clone your repo to a local development folder. For convenience, you can place this folder in your `.obsidian/plugins/your-plugin-name` folder. |
24 | | -- Install NodeJS, then run `npm i` in the command line under your repo folder. |
25 | | -- Run `npm run dev` to compile your plugin from `main.ts` to `main.js`. |
26 | | -- Make changes to `main.ts` (or create new `.ts` files). Those changes should be automatically compiled into `main.js`. |
27 | | -- Reload Obsidian to load the new version of your plugin. |
28 | | -- Enable plugin in settings window. |
29 | | -- For updates to the Obsidian API run `npm update` in the command line under your repo folder. |
| 15 | +| Language | Synonym Popover | Sidebar Lookup (Offline Support) | UI Translated? | |
| 16 | +|:-------------------- |:---------------:|:--------------:|:-----------:| |
| 17 | +| English (US) | 🗸 | 🗸 (🗸) |🗸| |
| 18 | +| English (UK) | | 🗸 (🗸) || |
| 19 | +| Hindi | | 🗸 || |
| 20 | +| Spanish | 🗸 | 🗸 || |
| 21 | +| French | 🗸 | 🗸 || |
| 22 | +| Japanese | | 🗸 || |
| 23 | +| Russian | | 🗸 || |
| 24 | +| German | 🗸 | 🗸 |🗸| |
| 25 | +| Italian | 🗸 | 🗸 || |
| 26 | +| Korean | | 🗸 || |
| 27 | +| Brazilian Portuguese | | 🗸 || |
| 28 | +| Arabic | | 🗸 || |
| 29 | +| Turkish | | 🗸 | | |
| 30 | +| Chinese | | 🗸 (🗸) | 🗸 | |
30 | 31 |
|
31 | | -### Releasing new releases |
| 32 | +## Offline Dictionary |
32 | 33 |
|
33 | | -- Update your `manifest.json` with your new version number, such as `1.0.1`, and the minimum Obsidian version required for your latest release. |
34 | | -- Update your `versions.json` file with `"new-plugin-version": "minimum-obsidian-version"` so older versions of Obsidian can download an older version of your plugin that's compatible. |
35 | | -- Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix `v`. See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releases |
36 | | -- Upload the files `manifest.json`, `main.js`, `styles.css` as binary attachments. |
37 | | -- Publish the release. |
| 34 | +As of Release 2.13.0 this Plugin has experimental offline Support for English and Chinese. The offline Dictionary is pretty big (about 35 megabytes), which is why it's not bundled with this Plugin by default. It will download the neccessary files **when you are using it for the first time**. That means your first look-up still requires an internet connection. |
38 | 35 |
|
39 | | -### Adding your plugin to the community plugin list |
| 36 | +## Privacy |
40 | 37 |
|
41 | | -- Publish an initial version. |
42 | | -- Make sure you have a `README.md` file in the root of your repo. |
43 | | -- Make a pull request at https://github.com/obsidianmd/obsidian-releases to add your plugin. |
| 38 | +This Plugin relies on third-party [API's](https://en.wikipedia.org/wiki/API) to find Definitions, Synonyms, etc. You can select from a Range of API’s and choose which one to trust, the Plugin will not make requests to API’s you didn’t allow it to. To find more Information about the different API’s click the “More Info“ Button in the Settings. |
44 | 39 |
|
45 | | -### How to use |
| 40 | +If you explicitly activate the **Advanced Synonym Search**, there will be one additional API Call to analyze the *whole* Sentence the selected Word appears in. This will make the suggested Synonyms more accurate based on the context. |
46 | 41 |
|
47 | | -- Clone this repo. |
48 | | -- `npm i` or `yarn` to install dependencies |
49 | | -- `npm run dev` to start compilation in watch mode. |
| 42 | +Even though this Plugin is fully Open-Source and thus can be looked over by anyone, the third-party API’s might not be. |
50 | 43 |
|
51 | | -### Manually installing the plugin |
| 44 | +## How to make this Plugin better |
52 | 45 |
|
53 | | -- Copy over `main.js`, `styles.css`, `manifest.json` to your vault `VaultFolder/.obsidian/plugins/your-plugin-id/`. |
| 46 | +### Translations |
54 | 47 |
|
55 | | -### API Documentation |
| 48 | +If you want to help and translate this Plugin to new languages, see [locales](https://github.com/phibr0/obsidian-dictionary/tree/master/src/l10n/locale). |
56 | 49 |
|
57 | | -See https://github.com/obsidianmd/obsidian-api |
| 50 | +### New API's |
| 51 | + |
| 52 | +This Plugin is meant to be easily extensible! If you want to add a new API for a new (or already supported) Language see: [API Manager](src/apiManager.ts). |
| 53 | + |
| 54 | +You will need to create a new class for the new API, which implements [DefinitionProvider](src/api/types.ts) or [SynonymProvider](src/api/types.ts) (or both). |
| 55 | + |
| 56 | +If the Language you are working with doesn't exist yet, add it to the `LANGUAGES` in [_constants.ts](src/_constants.ts). |
| 57 | + |
| 58 | +After that, add the API to the respective List in the [API Manager](src/apiManager.ts) and finally open a Pull Request here on GitHub. |
| 59 | +This will automatically make it selectable in the Settings. |
| 60 | + |
| 61 | +> Special Thanks to [@mgmeyers](https://github.com/mgmeyers) for already making this Plugin a lot better! |
| 62 | +
|
| 63 | +## Variables |
| 64 | + |
| 65 | +You can edit the Note Template for your local Dictionary in the Settings. Here is a List of Variables you can use: |
| 66 | + |
| 67 | +- `{{notice}}` → "Autogenerated by Obsidian Dictionary" (Localized) |
| 68 | +- `{{word}}` → The Word the File is created for |
| 69 | +- `{{pronunciationHeader}}` → "Pronunciations" (Localized) |
| 70 | +- `{{meaningHeader}}` → Same as above, but for "Meanings" (Localized) |
| 71 | +- `{{phoneticList}}` → A List of all phonetics the Plugin found. |
| 72 | +- `{{meanings}}` → Same as above, but for meanings the Plugin found. |
| 73 | + |
| 74 | +Localized means, that the Text changes based on Obsidians internal Language. |
| 75 | + |
| 76 | +## How to install |
| 77 | + |
| 78 | +1. Go to **Community Plugins** in your [Obsidian](https://www.obsidian.md) Settings and **disable** Safe Mode |
| 79 | +2. Click on **Browse** and search for “Obsidian Dictionary” |
| 80 | +3. Click install |
| 81 | +4. Toggle the Plugin on in the **Community Plugins** Tab |
| 82 | + |
| 83 | +## Support me |
| 84 | + |
| 85 | +If you find this Plugin helpful, consider supporting me: |
| 86 | + |
| 87 | +<a href="https://www.buymeacoffee.com/phibr0"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=phibr0&button_colour=5F7FFF&font_colour=ffffff&font_family=Inter&outline_colour=000000&coffee_colour=FFDD00"></a> |
| 88 | + |
| 89 | +> This Plugin relies on the [Free Dictionary API](https://dictionaryapi.dev/) by [meetDeveloper](https://github.com/meetDeveloper). He is providing this API to the public for free and needs help from the community. [**More Information**](https://github.com/meetDeveloper/freeDictionaryAPI#important-note) |
0 commit comments