Definition List

by shammond42
5
4
3
2
1
Score: 43/100

Description

The Definition List plugin enhances Obsidian by introducing support for HTML-style definition lists, allowing users to create structured terms and definitions within their notes. It supports rendering in both reading view and live preview, adhering to the extended Markdown syntax and partially integrating features from Pandoc's definition list specification. Users can style the lists through CSS snippets to match their preferred themes. While some advanced formatting options are not yet supported, the plugin provides a practical way to incorporate definition lists into note-taking workflows.

Reviews

No reviews yet.

Stats

20
stars
3,194
downloads
3
forks
689
days
317
days
317
days
5
total PRs
0
open PRs
0
closed PRs
5
merged PRs
10
total issues
7
open issues
3
closed issues
28
commits

Latest Version

10 months ago

Changelog

This release does the following:

  • Fixes a bug that conflicts with the dataview plugin
  • Fixes a documentation bug
  • Adds ZH language docs
  • Adds a test vault to help with future development

README file from

Github

Definition List Plugin

This plugin adds HTML definition lists to Obsidian. It is in the very early stages of development, and quite a bit more is planned.

It supports both reading view and live preview/source mode.

Credit

Special thanks to @lucible who, at this point, has contributed more to this project than I have. Thank you! Additionally, thanks go to the following contributors:

  • @lfuhr

Usage

While definition lists are not part of the standard markdown definition, a number of varients have introduced it. This plugin has adopted the markup standard as described in the Extended Syntax. It also implements a few features from Pandoc's definition list spec, specifically the support for tilde as a definition marker and definition lines indented with two spaces.

First Term
: First definition.

Second Term
~ Second definition
~ Alternate second definition with _italics_ and [a link](https://example.com).

Third Term, with _Italics_ and ==Highlighting==
  : Third definition, indented

Multiple definitions with line breaks between them are not fully supported. For example, the following is supported in Pandoc but will not render as 1 term with 2 definitions in reading mode. It does render in live preview, though.

This is an example term
: this is the first definition

: this is another definition.

Strict Line Breaks

If you use strict line breaks, you need to use a '' at the end of lines as follows.

Definition term \
: Definition definition

Unsupported Definition List Mark-up

  • Multi-line terms
  • Multi-line/paragraph definitions
  • Definition lists nested inside definitions
  • Ordered & unordered lists nested inside definitions

Styling

Because definition lists are not part of the standard Obsidian markup, they are not recognized by any of the available themes. This plugin adds a couple bits of simple styling, but you will likely have to use CSS Snippits to style to match your themes.

If you come up with some CSS that matches a popular theme please share it by creating a Github Issue on this project. I would like to build a collection of CSS samples others can use.

Future Work

  1. Build a collection of sample CSS snippits
  2. Settings to account for common alternatives
    • dt's and dd's inline vs separate lines
  3. Use eslint and improve code quality

Building from Source

Clone this repository inside the Obsidian Vault:

$ cd .obsidian/plugins/
$ git clone https://github.com/shammond42/definition-list

Resolve the plugin dependencies and build it:

$ cd definition-list
$ npm i
$ npm run build

Restart Obsidian and enable the plugin from Community Plugins in Settings.

If you wish to make changes to the plugin, run npm run dev instead of npm run build.

Contributing

Contributions are more than welome. If you wish to do so, please follow these instructions.

  1. Fork this repository and follow the steps from the previous section using the forked repository instead
  2. Create a feature branch for the changes
  3. Commit the changes and push them to the forked repository
  4. Submit a pull request