https://github.com/heseber/perplexity-converter
This plugin fixes sources (citations, Quellen) and their links in text pasted from Perplexity.
https://github.com/heseber/perplexity-converter
Last synced: 6 months ago
JSON representation
This plugin fixes sources (citations, Quellen) and their links in text pasted from Perplexity.
- Host: GitHub
- URL: https://github.com/heseber/perplexity-converter
- Owner: heseber
- License: bsd-3-clause
- Created: 2024-10-30T11:49:37.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-11-07T20:30:59.000Z (7 months ago)
- Last Synced: 2024-11-07T20:40:29.886Z (7 months ago)
- Language: TypeScript
- Size: 85.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - heseber/perplexity-converter - This plugin fixes sources (citations, Quellen) and their links in text pasted from Perplexity. (TypeScript)
README
# Perplexity Converter Plugin
This plugin can be used to fix the references (sources) in Perplexity output that is pasted into Obsidian notes.
## Usage:
1. Select the pasted text in the Obsidian note
2. Call the plugin (Cmd-P Perplexity)This will replace the selection with the fixed text. See below for details.
It is intentional that the plugin does not process the entire Obsidian file but only the selection because you may have a note that already has a previously fixed response from Perplexity or some other text, and later add another response from Perplexity to the same note. Fixing the entire note would then break things because it would try to re-process the original first response that was already fixed.
## The issue
References in answers from Perplexity (web page or MacOS app) are specified as numbers surrounded by rectangular brackets in the text, such as \[1\]. Obsidian interpretes this construct as an external link, but since there is no URL attached, clicking on the link has no effect. Even worse, if there are multiple consecutive references in the text, such as \[1\]\[2\], then Obsidian displays only the first number.
The full references are listed at the end of the response. This section is initiated with a line called "Citations:" (in the Web version) or "Sources" or "Quellen" (in the German desktop version). The subsequent lines again have numbers surrounded by brackets at the beginning of each line, followed by the actual reference. Also here, the numbers are interpreted as external links that lead nowhere.
## The solution
This plugin:
- in the text section
- transforms reference numbers in the text to clickable links that lead to the external references
- in the reference section
- modifies the reference numbers in the references section so that the numbers are no longer hyperlinks leading nowhere but instead just normal text
- adds hyperlinks right of the reference numbers that lead to the external references.## Settings
The plugin settings can be used to add additional tag lines that define the beginning of the reference section for your own language.