Interlinear Glossing

by Mijyuoon
5
4
3
2
1
Score: 54/100

Description

The Interlinear Glossing plugin adds support for creating interlinear glosses in Obsidian, commonly used in linguistics and language documentation. It allows users to format glosses with multiple aligned levels of annotation, such as source language text, metalanguage translations, and transcriptions. Additional features include support for free translations, source text annotations, and customizable styles for enhanced readability. The plugin is especially useful for conlang creators and linguists who need precise and structured glossing capabilities within their notes.

Reviews

No reviews yet.

Stats

44
stars
5,626
downloads
9
forks
1,072
days
30
days
30
days
1
total PRs
0
open PRs
1
closed PRs
0
merged PRs
12
total issues
7
open issues
5
closed issues
1
commits

Latest Version

a month ago

Changelog

Added the fancy symbol rendering options.

README file from

Github

Obsidian Interlinear Glosses

This plugin adds support for interlinear glosses often used in linguistics documents. It's primarily meant for members of the constructed language community that use Obsidian for documenting their conlangs.

Usage

Glosses are written using code blocks with a gloss tag, like this:

```gloss
# This is an interlinear gloss block
```

Lines starting with # are consired as comments and are ignored by the parser. Blank lines and lines consisting only of whitespace are ignored as well.

Basic gloss lines (\gla, \glb)

A basic gloss consists of two lines, the source language text and the metalanguage. This can be achieved using \gla (gloss level A) and \glb (gloss level B) commands. These commands take space-separated lists of elements (words or morphemes), which will be aligned vertically element-by-element. By default level A lines have an italics style applied, while level B lines have no default style.

\gla Péter-nek van egy macská-ja
\glb Peter-DAT exist INDEF cat-POSS.3SG

Example 01a

Additionally, if there's a need to use whitespace within a single gloss element, it can be wrapped in square brackets [like this]. To use the brackets verbatim in a gloss element, they can be "escaped" by prefixing with a caret symbol like ^[this^]. Empty square brackets [] can be used to write a blank element in a gloss.

\gla János tegnap [vi-tt el] két könyv-et Péter-nek
\glb John^[TOP^] yesterday^[FOC^] [take-PST away] two book-ACC Peter-DAT

Example 01b

Additional gloss line (\glc)

If an additional line is needed, e.g. for the transcription, the \glc (gloss level C) command can be used, which functions just like \gla and \glb commands. Level C lines have no default style, just like level B.

\gla Péter-nek van egy macská-ja
\glb pe:tɛrnɛk vɒn ɛɟ mɒt͡ʃka:jɒ
\glc Peter-DAT exist INDEF cat-POSS.3SG

Example 02

Free tranlsation (\ft)

A free translation line can be added at the bottom of the gloss using the \ft command, which takes a line of text. By default, free translation lines are wrapped in quotation marks and have an italics style applied.

\gla Péter-nek van egy macská-ja
\glb pe:tɛrnɛk vɒn ɛɟ mɒt͡ʃka:jɒ
\glc Peter-DAT exist INDEF cat-POSS.3SG
\ft Peter has a cat.

Example 03

Source text (\ex)

An original source text line can be assed above the gloss using the \ex command, which takes a line of text like the \ft command. By default, original text lines have a bold style applied.

\ex Péternek van egy macskája.
\gla Péter-nek van egy macská-ja
\glb pe:tɛrnɛk vɒn ɛɟ mɒt͡ʃka:jɒ
\glc Peter-DAT exist INDEF cat-POSS.3SG
\ft Peter has a cat.

Example 04

Line breaks

If a command line feels too long, it may be broken into multiple lines by indenting the subsequent lines. Additionally, blank lines are ignored and can be used to separate commands that span multiple lines. The following two examples produce the same result, shown below:

\ex János tegnap elvitt két könyvet Péternek.
\gla János tegnap elvi-tt két könyv-et Péter-nek.
\glb John:NOM yesterday take-PST two book-ACC Peter-DAT
\ft John took two books to Peter yesterday.
\ex János tegnap elvitt két könyvet Péternek.

\gla János tegnap
    elvi-tt két
    könyv-et Péter-nek.

\glb John:NOM yesterday
    take-PST two
    book-ACC Peter-DAT

\ft John took two books to Peter yesterday.

Example 05

Numbering (\num)

A gloss can be numbered using the \num command for the purpose of referencing it from the rest of the document. Currently, this command takes a line of text that is directly used as the label for the gloss. This may be replaced with an auto-numbering system in the future.

\num 1
\gla Péter-nek van egy macská-ja
\glb Peter-DAT exist INDEF cat-POSS.3SG
\num 2
\gla [nǐ hǎo] [shì jiè]
\glb hello world

Example 16

Additional label (\lbl)

An additional label can be added at the top of a gloss using the \lbl command, usually for the purpose of specifying the language that's being shown. This command takes a single line of text.

\num 1
\lbl Hungarian
\gla Péter-nek van egy macská-ja
\glb Peter-DAT exist INDEF cat-POSS.3SG
\num 2
\lbl Mandarin Chinese
\gla [nǐ hǎo] [shì jiè]
\glb hello world

Example 17

Text source (\src)

A source for the text in a gloss can be specified using the \src command, which takes a single line of text. By default, the source is shown directly after the free translation.

\ex János tegnap elvitt két könyvet Péternek.
\gla János tegnap elvi-tt két könyv-et Péter-nek.
\glb John:NOM yesterday take-PST two book-ACC Peter-DAT
\ft John took two books to Peter yesterday.
\src Wikipedia – Hungarian Grammar; 2024

Example 18

Alternative syntax (\gl)

An alternative syntax for gloss lines is available, where source language elements are adjacent to their glosses in the markup. This has an advantage of making the markup easier to read and write, especially for longer glosses.

To use this syntax, a code block with ngloss tag is used, instead of the regular gloss tag as seen earlier:

```ngloss
# This gloss will use the alternative syntax
```

In this mode, commands for individual gloss lines (\gla, \glb, \glc) are replaced with the single \gl command. This command accepts a space-separated list of tokens that are interpreted as follows:

  • A regular bare token is always treated as a new level A (1st line) element
  • A [token] surrounded in square brackets that follows a regular token is a level B (2nd line) element, that corresponds to the last level A element
  • Any additional bracketed [token]s add further lines to the last level A element
    • Note that this mechanism allows for adding more than 3 gloss lines, as shown below
\gl János [ja:noʃ] [John:NOM]
	tegnap [tɛgnɒp] [yesterday]
	elvi-tt [ɛlvit:] [take-PST]
	két [ke:t] [two]
	könyv-et [køɲvɛt] [book-ACC]
	Péter-nek [pe:tɛrnɛk] [Peter-DAT]

Example 06a

\set glastyle cjk
\ex 牆上掛著一幅畫 / 墙上挂着一幅画
\gl 牆 [墙] [qiáng] [wall] [^[TOP]
	上 [上] [shàng] [on] [^]]
	掛 [挂] [guà] [hang] [V]
	著 [着] [zhe] [CONT] [ASP]
	一 [一] [yì] [one] [^[S]
	幅 [幅] [fú] [picture.CL] []
	畫 [画] [huà] [picture] [^]]
\ft A picture is hanging on the wall.

Example 06b

While it is generally cleaner to write each element on its own line, as in the example above, it is not strictly necessary and all tokens can be placed on the line following the \gl command for the same result. Additionally, spaces between bracketed [tokens] are not required, unlike between bare tokens. (Spaces within [tokens] work the same way as in the other syntax.)

The following example produces the same result as the one above, although the readability is generally worse:

\gl János[ja:noʃ][John:NOM]  tegnap[tɛgnɒp][yesterday]  elvi-tt[ɛlvit:][take-PST]  két[ke:t][two]  könyv-et[køɲvɛt][book-ACC]  Péter-nek[pe:tɛrnɛk][Peter-DAT]

Custom styles

All parts of a rendered gloss block have CSS classes assigned, so their appearance can be customized using CSS snippets. Below is the list of available CSS classes with examples.

.ling-gloss-body

This class represents the contents of a gloss block as a whole.

.ling-gloss-body { border: solid 2px red; }

Example 07

.ling-gloss-elements

This class represents the sub-block containing the gloss lines with the vertically aligned elements.

.ling-gloss-elements { border: solid 2px red; }

Example 08

.ling-gloss-preamble

This class represents the unmodified source text (preamble) line.

.ling-gloss-preamble { border: solid 2px red; }

Example 09

.ling-gloss-postamble

This class represents the free translation and source (postamble) line.

.ling-gloss-postamble { border: solid 2px red; }

Example 10

.ling-gloss-translation

This class represents the free translation part of the postamble line.

.ling-gloss-translation { border: solid 2px red; }

Example 19

.ling-gloss-source

This class represents the source part of the postamble line.

.ling-gloss-source { border: solid 2px red; }

Example 20

.ling-gloss-element

This class represents a single group of vertically aligned gloss elements.

.ling-gloss-element { border: solid 2px red; }

Example 11

.ling-gloss-level-*

These classes represent an element on a specific gloss line, where * is one of the lowercase letters a, b, c or x, that corresponds to the level of that line.

.ling-gloss-level-a { border: dotted 2px red; }
.ling-gloss-level-b { border: dashed 2px yellowgreen; }
.ling-gloss-level-c { border: solid 2px blueviolet; }

Example 12a

Note that the level-x style applies to all lines after the level C line, however, the CSS sibling selector :nth-child(n) can be used to target a specific line. The n count for level X lines starts from 4, since the first three lines are the levels A, B and C.

.ling-gloss-level-x { border: solid 2px red; }
.ling-gloss-level-x:nth-child(5) { font-size: 1.5em; }
\set glastyle cjk
\ex 牆上掛著一幅畫 / 墙上挂着一幅画
\gl 牆 [墙] [qiáng] [wall] [^[TOP]
	上 [上] [shàng] [on] [^]]
	掛 [挂] [guà] [hang] [V]
	著 [着] [zhe] [CONT] [ASP]
	一 [一] [yì] [one] [^[S]
	幅 [幅] [fú] [picture.CL] []
	畫 [画] [huà] [picture] [^]]
\ft A picture is hanging on the wall.

Example 12b

.ling-gloss-number

This class represent the number on the left of a gloss block.

.ling-gloss-number { border: solid 2px red; }

Example 21

.ling-gloss-label

This class represents the additional label shown at the start of a gloss.

.ling-gloss-label { border: solid 2px red; }

Example 22

Setting Options (\set, \set*)

There are some options that can be changed for an individual gloss block using the \set command, which takes an option name and, depending on the command:

  • No values (for binary switch options)
  • A single value (multiple spaces between value tokens are collapsed into a single one)
  • A list of values (bracketed [tokens] can be used for values with spaces in them)

The \set* command is a special variant of the regular \set command which is mainly intended for overriding default options that have been configured in the plugin settings. The way its behavior differs depends on the number of values that a given command takes:

  • For no values – unsets the binary switch, instead of setting it.
  • For a single value – no differences from the \set command.
  • For a list of values – removes the default values from the list, instead of appending to them.

Below is the list of available options with examples.

glaspaces

This option enables using underscore characters for whitespace in level A elements. It's particularly useful for ngloss syntax as bracketed tokens that support whitespace can't be used in level A. This option takes no values.

\set glaspaces
\gl nǐ_hǎo [hello]
    shì_jiè [world]

Example 13

markup

This option enables processing of the text formatting markup in the source text, the gloss elements and the free translation. This option takes no values.

NOTE: The markup processing is currently not implemented and will cause an error if enabled.

style, gl*style, exstyle, ftstyle, srcstyle

These options assign custom CSS classes to various parts of a rendered gloss to allow for selective customization of individual glosses. All these options accept a list of CSS class names as values. Each command targets a specific part of a gloss as follows:

  • style – Targets the the gloss contents as a whole. Useful for styles that target multiple parts of a gloss at once.
  • gl*style – Targets an element on a specific gloss line, where * is one of the lowercase letters a, b, c or x, that corresponds to the level of that line.
    • Note that glxstyle applies to all lines after the level C line. See .ling-gloss-level-* for details.
  • exstyle – Targets the unmodified source text (preamble) line.
  • ftstyle – Targets the free translation part of the postamble line.
  • srcstyle – Targets the source part of the postamble line.

For each provided class name, a CSS class called .ling-style-* is assigned to the target, where * is the provided class name.

For example, assuming these styles defined in a CSS snippet:

.ling-style-big { font-size: 1.5em; }
.ling-style-solid { border: solid 2px red; }
.ling-style-dashed { border: dashed 2px yellowgreen; }

The following gloss should be displayed as shown here:

\set glastyle big solid
\set ftstyle dashed
\gl János [ja:noʃ] [John:NOM]
    tegnap [tɛgnɒp] [yesterday]
    elvi-tt [ɛlvit:] [take-PST]
    két [ke:t] [two]
    könyv-et [køɲvɛt] [book-ACC]
    Péter-nek [pe:tɛrnɛk] [Peter-DAT]
\ft John took two books to Peter yesterday.

Example 14

Predefined style overrides

By default, the plugin defines several useful style overrides for use with the *style options described earlier. These overrides are described below.

cjk (for glastyle)

This is a style that removes the default italics styling. This is meant to be used with CJK characters which do not normally use italics:

\set glastyle cjk
\gl 你好 [nǐhǎo] [hello]
	世界 [shìjiè] [world]

Example 15a

And the same gloss with the \set line removed:

Example 15b

right (for srcstyle)

This is a style that right-aligns the source instead of putting it directly after the free translation:

\set srcstyle right
\gl Péter-nek[Peter-DAT]
	van[exist]
	egy[INDEF]
	macská-ja[cat-POSS.3SG]
\ft Peter has a cat.
\src The author of this document; 2024

Example 23

line (for srcstyle)

This is a style that places the source on a new line instead of putting it directly after the free translation:

\set srcstyle line
\gl Péter-nek[Peter-DAT]
	van[exist]
	egy[INDEF]
	macská-ja[cat-POSS.3SG]
\ft Peter has a cat.
\src The author of this document; 2024

Example 24

alt (for srcstyle)

This is a style that's meant to select an alternative appearance for the source. Currently, it changes the round brackes to the square ones.

\set srcstyle alt
\gl Péter-nek[Peter-DAT]
	van[exist]
	egy[INDEF]
	macská-ja[cat-POSS.3SG]
\ft Peter has a cat.
\src The author of this document; 2024

Example 25

Option Defaults

Since the version 2.0 it is possible to set the default values for any of the options listed in the previous section. These defaults will then apply to all glosses in a vault without having to repeat \set commands in every one of them.

To configure the defaults, go to the plugin settings (Settings → Interlinear Glossing) menu.

Example 26

Gloss Element Aligning

Since the version 2.0 there is an option to horizontally align the text in individual gloss elements towards the side that starts/ends with one of certain "marker" characters. Such characters are normally the affix and clitic boundary indicators (i.e. hyphen and equals sign), but custom characters can be configured instead. There is also a separately toggleable option to center align the elements that lack a "marker" character on either end.

To configure the element alignment, go to the plugin settings (Settings → Interlinear Glossing) menu.

Example 27

An example gloss using the above options is shown below:

\ex imadu avelamo sobala de putri keraka.
\gla ima -du a- vela -mo soba -la de putri kera -ka
\glb 1 -EXP POSS- house -PTV near -LOC DEF.SG person see -PFV
\ft I saw a (certain) person near my house.

Example 28

Fancy Symbol Replacement

Since the version 2.2 there is an option to automatically replace some ASCII symbols in gloss elements with their more appropriate unicode equivalents. This replacement occurs only in rendered glosses and does not affect the source text. Currently supported symbols include the clitic boundary marker (equals sign), infix brackets (less/greater than symbols), as well as a shortcut string "!0" for the null element symbol.

To enable these replacements, go to the plugin settings (Settings → Interlinear Glossing) menu.

Example 29

Installation

Obsidian plugin repository

You can now install this plugin from the official community plugin repository by going to Settings → Community plugins → Browse in Obsidian and searching for “Interlinear Glossing”.

Manual installation (deprecated)

  • Create a folder called ling-gloss anywhere
  • Go to the "Releases" page and download main.js, manifest.json and styles.css files from the latest version
  • Copy the files you've downloaded into the folder you've created earlier
  • Open your vault's plugins folder at <Vault Folder>/.obsidian/plugins and put your folder there
  • Reload the plugins in Obsidian settings or restart the program
  • Enable the "Interlinear Glossing" plugin in Obsidian settings

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Wrap with shortcuts
4 years ago by Manic Chuang
Wrap selected text in custom tags with shortcuts.
ObsidianTweaks
4 years ago by Jeppe Klitgaard
A plugin that implements a number of tweaks that should've been native to Obsidian.
Extract PDF Annotations
4 years ago by Franz Achermann
This is a plugin for https://obsidian.md. It extracts Annotations from PDF Files.
Timestamp Notes
4 years ago by Julian Grunauer
This plugin allows side-by-side notetaking with videos. Annotate your notes with timestamps to directly control the video and remember where each note comes from.
Raindrop Highlights
4 years ago by kaiiiz
An Obsidian.md plugin that syncs highlights from Raindrop.
Blockquote Levels
4 years ago by Carlo Zottmann
A plugin for Obsidian (https://obsidian.md) that adds commands for increasing/decreasing the blockquote level of the current line or selection(s).
Onyx Boox Annotation & Highlight Extractor
4 years ago by Akos Balasko
This tool extracts the highlights and the annotations from OnyxBoox Reading Notes txt files, and converts them to linked zettelkasten literature and permanent notes
Ordered List Style
4 years ago by erykwalder
Writing
3 years ago by johackim
Write and format your next book directly from Obsidian
Toggle Case
3 years ago by automattech
Obsidian plugin to toggle between `lowercase` `UPPERCASE` and `Title Case`
Heading Level Indent
3 years ago by svonjoi
obsidian plugin for hierarchical structuration of document content based on heading levels
Callout Integrator
3 years ago by
A plugin for Obsidian to allow the integration of long blocks of text into callouts.
ibook
3 years ago by bingryan
export mac ibook annotations/hightlights to obsidian vault
LaTeX to unicode converter
3 years ago by fjdu
Convert LaTeX commands into unicode sequences
Natural Language Syntax Highlighting
3 years ago by artisticat
Highlight adjectives, nouns, adverbs, verbs, and conjunctions in Obsidian.md
Slide Note
3 years ago by Jinyan Xu
SupSub
3 years ago by Wjgoarxiv
::SupSub enables wrapping selected text with `<sup>` or `<sub>` tags::
Image Converter
3 years ago by xRyul
⚡️ Convert, compress, resize, annotate, markup, draw, crop, rotate, flip, align images directly in Obsidian. Drag-resize, rename with variables, batch process. WEBP, JPG, PNG, HEIC, TIF.
Change Case
3 years ago by David Brockman
Plugin to let you change the case (camelCase, snake_case, etc) of the current selection.
Text Conversions
3 years ago by Juan D Frias
Text conversions for Obsidian
Formatto
2 years ago by Deca
Simple, fast, and easy-to-use Obsidian Markdown formatter.
Auto-\displaystyle Inline Math
2 years ago by Ryota Ushio
An Obsidian.md plugin to automatically make all inline maths \displaystyle.
Autocorrect Formatter
2 years ago by b-yp
A plugin running on Obsidian that utilizes autocorrect to format Markdown content.
Image Helper
2 years ago by Chongmyung Park
Context menu to convert a image to another format in reading view in Obsidian.md
Better Order List
2 years ago by Boninall
PDF++
2 years ago by Ryota Ushio
PDF++: the most Obsidian-native PDF annotation & viewing tool ever. Comes with optional Vim keybindings.
Enhanced Annotations
2 years ago by ycnmhd
BookFusion
2 years ago by BookFusion
BookFusion Obsidian Plugin
heti
2 years ago by Moeyua
Note Definitions
2 years ago by Dominic Let
Obsidian plugin for seamless viewing of personal definitions
Plugins Annotations
2 years ago by Andrea Alberti
Obsidian plugin that allows adding personal comments to each installed plugin.
Xournal++
2 years ago by Jon Jampen
Obsidian plugin that seamlessly integrates Xournal++ for handwritten notes and annotations.
Remove Newlines
2 years ago by Elias Jaffe
A plugin for Obsidian.md which removes newlines and blank lines from selected or pasted text.
Heading Toggler
2 years ago by Lord Turmoil
Toggle heading levels in Obsidian
Inline spoilers
2 years ago by logonoff
Adds Discord-like syntax for inline spoilers.
Advanced Tables
6 years ago by Tony Grosinger
Improved table navigation, formatting, and manipulation in Obsidian.md
PDF Highlights
5 years ago by Alexis Rondeau
Extract highlights, underlines and annotations from your PDFs into Obsidian
Markdown Formatting Assistant
5 years ago by Reocin
This Plugin provides a simple WYSIWYG Editor for Markdown and in addition a command line interface. The command line interface facilitate a faster workflow.
Code block from selection
5 years ago by Dmitry Savosh
Obsidian plugin. Adds code block for the selected text.
Format Hotkeys
5 years ago by Ansel Santosa
Google Docs style formatting hotkeys for Obsidian
Admonition
5 years ago by Jeremy Valentine
Adds admonition block-styled content to Obsidian.md
Table Extended
5 years ago by AidenLx
Extend basic table in Obsidian with MultiMarkdown table syntax
Auto pair chinese symbol
5 years ago by renmu123
中文符号自动补齐
Smart Typography
5 years ago by mgmeyers
Converts quotes to curly quotes, dashes to em dashes, and periods to ellipses
Paste Mode
5 years ago by Jacob Levernier
Obsidian Notes plugin for pasting text and blockquotes to the cursor's current level of indentation.
cMenu
5 years ago by Chetachi
An Obsidian.md plugin that adds a minimal text editor modal for a smoother writing/editing experience ✍🏽.
Multi-line Formatting
5 years ago by nmady
Format Obsidian text over an entire selection, even if that selection has paragraph breaks in the middle!
Annotator
5 years ago by Elias Sundqvist
A plugin for reading and annotating PDFs and EPUBs in obsidian.
Markmind
5 years ago by Mark
A mind map, outline for obsidian,It support mobile and desktop
Hypothes.is
5 years ago by weichenw
An Obsidian.md plugin that syncs highlights from Hypothesis.
Callout Toggles
2 years ago by Aly Thobani
An Obsidian plugin to quickly add, change, or remove callout wrappers in your notes.
复制图文 (Copy Image Text)
2 years ago by msgk
obsidian插件,复制笔记内容(包括文本和图片)到剪贴板
Jisage -Japanese Indentation-
2 years ago by Telehakke
Obsidian plugin.
Bottom to Top
a year ago by Henry Gustafson
Discord Timestamps
a year ago by Erika Gozar
Displays discord timestamps in read mode as they would appear in Discord.
Note Annotations
a year ago by Jan Beck
ShaahMaat-md
a year ago by Mihail Kovachev
Readeck Importer
a year ago by Makebit
Import bookmarks from Readeck to Obsidian
Feedly Annotations Sync
a year ago by Nick Felker
Download my Feedly annotations
PDF Writer
a year ago by Jobelin Kom
Obsidian plugin To write and fill a PDF
Image Size
a year ago by Jie Zhang
Set the default size for pasted images.
Extended Markdown Syntax
a year ago by Kotaindah55
Extend your Markdown syntax using delimiters instead of HTML tags, such as underlining, superscript, subscript, highlighting, and spoiler.
Chat clips
a year ago by sleepingraven
Record chat in ordinary markdown list.
Media Slider
a year ago by Aditya Amatya
An obsidian plugin that helps to make slider for images, audios, videos, pdfs, markdown, etc in obsidian notes.
Note Placeholder
a year ago by XZSt4nce
Replaces text of note link to placeholder in view mode.
Annotate Audio
a year ago by VidE
Canvas Format Brush
a year ago by wenlzhang
An Obsidian plugin that allows you to copy and paste formatting attributes (size and color) between canvas elements, similar to the format painter in Word.
Cubox
a year ago by delphi-2015
Cubox Official Obsidian Plugin
Paste Reformatter
a year ago by Keath Milligan
A plugin for Obsidian that reformats pasted HTML and plain text content, giving you precise control over how content is transformed when pasted into your notes.
Vim Marker Sharpener
a year ago by Artem Dvoryadkin
Text formatting commands in Vim mode. Supports applying styles (bold, italic, etc.). Works correctly in visual mode with selected text.
Keyboard Formatter
8 months ago by Lauloque
Formats keyboard text (kbd) in your Obsidian notes quickly and consistently.
SideNote
5 months ago by mofukuru
Obsidian plugin: Add comment on the part of sentence and refer in comment view.
TIPA Support
5 months ago by Deniz Akdemir
This is an Obsidian plugin that enables Obsidian users to use the TIPA notation when taking notes on phonetics and phonology.