Lines
All docs

Plugins

Lines is built like a code editor such as Zed: a small core that does one thing well, and everything else as plugins. The core keeps your notes: storing, syncing, locking and listing them, the windows, and an editor that knows nothing about any one way of writing. The formats notes are written in, what draws math and diagrams, the ways to make a PDF, the themes and the icons are all plugins. Lines' own come built in, and use the same interface any other plugin would.

Settings → Plugins lists them (All Plugins). A plugin that isn't needed can be turned off, and turned on again whenever: its notes and settings wait for it. A plugin with settings of its own has a page of them under Plugins too (Spreadsheets, Paper, Keyboards and Mascots), its switch at the top and its settings below while it's on; the gear by its switch in the list goes there.

Lines' own plugins

PluginWhat it addsOn by defaultCode
MarkdownThe Markdown notes are written in (Linedown). Always on.Yessrc/plugins/markdown/, with the editor in src/lib/editor/ and printing in src/lib/print/markdown.ts
LaTeXNotes written in LaTeX (LaTeX notes)Yessrc/plugins/latex/
SpreadsheetsDraws ```csv code blocks in Markdown notes as spreadsheets, and adds /spreadsheet (Spreadsheets)Yessrc/plugins/spreadsheet/
Spreadsheet NotesNotes that are spreadsheets, kept as CSV, and opening CSV and Excel files; needs Spreadsheets. Off at first, it comes on by itself where there's a spreadsheet note (synced, imported, the feature tour's), unless it was turned off by hand (Spreadsheets)Nosrc/plugins/spreadsheet/
API RequestsSends requests written in the .http format or Hurl's, from .http and .hurl notes and ```http and ```hurl code blocks in Markdown notes, shows their responses and checks Hurl's asserts; adds /request and /hurl (API requests)Yessrc/plugins/http/
SecretsDraws {{name}} in Markdown notes as a secret kept in a locked note, to show or copy; adds /secret (Secrets)Yessrc/plugins/secrets/, with the store in src/lib/notes/secrets.svelte.ts
Math (KaTeX)The math engine, for math in notes of any formatYessrc/plugins/katex/
Diagrams (Pele)Draws ```mermaid code blocks with Pele, and adds /diagramYessrc/plugins/pele/
Diagrams (Mermaid)Draws ```mermaid code blocks with Mermaid itself, instead of Pele, and adds /diagramNosrc/plugins/mermaid/
Typing PracticeDraws ```typing code blocks as a passage to type over, timed, with your speed, accuracy and the keys you miss, and adds /typing (Linedown)Yessrc/plugins/typing/
Timing Diagrams (WaveDrom)Draws ```wavedrom code blocks as timing diagrams, register bit fields and logic circuits, and adds /timing (Linedown)Yessrc/plugins/wavedrom/
3D ModelsDraws ```openscad blocks as the models OpenSCAD makes from their code, ```stl blocks, and attached OpenSCAD, STL, OBJ, PLY, OFF, 3MF, glTF, STEP and IGES files, as 3D models to turn around; adds /model (Linedown)Yessrc/plugins/models/
Formulas (IronCalc)The formula engine, for formulas in tables and spreadsheets, and Excel workbooksYessrc/plugins/ironcalc/
TeX TypesettingMakes a LaTeX note's PDF with TeX. Needs LaTeX.Yessrc/plugins/tex/
Unsplash/unsplash: search Unsplash's free photos and put one in a note. Needs an API key when Lines is built (README)Yessrc/plugins/unsplash/
Wallhaven/wallhaven: search Wallhaven's wallpapers (only those safe for work) and put one in a note, kept with it; and Settings → Theme → New → From Wallhaven makes a theme of one's colors, and the backdrop. In the apps: Wallhaven's site doesn't answer web pagesYessrc/plugins/wallhaven/
GIPHY/giphy: search GIPHY's GIFs and put one in a note. Needs an API key when Lines is builtYessrc/plugins/giphy/
asciinemaPlays terminal recordings in Markdown notes: asciinema.org's embed code, and attached .cast files (Linedown)Yessrc/plugins/asciinema/
GitHubDraws links to GitHub short, with GitHub's mark: olekslitus/lines#12 (Linedown)Yessrc/plugins/github/
arXivDraws links to arXiv's papers as arXiv cites them, arXiv:1706.03762, and in the apps is a source of papers for /paper (Linedown) and of the library's papersYessrc/plugins/arxiv/
LibraryBooks, movies, shows, anime, videos, music, podcasts, articles and papers as notes with a type, listed in the sidebar's Library with their covers and status; and a note that's just a link filled in with what it is, by the sources below (Library)Yessrc/plugins/library/, with the rest in src/lib/library/
YouTubeLooks up links to YouTube's videos for the library (oEmbed, and in the apps the video's page) and its channels, subscribed to for their videos (in the apps, from the channel's page); plays a video's link on a line of its own in YouTube's playerVideos yes; channels nosrc/plugins/youtube/
Open LibraryLooks up books by their links there or an ISBN in a linkYessrc/plugins/open-library/
WikidataLooks up films, series, comics and books by IMDb, The Movie Database, Letterboxd, Wikipedia and Wikidata links, with Wikipedia's summary and posterYessrc/plugins/wikidata/
AniListLooks up anime by AniList links, and manga, manhwa and manhua by AniList, MyAnimeList and (in the apps) MangaDex links, with their ids on AniList and MyAnimeList; searches both for Add to Library's Anime and Comics (Library); signed in to from Settings → Library, keeps your anime list there and the Library in step (Library). Needs AniList's client id when Lines is built (VITE_ANILIST_CLIENT_ID) to sign inYessrc/plugins/anilist/
MyAnimeListLooks up anime by their links there, through Jikan, an open API that reads MyAnimeList; in the apps, signed in to from Settings → Library, keeps your anime list there and the Library in step. Needs MyAnimeList's client id when Lines is built (VITE_MAL_CLIENT_ID) to sign inYessrc/plugins/myanimelist/
MusicBrainzLooks up songs and albums by their links there, or streaming services' links it knows; covers from the Cover Art ArchiveYessrc/plugins/musicbrainz/
SpotifyPlays links to Spotify on a line of their own with Spotify's player, once played (Linedown). Not a source for the library: Spotify's terms don't let what it says be keptYessrc/plugins/spotify/
SoundCloudPlays links to SoundCloud on a line of their own with SoundCloud's player, once played; looks up its tracks; and in the apps someone's sounds that are a podcast, which Subscribe takes tooYessrc/plugins/soundcloud/
Apple PodcastsLooks up podcasts and episodes by their Apple Podcasts links, with the podcast's feedYessrc/plugins/apple-podcasts/
Web PagesLooks up a link to any page by what it says it is (JSON-LD, Open Graph, oEmbed), and tells a comic from a book. In the apps: sites don't let web pages read themYessrc/plugins/web-pages/
FeedsSubscriptions to sites' and podcasts' feeds, their posts read in the Library's Feeds; a note that's just a feed's link made a subscription; the Play button in an episode note; and notes while listening: Take Notes and the transcript in the player, times in notes and /time (Library, the player, notes while listening)Yessrc/plugins/feeds/, with the rest in src/lib/feeds/
Hacker NewsA Hacker News story's discussion under its post in the feeds, threaded, to read: from Algolia's copy of the thread, its first comments ranked as Hacker News ranks them (Library). Needs FeedsYessrc/plugins/hacker-news/, the discussion drawn by src/lib/components/Discussion.svelte (src/lib/feeds/thread.svelte.ts, text.ts)
ReadwiseBrings what Readwise and Reader keep (books, articles, episodes, tweets, with their highlights, and what was saved in Reader) into the Library, from Settings → Library, with an access token used for that and not kept (Library)Yessrc/plugins/readwise/
ObsidianBrings an Obsidian vault's notes in, with their folders (as tags), links, pictures and files, from Settings → Export and Import (Importing)Yessrc/plugins/obsidian/
BearBrings Bear's notes in, from its backup or what it exported, with their tags, links, pictures and files, pins, archive and trash, from Settings → Export and Import (Importing)Yessrc/plugins/bear/
LogseqBrings a Logseq graph's pages and journals in, outlines as lists (and prose as paragraphs), with their properties, tasks, references and assets, from Settings → Export and Import (Importing)Yessrc/plugins/logseq/
NotionBrings Notion's Markdown & CSV export in: pages, sub-pages (as tags), databases (each row a note of a type, the database a table of them), pictures and files, from Settings → Export and Import (Importing)Yessrc/plugins/notion/
EvernoteBrings Evernote's notebooks in from their .enex files: notes, files, checklists, tags, dates and reminders, the text through the feeds' safe HTML, from Settings → Export and Import (Importing)Yessrc/plugins/evernote/
PDF ReaderReads a PDF kept with a library note in the note's place, with Mozilla's pdf.js: pages as printed or in the theme's colors, over their text, contents, search, and quotes kept in the note; pdf.js's character maps, standard fonts and picture decoders come with Lines (about 2.4 MB, vite.config.ts), fetched only by a PDF that needs them (Library)Yessrc/plugins/pdf-reader/, with the reader's frame in src/lib/books/ and BookReader.svelte
EPUB ReaderReads an EPUB kept with a library note in the note's place, a reader of Lines' own: chapters made safe and shown in a frame of their own, in the theme's colors and the notes' font, paginated or scrolled, with contents, search and quotes at their EPUB CFI (Library)Yessrc/plugins/epub-reader/
ThemesThe twenty-seven themes, each with its palette, and reading themes made for other apps: VS Code, Zed, TextMate, Base16, terminals, KDE and GTK (Themes). Always on.Yessrc/plugins/themes/, with your own themes and palettes in src/lib/themes/
CodeCode notes: a note that's a file of code, in any of the 122 languages @codemirror/language-data has file extensions for (but Markdown and LaTeX, which are formats of their own), with line numbers, a fixed-width font and highlighting; it downloads and exports as its language's fileYessrc/plugins/code/
ChangesMarks the lines changed in a note since it was opened, in its margin: added, changed, and where lines were taken out.Nosrc/plugins/changes/
StylesWhole looks for the app beyond its colors, each a preset (Settings → Presets): Classic, a desktop of the late 90s with bevels and a title bar; Pixel, one-bit and minimal with a pixel font; Neon, glowing lines, a grid and scan lines; Puddle, a rainy day in a picture book with ink lines on cream paper; Lightbulb, a spark of lightning drawn as a cartoon, lemon and red with bold ink lines and hard shadows; Adventure, a 2D adventure game's pixel art, with framed slots and grass; Aero, glossy 2000s glass; Brutalist, thick rules, uppercase labels and big type; Constructivist, 1920s avant-garde posters in red, black and paper; Void, heavy minimalism; each with a color theme of its own. Their fonts are open (SIL OFL) and bundledYessrc/plugins/styles/
FontsFonts to write notes in (Settings → Typography → Font family), beside the system's: IBM Plex Sans, Fira Sans and Geist, and two monospaced ones, Geist Mono and Agave. They're open (SIL OFL) and bundled, so notes look the same on every computer and offlineYessrc/plugins/fonts/
KeyboardsKeyboards to hear as you type (Settings → Plugins → Keyboards), made from sound rather than recorded: creamy and clacky linears, tactile, clicky, Topre, and a typewriter with its bell. Recorded keyboards come as Mechvibes sound packs of your ownYessrc/plugins/keyboards/
MascotsCompanions that live in the window (Settings → Plugins → Mascots): a cat, an alien, a slime in the theme's accent and a pixel girl, each pixel art drawn for LinesYessrc/plugins/mascots/
PaperPaper to write on (Settings → Plugins → Paper): ruled lines under each line of text, dots, squares, graph and isometric paper behind the note, in the theme's colors or one chosen and as strong as wanted, grain or linen under it, and gradient backdrops behind the pageYessrc/plugins/paper/
LucideLines' icons. Always on.Yessrc/plugins/lucide/
SF SymbolsApple's icons, in the Mac and iPhone appsYessrc/plugins/sf-symbols/

Turning a plugin off

Nothing is lost. A plugin turned off stops adding what it adds, at once, in every window:

  • A format. Its notes keep their format and show as plain text, which can still be read and changed. Their ⓘ panel says so, with a button that turns the plugin back on. Export, Copy and Download still write them as what they are (a LaTeX note as a .tex file that compiles). With Spreadsheets off, a ```csv block in a Markdown note is a code block too, /spreadsheet is gone from the "/" menu, and tables and CSV files have no Convert to Spreadsheet button. With API Requests off, ```http and ```hurl blocks are code blocks with no Send buttons, and /request and /hurl are gone. With Secrets off, {{name}} is text and /secret is gone; requests still use secrets.
  • Links drawn short, or a source of papers. With GitHub or arXiv off, its links are ordinary links. With arXiv off, /paper is gone (until another source of papers is on).
  • An engine. With Math off, math shows as it's written. With both Diagrams plugins off, a ```mermaid block is a code block and /diagram is gone from the "/" menu. With Typing Practice off, a ```typing block is a code block and /typing is gone. With Timing Diagrams off, a ```wavedrom block is a code block and /timing is gone. With 3D Models off, ```openscad and ```stl blocks are code blocks, /model is gone, and an attached model is a card naming its file. With asciinema off, a recording's embed code is the picture it's written as (asciinema's preview), and an attached .cast file is a card naming it. With Formulas off, formulas show as written, and spreadsheets don't download as values or Excel workbooks. Without TeX, a LaTeX note's PDF is laid out by Lines.
  • A site's player. With Spotify or SoundCloud off, its links are links, a player playing stops, and pasting one writes its address. With SoundCloud off, its links aren't looked up, and Subscribe doesn't know them.
  • Pictures from the web. With Unsplash, GIPHY or Wallhaven off, its / command is gone; with Wallhaven off, so is New → From Wallhaven. Pictures already in notes stay: Wallhaven's are kept in the note.
  • The library. With Library off, its section leaves the sidebar, its notes are listed under Types as any typed note is, and links aren't looked up. With a source off, links it knows aren't sent to it: the next source that knows them is asked, or none. Notes already filled in stay as they are. With Feeds off, Feeds leaves the Library and no feed is fetched, the player has no Take Notes or transcript, and times in notes are their text; subscriptions stay notes (a site's under Types), with their posts kept for when it's on again. With Hacker News off, a post's comments are only linked to, on Hacker News. With Readwise off, its group leaves Settings → Library; what it brought stays. With Obsidian, Bear, Logseq, Notion or Evernote off, its group leaves Settings → Export and Import; the notes it brought stay. With a book reader off, its books' notes have no Read button and can't be added from their files; the file stays in the note, a card that opens it in its app, and quotes' links open it there too.
  • A theme or an icon set. What was chosen is kept, and Lines shows its own (Lines, Lucide) until the plugin is on again.
  • Paper. What was chosen is kept, and notes are plain until the plugin is on again.
  • A plugin others need (TeX needs LaTeX): those wait, and say what they need. Turning one on turns on what it needs too.

Pele and Mermaid draw the same blocks, so only one of them is on: turning one on turns the other off. Pele is on to begin with. Mermaid is larger and slower to load, and lays diagrams out as GitHub and other Mermaid apps do, where Pele has its own layout.

Which plugins are on is kept on each device, like the rest of Settings. A note in a format this device doesn't have, synced from another, shows as plain text and keeps its format when it syncs back.

Writing a plugin

A plugin is a folder in src/plugins/ whose module exports a function returning its Plugin (src/lib/plugins/types.ts), listed in src/plugins/index.ts. Lines calls it once it has started, so a plugin can use anything in src/lib/. Its name and description are messages, translated like the rest (Translations).

import { t } from "../../lib/i18n/index.svelte";
import type { Plugin } from "../../lib/plugins/types";

export const graphviz = (): Plugin => ({
  id: "graphviz", // what's saved when it's turned on or off: never change it
  name: t("plugins.graphviz"),
  description: t("plugins.graphviz.description"),
  icon: "workflow",
  enabledByDefault: false, // waits to be turned on in Settings → Plugins
  contributes: {
    renderers: [
      {
        id: "graphviz",
        name: "Graphviz",
        languages: ["dot", "graphviz"],
        label: t("editor.diagram"),
        render: async (source, { paper }) => (await import("./draw")).toSvg(source, paper),
      },
    ],
  },
});

That's all a new renderer needs: ```dot blocks in Markdown notes are then drawn on screen and on paper, with the resize handle and the width after the language (```dot |400) that Mermaid's diagrams have.

Load anything big the first time it's needed (import()), as KaTeX, Pele, Mermaid, TeX and 3D Models do, so Lines starts as fast with the plugin as without it. A stylesheet is the exception: added once the page is drawn, it restyles all of it, a stall that shows while scrolling, so import it with the plugin, as KaTeX does.

A plugin's own settings are a page in Settings under Plugins, given as settings, a Svelte component loaded with import() the first time Settings opens: settings: () => import("./GraphvizSettings.svelte"). Lines shows it under the plugin's name, icon and switch, while the plugin's on (src/lib/components/settings/PluginPage.svelte). It's made of Settings' shared parts (FieldGroups of FieldRows, src/lib/components/ui/), keeping its values in Lines' settings (src/lib/prefs.svelte.ts) or its own. Named <Id>Settings.svelte, for the plugin's id (SfSymbolsSettings.svelte for sf-symbols), the words in it are found by Settings' search, read from the file when Lines is built (vite.config.ts).

What a plugin can add

Every part of contributes is optional, and a plugin can add several kinds of things (Pele adds a renderer and a "/" command; API Requests a format, a code language, and editing and a "/" command for Markdown).

languages: formats notes can be written in (NoteLanguage). A language says everything Lines needs to know about notes written in it, so nothing outside its plugin knows how it reads: Languages that are kinds of one thing say so with group ({ id, name, default }): a note's ⓘ panel shows them as one choice, then which, and switching to the group picks the one chosen last on the device, or default (the Code plugin's are one group, JavaScript first). A language can also say how a line is marked in its notes (lineMarks): read(text) finds a mark written at the end of a line's text (its start, color and label), skip(state, pos) says where one is in code rather than text (asked again as the note changes, while only the lines changed are read again), and write(color, label) makes one, which ⌘⇧M uses. commentMarks(open, close) in src/lib/editor/markers.ts makes those from a comment: Markdown's <!-- mark … --> (not in code), LaTeX's % mark ….

  • id, kept with every note in it (format: latex in synced files), so it must never change; name, extensions (the usual one first) and mimeType
  • editor(): CodeMirror extensions for how it's read, drawn as you type, its keys and its "/" menu. The editor in src/lib/editor/ has pieces to build on: the menu (slashMenu), math (mathElement, MathBlockWidget), bullets and numbers (livePreview.ts), pasting tables and attachments, and the backslash commands (texCommands.ts). To show its headings in the outline beside the note, the editor adds outlineHeadings.of((state) => headings) (outline.svelte.ts), each with its level (1 the largest), title as it reads and where it starts (from); a language without one has no outline. It's asked each time a note in the language opens: the same extensions each time (made once, or again when they should change) keep the note from being set up again. What it draws can follow Settings → Editor → Show Markdown by reading markupMode (markupMode.ts): drawing nothing in source, showing all its markup in visible.
  • meta(body): what the note list, sidebar and search know of a note: title, excerpt, tags, open todos, properties and type. It's asked as the note is typed, so it should read any text, half-written too; if it throws, the note is listed as plain text, and still saved
  • plainText(body) and stats(body), for copying and the ⓘ panel's counts (countLines in notes/stats.ts counts as every format does)
  • addTag(body, tag), and newNote({ tag, type }), how a new note starts. Optionally markTitle(body, mark), for a language that keeps a title apart from the text (LaTeX's \title{…}), or whose title line can't change without changing what the note does (code's, in a comment): the note with that title changed by mark, given it as written, or null if the note has none, as for a conflicted copy's title; without it, the line the title is read from is marked
  • file(body, attachments?): the note as a file of its own, for exports and downloads
  • fromFile(text, attachments): the reverse, for such a file imported again from an export's .zip: its links into attachments the note's own again (../attachments/)
  • print(body, parts): the note laid out for paper, for its PDF, printing and PNG images. parts draws math, code, renderers' code blocks, tables' formulas and images.
  • Optionally, for a language whose notes aren't simply files of their text (a spreadsheet's are a title and CSV): copyAs, what Copy and Download call its text and give (CSV); exports, more files the share menu downloads (values as CSV, an Excel workbook); opens, more extensions it makes notes from (xlsx); and read(file), the notes a file makes, for Settings → Export and Import → Import. A language without read makes a note of a file's text as it is.

palettes: named lists of colors that themes are drawn in (Palette), as Nord is sixteen: an id themes refer to it by, a name, author for a well-known one, and its colors, 4 to 32 of them as a rule, each an id (lasting, never shown), a name if it has one of its own (Lines names one without from how it looks, in the app's language: paletteNames in src/lib/themes/names.ts), and the color, hex or rgb(), so Lines can work out shades of it. Shades aren't listed: Lines works them out.

themes: each a palette, by id (or one for each scheme, { light, dark }, where a theme's light and dark colors are each their own, as Catppuccin's Latte and Mocha), and for light, dark or both which of its colors each part of Lines is drawn in, by app.css's custom properties without -- (ThemeDefinition): { bg: "nord6", text: "nord0", accent: "nord10" }. Any part can be given a color: the backgrounds, text and accent (bg, bg-list, bg-sidebar, bg-elevated, text, text-sidebar, text-muted, text-faint, accent, tag-text, and ink, what faint overlays are mixed from), danger, callout-info, syn-keyword, the colors tags and events can be given (palette-red … palette-gray), formatting in notes (text-h1 … text-h6, text-bold, text-link and the rest, Themes), and the rest app.css has. What a theme leaves out is worked out from what it gives (workOut in src/lib/themes/palette.ts): the note list, faint and sidebar text, tags readable on their chips, text on the accent; app.css mixes borders, hovers and the selection from them; and what there's nothing to work out from is Lines' own. A part with a reading goal (GOALS: danger 4.5:1 on the note and menus, formatting in notes 4.5:1 on the note, success, callouts and tags' colors 3:1) is drawn in its color made just light or dark enough where it falls short, its hue kept; and Increased contrast's colors are worked out for every theme. A theme made from another palette should set its highlighter (highlight-base), pin, danger, success and callout colors from that palette, so highlights, line marks, callouts and icons match it rather than showing Lines' own. properties sets the rest of how it draws, made only from its own colors (color-mix(in srgb, var(--ink) 62%, transparent), var(--accent), a tint's share, a shadow). A theme with one scheme is shown in it whatever Light or dark says; author credits who made it; accessible lists it with the themes for low vision and color blindness. A theme is data, nothing more: the registry works it out into a Theme with its colors for light and dark (resolveTheme), app.css builds the rest from these and hands them to Tailwind (bg-panel, text-muted, border-line…), so every component follows the theme. It's the same shape as Lines' theme files (Themes), and the registry lists the palettes and themes people make or import after the plugins' (src/lib/themes/custom.svelte.ts); asked for a palette by id, it finds a plugin's even while it's off, so a theme of yours drawn in it keeps its colors. The Themes plugin's are in src/plugins/themes/themes.ts, each with its palette or palettes beside it (builtIn.ts gives them as a plugin's contributions).

themeFormats: kinds of theme files made for other apps, which Settings → Theme → Import reads (ThemeFormat). A format has its name ("Kitty"), the extensions its files have (tried first for those), and read(text, fileName), which gives the themes in a file, or none if it isn't one of the format's: several share .json, so each checks the file is its own. A theme read is its name, author and its colors (ImportedColors): the background and text it has, and whatever else of a sidebar, menus, secondary and faint text, an accent, status colors, a terminal's hues and code's colors it names. Lines makes a palette of those colors and a theme drawn in it, works the rest out (importedColors in src/lib/themes/palette.ts), tells light from dark by the background, and makes one theme of a light and a dark version. src/plugins/themes/formats/parse.ts reads the files themes come in: JSON with comments, YAML, TOML, INI and property lists. The Themes plugin's own read VS Code's, Zed's, TextMate's, Base16's, ten terminals', KDE's and GTK's, each loaded the first time a file is imported.

styles: whole looks for the app, beside its colors, each a preset in Settings → Presets (AppStyle). A style has its name and a description; theme, the id of a color theme made for it, which is chosen with it; settings, the rest of its preset, by the names of Lines' settings that a preset has (Themes lists them), such as { caretShape: "block", pointerStyle: "retro" }, Lines' own for any it leaves out; font, its own font's name and CSS family, for the whole app and as notes' first font in Settings → Typography; properties, custom properties it sets by name without --; and css, its own rules, each with a selector starting :root[data-style="<id>"], so they show only while it's chosen. Lines writes them after its own CSS, so they outrank it. The properties are app.css's tokens: radius-scale (how round every corner is, 1 as Lines draws them, 0 square), the text sizes (text-xs … text-xl), the shadows (card-shadow, shadow-menu, shadow-dialog, shadow-segment, shadow-drawer), the fonts (font-system, font-mono) and heights (control, row). For the rest, the app's parts carry classes made for styles to reach them by: ui-button (with data-variant: primary, secondary, quiet, danger, danger-primary), ui-icon-button, ui-field (text fields and the note list's search), ui-select (a select's button, and the field of a combobox, such as Installed font's), ui-switch and ui-switch-thumb, ui-slider-track and ui-slider-thumb, ui-segmented and ui-segment, ui-card (a group of settings), ui-callout (with data-tone), ui-nav-item, ui-menu, ui-option and ui-separator (menus, a select's options, popovers), ui-dialog, ui-sidebar-row (.active when chosen) and ui-note-row (.selected, with its background in --layer); and the panes, .sidebar, .note-list, .editor-pane, .toolbar and .titlebar, and the Calendar's week or day in the note's place, .calendar-days. Each icon is an svg.icon with its name as a class too (icon-check, icon-pin). What's drawn in a note has editor.css's classes (cm-lp-h, cm-lp-checkbox, cm-lp-tag, cm-cursor…). Colors come from the theme's custom properties, so a style works with any colors chosen with it. A style with its own color for some formatting (Void's links are the text's) sets that formatting's property as app.css does, at its weight, :root:where([data-style="<id>"]), so a color a theme gives it still wins. A style whose notes have headings in a font of their own says so in headingFont, its name and CSS family (Neon's and Constructivist's), rather than in its CSS: notes' headings are in it, and Settings → Typography → Fonts for formatting names it as their first choice, until a font is chosen for them. A part can have colors of its own, a pane shown dark (Settings → Theme → Dark panes), marked with data-scheme: a style's properties are set there again, and custom properties its css makes from the theme's colors (Classic's bevels) should be too, with :root[data-style="<id>"] [data-scheme] beside :root[data-style="<id>"], so they're made from that part's colors. The Styles plugin's own are in src/plugins/styles/, each a CSS file.

fonts: fonts to write notes in, listed in Settings → Typography → Font family after the system's (NoteFont): an id, the name shown under its sample, and its CSS family, with fonts to fall back on. Lines writes a rule for each (src/lib/themes/fonts.svelte.ts) setting --font-text, the notes' font, while the page's data-font is its id; while its plugin is off, a note chosen in it is in the system's font. The plugin brings the font's files itself (@font-face, as fontsource's packages give them), which load only once text is drawn in it. The Fonts plugin's are in src/plugins/fonts/.

paperStyles: paper a note's page can look like, chosen in Settings → Plugins → Paper (PaperStyle): a pattern drawn behind the text, a texture under it, or a backdrop behind the page, one of each at a time. A style has its name and the CSS background layers that draw it (image, size, position), in the scheme shown: layers(scheme), across the page; and for a pattern that can follow the text, lineLayers(), drawn under each line of the note in tiles 1lh high (the line's own height), so each line has its own row, headings and wrapped lines too, with columnLayers() down the whole text column from its left edge, unbroken by the lines (a grid's columns). While Settings → Plugins → Paper → Spacing is Text (to begin with), a pattern with lineLayers uses them; at a Custom size, its layers; a pattern with only lineLayers (ruled lines) always follows the text. A pattern draws in --paper-color (the theme's ink, its accent, or a color chosen, as Color says) at --paper-opacity (0 to 1, from Opacity: a line's strength; something smaller, like a dot, can go a few times over it), every --paper-step: a line of text, or the size chosen. So it follows the theme, Monochrome and Invert, and grows with the text. A texture is told whether it's shown in light or dark, and so is a backdrop, which fills the main window's note pane around the page (Lines' own are soft glows of color, with a darker version for dark; a color or a picture of your own are chosen in Settings, not from plugins). Lines sets the chosen ones as custom properties (src/lib/paper.svelte.ts) that editor.css draws behind every note but a spreadsheet's. The Paper plugin's are gradients, and SVG noise for its textures.

keyboardSounds: keyboards to hear as you type, chosen in Settings → Plugins → Keyboards (KeyboardSound). One has its name and a description, and load(context), which makes (or decodes) its sounds for a Web Audio context the first time it's chosen and gives back what each key plays going down and coming up: press(code) and release(code), by KeyboardEvent.code (KeyA, Space, Enter), each a KeyClip, an AudioBuffer and the part of it to play (offset, duration, in seconds), or nothing for silence. Lines plays one for each press, not a held key's repeats, a little higher or lower each time, at the volume chosen (src/lib/sounds/typing.svelte.ts). The Keyboards plugin's are synthesized (src/plugins/keyboards/synth.ts); sound packs people add (Mechvibes', V1 and V2, from a .zip or a folder) are listed after the plugins' (src/lib/sounds/packs.svelte.ts).

pictureLibraries: pictures on the web whose whole picture a plugin can fetch (PictureLibrary): a library's name, credit (under its picker), search(query, page, signal) giving a page of FoundImages (a thumb to show, a color while it loads, an alt), and picture(image), the picture itself as a Blob. Settings → Theme → New lists each as From …: a picture chosen there is a theme of its colors, as one from your device is, and can be the backdrop. Given as a / command's picker (pickWebImage(library), src/lib/editor/webImages.ts), a picture chosen is kept with the note, at most 2,400 pixels across, rather than shown from the library. Wallhaven's plugin is one.

mascots: companions that live in the main window, chosen in Settings → Plugins → Mascots (Mascot). One is pixel art: its frames, the poses stand, walk1, walk2, sit, sleep and cheer, each facing right, a row a line and a character a pixel, all the same size (16 × 16 and 16 × 24 are Lines' own), or a pose that's another with its eyes shut ({ like: "sit", closed: true }); its palette, a color for each character (. is see-through), where accent and accent-dark are the theme's, and e and i are its eyes and their shine, which blinking turns to its lid color but for a line; how it moves (walk, float, bobbing, or hop); and sounds, what it says its own way. Lines does the rest (src/lib/mascot/): it walks it along the bottom of the note, hops it up beside the line being written (told where by the editor, editor/cursor.ts), has it cheer, nap, turn to the pointer and pounce, react to a click, be picked up and dropped, and celebrate a ticked todo or a finished typing drill (a window event, lines:done).

markers: what marks lines in a note's margin, as a code editor marks the lines changed (MarkerSource). A source's markers(note) is given the note's text, its text when it was opened, and its format, and gives LineMarkers: the lines (from, and to for more than one, counted from 1), a color (the theme's accent, or red, orange, yellow, green, blue, purple, gray), a label shown on pointing at it, and between for a wedge where lines were taken out rather than a bar. It's asked on every change, so it has to be quick. Each source has a lane of its own, outside the note's own marks; lines next to each other marked alike join into one bar. The Changes plugin's marks what's different since the note was opened, by a line diff (src/plugins/changes/diff.ts, Myers', with the same lines at both ends set aside first). A spelling or grammar checker, a linter for code, or a request whose response failed could each be one.

iconSets: a Svelte component that draws any of Lines' icons (src/lib/icons/icons.ts) at a size.

math: an engine that draws LaTeX math into an element, after loading itself the first time.

formulas: an engine that works out formulas (FormulaEngine), for tables in Markdown notes and for spreadsheets. It keeps a sheet that works its cells out again as they change (sheet(find), find finding the other sheets its formulas name: Budget!B4), moves a formula's relative references as copying does (move), renames the other sheets a formula names, as renaming a sheet does (renameSheets), moves cells with formulas pointing at them following, as cutting and pasting does (moveCells), puts in and takes out rows and columns with formulas still pointing at the same cells (shift), says what can go at the cursor in a formula being written (complete), where its references are (references) and which functions it knows (functions, for suggesting them), and can read and write Excel workbooks. Formulas are in Excel's English, with commas, so they work the same everywhere. Only the first engine on is used; IronCalc's is Lines' own, and HyperFormula is being considered as another.

renderers: engines that draw a code block of their languages, on screen in the theme's colors or for paper in black on white, as SVG markup or an element. actions are buttons beside what they draw, down its right side. A renderer with an editor draws its blocks on screen as something to work in instead, which render still prints: the Spreadsheets plugin's draws a ```csv block as a grid. editor(dom, block) puts what it draws into dom and gives back what the editor calls as things change (BlockEditor: update when the block's code, name or width, the note around it or its read-only state changes, focus when ↓ or ↑ moves into it from the text around it, layout, destroy). Through block (EditableBlock) it reads the block's code (source), where it starts (from), its name (name, written after the language: ```csv name=costs) and the most it's shown wide (width, after a bar: ```csv |400), writes its code back as one step to undo (write) and its name (rename), and moves the cursor out into the text (leave) or into its code (showCode), which shows in its place while the cursor's in it (src/lib/editor/rendered.ts). Its actions sit beside it too: an editor that draws something narrower than the block, or below a caption, sets --actions-left and --actions-top on dom to where that ends and starts. render is given the whole note's text (note) when it's known, for what depends on the rest of the note: a ```csv block's formulas use other blocks in it. A renderer with fromFiles makes its blocks from attached files of those extensions: their card in a Markdown note gets a button (its label and icon) that puts the block read makes from the file's bytes in the file's place, with the name read gives it, if any. The Spreadsheets plugin's turns a .csv or .tsv file into a ```csv block named after the file.

bookReaders: ways to read books kept with library notes, in the note's place (BookReader, by their extensions, and the media types a drag says its files are), as the PDF and EPUB readers do. A note's book is the first attached file on a line of its own that a reader reads; the note's Read the Book button shows it, and Lines puts the contents, search, pages or scrolling, Keep Quote and how far through around it (src/lib/components/BookReader.svelte, src/lib/books/). open(dom, book) draws the book in dom at book.at, a place it gave before, in the flow chosen and, if it draws pages, as printed or in the theme's colors (themeColors); it calls book.moved with each place it's at (at, progress from 0 to 1, and a label: "Page 12 of 300", a chapter's title) and whether it got there by reading on (a page turned, the view scrolled) rather than going to a place, as only reading counts toward how far it's been read; book.selected as text is chosen in it; and, for a document of its own (an EPUB's frame), book.keydown with its keys (those Lines doesn't turn pages with go on to its shortcuts) and book.active as it's used, which the app lock counts. It gives back a Reading: its contents, whether its pages turn from the right (rtl), go(at, mark?), turn(forward), setFlow, setThemeColors if it draws pages, the selection() and its place, search(query, limit, signal), focus, layout and destroy. A place is the reader's own text, which a quote's link carries after the file: page=12 for a PDF, as PDF readers read a link's fragment; an EPUB CFI for an EPUB. details(bytes) says what a file says of itself (title, author, pages, publisher, isbn, language, a cover and a description), from its bytes, which it may take over, to fill in a book's note when it's added from its file. A reader shows what a book holds safely: the EPUB reader's frame runs nothing and loads nothing from the web (src/plugins/epub-reader/clean.ts). A reader for comics (CBZ), FictionBook or Kindle's MOBI and AZW3 would be another.

files: ways to show attached files of some kinds (FileView, by their extensions), as the 3D Models plugin shows a model to turn around. A link to such a file on a line of its own, [Bracket.stl](../attachments/….stl), is drawn with what show(dom, file) puts in dom above the card naming the file, given the file's name, label (its link's text) and data. What it gives back (Shown) takes it down with destroy, and can take the keyboard with focus, which Enter does while the file is selected: a recording starts playing. On paper it's what print(file) makes (a picture), above the file's name; without print, the name alone. What's shown can take drags of its own: an element with the class cm-lp-interactive keeps them, and a click on it that isn't a drag selects the file's line, as a click on a card does. A renderer's drawing can have such an element too, where a click shows its code. One with the class cm-lp-own-input takes all its clicks and keys, as a player does, and Esc in it goes back to the note's text with the file selected.

codeLanguages: how code blocks in more languages are highlighted, in the editor and on paper, as CodeMirror LanguageDescriptions: API Requests' highlights ```http. A plugin's language comes before the ones CodeMirror knows by the same name.

typesetters: ways to make a PDF for notes in some languages, offered beside Lines' own pages in the PDF preview.

links: sites whose links are drawn short, the way the site writes them, with its mark (SVG markup in currentColor) in front. text(url) says how a link reads, or null for one that stays as it is: GitHub's plugin reads https://github.com/olekslitus/lines/issues/12 as olekslitus/lines#12, arXiv's https://arxiv.org/abs/1706.03762 as arXiv:1706.03762. Markdown and LaTeX notes draw them in text and tables (src/lib/editor/shortLinks.ts), and printed Markdown reads them short. The first plugin on that reads a link draws it.

papers: places research papers are found (PaperSource). Each is a /paper command in Markdown and LaTeX notes, its name beside it in the menu, which opens a picker searching it (src/lib/editor/PaperPicker.svelte) and puts the paper chosen in the note as a link named by its title, as the note's format writes links. A source has its name, the credit its terms ask for under the results, and search(query, page, signal), which gives one page of Papers (id, title, authors, year, venue, the url to link to) and whether there are more; with nothing typed, nothing. Searching is the source's to pace and to keep answers of: arXiv's waits three seconds between requests, as arXiv asks. A source usually comes with links for its papers, as arXiv's does. Semantic Scholar, OpenAlex, PubMed, bioRxiv or a library's catalog would each be one:

import { t } from "../../lib/i18n/index.svelte";
import { webFetch } from "../../lib/platform";
import type { Paper, Plugin } from "../../lib/plugins/types";

interface Work {
  id: string;
  title: string;
  publication_year: number;
  authorships: { author: { display_name: string } }[];
  doi: string | null;
}

/** A work as OpenAlex describes it, as a paper: linked to by its DOI, or else its page on OpenAlex. */
const paper = (work: Work): Paper => ({
  id: work.id,
  title: work.title,
  authors: work.authorships.map((each) => each.author.display_name),
  year: work.publication_year,
  url: work.doi ?? work.id,
});

export const openalex = (): Plugin => ({
  id: "openalex",
  name: "OpenAlex",
  description: t("plugins.openalex.description"),
  icon: "graduation-cap",
  enabledByDefault: false,
  contributes: {
    papers: [
      {
        id: "openalex",
        name: "OpenAlex",
        credit: { text: "Papers from OpenAlex", href: "https://openalex.org" },
        async search(query, page, signal) {
          if (!query) return { items: [], more: false };
          const response = await (await webFetch())(`https://api.openalex.org/works?search=${encodeURIComponent(query)}&page=${page}`, { signal });
          const { results, meta } = await response.json();
          return { items: results.map(paper), more: page * meta.per_page < meta.count };
        },
      },
    ],
  },
});

libraryKinds: kinds of things kept in the library (Library), each a note's type. A kind has its type (a stable English word, like its property keys and statuses' values), its name ("Book") and the label of its row in the sidebar's Library ("Books"), an icon, the properties its notes have in order, the keys its rows show under their titles (subtitle), the shape of its covers (square, tall or wide), and its statuses, each a value written in the note and a label shown, the first where a new one starts. A kind with a shelf is listed in another's row, by its type: an album in Music, with songs; one whose shelf is false has no row (a feed, whose subscriptions the Library's Feeds lists by their posts), and isn't listed under Types either. Its mentions are the keys whose values are another note's title, written as a mention of it: an episode's podcast. Its ids are the properties that say which thing a note is besides its link (a book's isbn, a feed's feed), which src/lib/library/same.ts compares so the Library has one note of each thing. A kind that's lookUp is a link and its name so far (the Library's resource, a bookmark): its rows' menu has Look Up Details, which makes one what its link is where a source knows it, keeping its properties and tags. The Library plugin's own are in src/plugins/library/; a plugin can add others (board games, recipes…).

librarySources: where Lines finds out what a link is, to fill in a note that's just one (LibrarySource). recognizes(url) says, quickly and without asking anyone, whether it knows the link; lookup(url, signal) finds what it is, as a LibraryItem: its kind's type, title, link, properties in order, a cover's address, a description, any tags (Lines' own, as normalizeTag writes them) and any ids it's known by elsewhere (Wikidata gives a film's imdb:tt…); null when it isn't anything the library keeps, and it rejects when it couldn't ask (offline). key(url) says what a link it knows is to as an id of its own, however the link is written (youtube:dQw4w9WgXcQ for youtu.be/… and youtube.com/watch?v=…), so the same thing added from another link is found (src/lib/library/keys.ts). A source whose links may name a podcast's feed gives it with feed(url, signal), as Apple Podcasts' and SoundCloud's do: Subscribe asks those, and so does looking for a site's podcast among the links on its page (namedFeed, src/lib/feeds/feeds.svelte.ts). One whose links are subscriptions of a kind of their own gives what subscribing to one makes with subscription(url, signal), a LibraryItem with its feed among its properties (YouTube's: a channel, for its link or a video's), which Subscribe asks first; and a feed it knows that can be read another way while it can't be had gives it with feedInstead(feed, signal) (YouTube's, from the channel's page), rejecting rather than guessing where that can't be read either. A property its kind mentions (an episode's podcast, a video's channel) is written as a mention of the library's note for it, found by the page the item gives for it in linked ({ channel: "https://www.youtube.com/@…" }) or else by its title; with none, a link to that page, or just its name. Sources are asked in turn, the plugins' order, but those marked general after the rest (Web Pages, which reads any page, then Feeds' own for a site's page with a feed); a source that requires other plugins (by id) is asked, and named among those that work on the web, only while they're running, as Feeds' own for a site's page requires Web Pages; the first to find something fills the note in, through libraryNote() (src/lib/library/note.ts), which writes the note the same way for every way of adding one and downloads its cover, to keep() once the note's written. What a source found is written as just that text, escaped with escapeMarkdown() and propertyValue() (src/lib/notes/escape.ts): a source gives plain text, not Markdown. src/lib/library/web.ts asks as Lines in the apps (getJson, postJson for a JSON body such as a GraphQL query, getPage, which reads what a page says about itself, src/lib/library/page.ts; request for anything else), each request giving up after 15 seconds, and only isPublic addresses a page gives; src/lib/library/text.ts writes values alike (dates, years, lengths). A source that can search a catalog lists the kinds it searches (by type) and has search(type, text, signal), which gives what the words typed in Add to Library find, the best first, each with as much as a search says (a small cover, its link); the one chosen is a note at once, and is then looked up by its link for the rest. Send only what's needed: the link, an id in it, or the words searched for. A source for Discogs' records, say:

import { t } from "../../lib/i18n/index.svelte";
import { known, yearOf } from "../../lib/library/text";
import { getJson } from "../../lib/library/web";
import type { Plugin } from "../../lib/plugins/types";

interface Release {
  title: string;
  year?: number;
  artists?: { name: string }[];
  images?: { uri: string }[];
}

const release = (url: URL) => /^\/release\/(\d+)/.exec(url.pathname)?.[1];

export const discogs = (): Plugin => ({
  id: "discogs",
  name: "Discogs",
  description: t("plugins.discogs.description"),
  icon: "music",
  enabledByDefault: true,
  requires: ["library"],
  contributes: {
    librarySources: [
      {
        id: "discogs",
        name: "Discogs",
        recognizes: (url) => url.hostname.endsWith("discogs.com") && !!release(url),
        async lookup(url, signal) {
          const found = await getJson<Release>(`https://api.discogs.com/releases/${release(url)}`, signal);
          if (!found) return null;
          return {
            type: "album",
            title: found.title,
            link: url.href,
            properties: known([
              ["artist", found.artists?.map((artist) => artist.name).join(", ")],
              ["year", yearOf(found.year)],
            ]),
            cover: found.images?.[0]?.uri,
          };
        },
      },
    ],
  },
});

linkActions: what a web link in a Markdown note can be used for, in its menu (right-click it, src/lib/editor/linkMenu.ts), after Open Link and Copy Link. A LinkAction has a label, an icon, and run(view, link), given the editor and the WebLink (its address, its text, its Markdown and where it is); one that edits the note isn't offered in a note that can't be changed, and one that says which links it offers itself for (offers(link): YouTube's Import Playlist…, for a playlist's) is offered only for those. The Library's adds the link to the Library (src/lib/library/addLink.ts).

lists: sites that keep someone's list of what they watch or read (ListSite, src/lib/plugins/types.ts), kept in step with the Library's notes of a kind once signed in to (src/lib/library/lists.svelte.ts): its name, the kind and the property its notes keep their id there in (key), why it can't be signed in to here (unavailable), how it's signed in to (signIn: a token from a page, or in the browser), and connect, entries (the whole list, each ListEntry with its status in Lines' words, its score on the site's scale, 0 for none, its progress, when it changed and what it is) and save. It throws ListError (src/lib/library/lists.ts) for a token not taken, a wait, or another answer; Lines says which in Settings and tries again. Its Settings group is an imports panel (into: "library"), ListAccount.svelte with its id, whose import makes notes of the list. AniList's and MyAnimeList's are src/plugins/anilist/list.ts and src/plugins/myanimelist/list.ts.

imports: ways to bring things in from elsewhere (Import), each a group of Settings: notes from another app (into: "notes") in Export and Import, after Import; things for the Library (into: "library") in Library, after Links. An import has its id, the group's name and note, and panel, its rows, a component loaded the first time it's shown. The panel says where to import from (a folder, a file, a token) and what importing would do before anything's written, with ImportStep.svelte (src/lib/components/settings/): what it found, a line each, choices about how, Import (focused) and Cancel; then the import as it goes, with Stop; then what it did, with Undo Import, which a failure partway still has. Import calls imports.start(id, input) (src/lib/imports/imports.svelte.ts), which runs in the main window (Settings in a window of its own asks it to, and hears how it's going) and calls the import's work(input) there, against the notes as they are then: the notes to make (NewNote: a library note, a LibraryItem written by libraryNote(), its cover kept, with the status the other app knows, or null for none, Markdown to follow it, more, made safe as escapeMarkdownText() makes text; or a note of its own, its body in Linedown, where it came from, source, and whether it's pinned or in the Trash; each with its dates) and Markdown to add at the end of notes there (Addition), or properties to set in them (Change: a video's playlist, worked out by properties(body) from the note's text as it is when it's written, so nothing typed or synced since is lost; a value an array is written as a YAML list). It writes them a batch at a time, so the list keeps up; Undo moves the notes it made to the Trash, but those changed since, and puts back the notes it added to, but those changed since, their dates as they were. input goes between windows, so it's data (JSON), not functions. An import with files (their extensions, and recognizes(text), telling one of its files from another with the same extension, quickly) is handed files Settings → Export and Import → Import Files… was given, as the panel's files, with an onclose for when it's done with them. The Library's reads a browser's bookmarks (src/lib/library/bookmarks.ts, BookmarkImport.svelte); Readwise's asks Readwise (src/plugins/readwise/). Pocket's, Goodreads' or Letterboxd's exports would each be one.

An import of notes from another app has the rest done for it (src/lib/imports/, NotesImport.svelte): its panel is NotesImport with choices, a button for each way the app exports (a folder, or files of a kind), and read, which reads what was chosen (exportedFrom(): a folder's files, or a ZIP's, each read only when asked) into a Source: its notes (SourceNote: the id and name each had there, its text already in Linedown with its title at its top, withTitle(), its folders, its tags apart from its text, its dates, pinned or in the trash), the files they show (written in their text as attachmentPath(index) until they're kept), whether its ids are only its own (local, an Obsidian vault's paths: then it's a collection with an id of Lines' own, and one imported before is asked about), and a Tally of what doesn't come across as it was, each kind a message that takes a count and a few examples. src/lib/imports/markdown.ts reads an app's Markdown with Lines' own parser (readMarkdown()), so a translation changes only what's text: never code, math, HTML or comments, wherever they are. planNotes() says what importing would do; imports.importNotes() keeps the files as attachments in the window they were chosen in (by their content, so one kept already isn't again), then sends the notes to the main window a part at a time, where work: (input) => notesWork(input, notes.entries) leaves out those imported meanwhile. Each note knows where it came from (Note.source), so importing again adds only what isn't here, and links in notes of the same import find it by the name it had there once it's renamed. Obsidian's is src/plugins/obsidian/, Bear's src/plugins/bear/, Logseq's src/plugins/logseq/, Notion's src/plugins/notion/, Evernote's src/plugins/evernote/. An app whose notes are HTML (Evernote's) reads them with htmlToMarkdown() (src/lib/feeds/markdown.ts), where nothing runs, giving it what its own elements are (OwnElements).

discussions: sites whose discussion of a post Lines shows under it in the reader, from the post's comments link (RSS's <comments>), rather than only linking to it (DiscussionSource). A source has its name, recognizes(url), quick and without asking anyone, page(url), the discussion's own page on the site, made from what names it (its id) rather than the link as it came, and load(url, signal), giving the Discussion: its comments as a tree (each an id, author, time where the site says, its text and its replies), who posted what's discussed (author), and how many comments the site counts (count), which may be more than it gave. A comment's text is never HTML: it's TextBlocks (paragraphs, quotes and code) of TextSpans (words, a link to the web, emphasis, bold, code), which htmlToText (src/lib/feeds/text.ts) makes of a site's HTML, and Lines draws itself (src/lib/components/Discussion.svelte), its links opened by Lines rather than followed by the page. Check what a site answers before giving it on: the Hacker News plugin leaves out anything that isn't a comment. Its source is the one there is.

playerParts: what the podcast player (src/lib/components/MiniPlayer.svelte) has for the episode in it (PlayerPart): buttons, a component at the left of its row of controls, and above, one that shows above it while it has something to show; each is given the episode (src/lib/player/player.svelte.ts). Feeds' are Take Notes and the transcript's button, and the transcript (src/plugins/feeds/); what they write in a note goes through writeIn() (src/lib/editor/writeIn.ts), into the note open in a pane, as if typed.

markdown: new syntax for Markdown notes. A syntax extension for the parser (@lezer/markdown), editor extensions that draw it, commands for the "/" menu (each can go after another, by id; several after the same one keep their plugins' order), and print, a printer for each node the syntax adds. A command can open a picker of pictures from a library on the web with pickWebImage (src/lib/editor/webImages.ts): the library searches, and the picker is the same for each, as Unsplash's and GIPHY's are. Pictures and papers are both picked in WebSearchPicker.svelte, which searches as you type, loads more on scrolling and moves through what it found with the arrow keys; something else to search on the web can use it too.

embeds, also in markdown, draw links on a line of their own as something to watch or use, as files do attachments: asciinema's draws a recording's embed code as its player. One that plays a site's own player in a frame draws it with drawSitePlayer (src/lib/editor/sitePlayer.ts), as Spotify's, SoundCloud's and YouTube's do: a card until it's played (a video's, its poster, a picture loaded as it's drawn, as wide as the note at its ratio), its player not asked for before, played by the Play that loads it and not again by itself when it's drawn again, and the messages the player and Lines exchange, so one plays at a time; a player that says nothing until it's spoken to (YouTube's) is sent its greet until it answers, one that plays only for a page that says where it is gets a referrer policy, and a video's may go fullscreen (and picture in picture). The site goes in frame-src, the apps' (src-tauri/tauri.conf.json) and the web's (index.html). An Embed says which links it draws (EmbedLink: where it links, the image it shows if it's one, its text), and draw puts what it draws into an element, calling back when its size changes, and gives back a Shown, as a file view does. The core does the rest, as for images and files (src/lib/editor/attachments.ts): ↑ and ↓ stop on it, a click beside it selects it, and it's moved and deleted as a block; cm-lp-own-input works the same. With paste, a link pasted on an empty line becomes what the embed writes, its embed code say, and undo turns it back into the link.

Plugins built on plugins

A plugin can need others (requires): it runs only while they do, and turning it on turns them on. TeX needs LaTeX, and imports its code. Plugins that do the same work name each other as alternatives, and turning one on turns the others off: Pele and Mermaid both draw ```mermaid blocks, with what they add besides from src/plugins/mermaid/blocks.ts. Otherwise plugins meet only through what they add: a renderer draws the code blocks of any format whose editor asks for it, and any format's math is drawn by whichever math engine is on.

Not yet

  • Plugins come with Lines; there's no installing one made by someone else yet. That needs a way to run their code safely (the apps only run Lines' own scripts), and to check where it came from. See the roadmap.
  • Some of Lines isn't a plugin yet: drawings (Excalidraw), highlighting code blocks, symbols (-> as →), and the objects and mentions in Markdown notes.
  • Only Markdown takes additions from other plugins (markdown). Links drawn short and sources of papers are used by Markdown and LaTeX notes both.
  • Whether a plugin is on doesn't sync between devices.

Edit this page on GitHub