MCPcopy Index your code
hub / github.com/erykwalder/quoth

github.com/erykwalder/quoth @0.7.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.7.1 ↗ · + Follow
147 symbols 304 edges 33 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Quoth Plugin

This a plugin for Obsidian that allows embedding from other markdown files with greater flexibility than the standard embed syntax.

It allows:

  • Embedding parts of a single block
  • Embedding multiple parts in one "quote"
  • Inlining the embed so it aligns with other content
  • Automatically adding source author and title to the embed

Copying References

The simplest way to use the plugin is to use the copy reference command. This will take a selection from source mode or preview mode and copy a qouth code block into your clipboard that can be pasted in other documents. The hotkey for this is either Ctrl-Shift-' or Cmd-Shift-' depending on your OS.

Code Blocks

Code blocks can also be constructed manually, and some functionality requires it. All the fields in the code block can be seen below:

```quoth
path: [[Filename#Heading]]
ranges: "Hello " to "world.", "Foobar" to "Bizzbaz"
join: " -- "
display: inline
show: author, title
```

Fields

path

Syntax: [[filename#subpath]]

subpath syntax:

  • A heading: #Some heading
  • A block id: #^blockid
  • A list item: #-Some list item

Default: None

Description: Required. The path to the content you want to include, formatted like an obsidian link. Additionally supports specifying a list item. Multiple headings or multiple list items can be chained in the subpath.

ranges

Syntax: range, range

range syntax:

  • "text" to "text"
  • "whole quote"
  • line:col to line:col
  • after "text"
  • after line:col

Default: None

Description: A subselection of the path you would like to embed. Multiple ranges are joined by ,.

join

Syntax: "string"

Default: " ... "

Description: How to combine multiple ranges. This field is only used if there are 2 or more ranges specified.

display

Syntax:

  • embedded
  • inline

Default: embedded

Description: How to display the embed.

show

Syntax: option, option

options:

  • author
  • title

Default: None

Description: Whether to include the source author or title. Multiple options can be joined with ,.

Deprecated Fields

Line Syntax Description Default
file [[filename]] Deprecated. Use path instead. The filename of a markdown file in internal link syntax. None
heading #heading1#heading2 Deprecated. Use path instead. The parent headings of an embed. These are case sensitive. Multiple can be chained for greater specificity. None
block ^blockid Deprecated. Use path instead. The block id containing the quote. None

Limitations

There are currently some limitations to the current implementation:

  • Copying from preview mode only works if the underlying markdown can be reconstructed. Things like mathjax are not currently handled. You can always copy from source/live mode.
  • The embedded content cannot contain another quoth code block, because that could lead to infinite recursion.
  • Rendering relies on an async call to Obsidian's renderMarkdown API, so embeds relying on postprocessing (like other embeds) will not work.
  • It is for display only. It cannot do things that would update the original source, like checking checkboxes.

Extension points exported contracts — how you extend this code

Range (Interface)
(no doc) [10 implementers]
src/model/range.ts
QuothData (Interface)
(no doc)
src/settings.ts
pos (Interface)
(no doc)
src/commands/rangeRegex.test.ts
ListItemSubpathResult (Interface)
(no doc)
src/util/obsidian/resolveList.ts
MarkdownToken (Interface)
(no doc)
src/processors/markdown.ts
EmbedCache (Interface)
(no doc)
src/model/embedCache.ts
testCase (Interface)
(no doc)
src/commands/rangeRegex.test.ts
testCache (Interface)
(no doc)
src/util/obsidian/test/testHelpers.ts

Core symbols most depended-on inside this repo

parse
called by 25
src/model/embed.ts
resolveList
called by 19
src/util/obsidian/resolveList.ts
indexPos
called by 17
src/util/stringSearch.ts
getParentHeadings
called by 12
src/util/obsidian/subpath.ts
scopeSubpath
called by 10
src/util/obsidian/subpath.ts
indexes
called by 7
src/model/range.ts
toString
called by 7
src/model/range.ts
posIndex
called by 5
src/model/range.ts

Shape

Function 88
Method 30
Class 18
Interface 11

Languages

TypeScript100%

Modules by API surface

src/model/range.ts31 symbols
src/model/embedCache.ts19 symbols
src/commands/rangeRegex.ts14 symbols
src/processors/markdown.ts13 symbols
src/processors/processor.ts8 symbols
src/model/embed.ts7 symbols
src/commands/replaceBlockquotes.ts7 symbols
src/util/obsidian/resolveList.ts6 symbols
src/util/obsidian/subpath.ts5 symbols
src/settings.ts5 symbols
src/main.ts5 symbols
src/commands/copyReference.ts5 symbols

For agents

$ claude mcp add quoth \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact