Discourse Dictionary Plugin 🆎

Summary: The Discourse Dictionary plugin allows a user to add the dictionary meaning of a word to the first post of a topic. Here’s a short video to demonstrate the working.

:link: GitHub: GitHub - fzngagan/discourse-dictionary: A discourse plugin to add meanings of a given word to the post
:arrow_right: Install: Follow the plugin installation guide.

Features

  • Allows a user (default to TL2) to select a dictionary meaning of a word via the composer. The selected word when hovered, will display a tooltip showing the selected meaning.
  • Currently supports Oxford Dictionary API.
  • Currently supports singular form of words i.e. fungi won’t work you’ll have to use fungus.
  • The meanings are cached to the db for quick loads in the future and to avoid exhausting the API thresholds.
  • You can tweak the values once they’re loaded in the composer.

Configuration

  • Get your API credentials from https://developer.oxforddictionaries.com/
  • Use the app id for the site setting discourse dictionary oxford app id
  • Use the api key for the site setting discourse dictionary oxford api key
  • You can set the minimum trust level of user’s who can access this feature using discourse dictionary min trust level

TODO

  • Support plural forms of words
  • Support other Dictionary APIs
  • Include tests

Credits

Thanks a lot @sam

  • I’ve drawn insipiration from the tooltip code in the discourse-footnote plugin.
  • The markdown docs on meta were indispensable for writing this plugin.
15 Likes

Thank you so much for this @fzngagan! If the guides can be improved in any way don’t hesitate to let us know! :tada:

6 Likes