markdown_view_mode.ts view source
Readonly<Record<MarkdownViewMode, string>> type Readonly<Record<MarkdownViewMode, string>>
import {MARKDOWN_VIEW_MODE_LABELS} from '@fuzdev/zzz/markdown_view_mode.js'; What each mode is called in the UI.
The layouts of the markdown file view (DiskfileMarkdownView).
6 declarations
markdown_view_mode.ts view source
Readonly<Record<MarkdownViewMode, string>> type Readonly<Record<MarkdownViewMode, string>>
import {MARKDOWN_VIEW_MODE_LABELS} from '@fuzdev/zzz/markdown_view_mode.js'; What each mode is called in the UI.
markdown_view_mode.ts view source
Readonly<Record<MarkdownViewMode, string>> type Readonly<Record<MarkdownViewMode, string>>
import {MARKDOWN_VIEW_MODE_SHORTCUTS} from '@fuzdev/zzz/markdown_view_mode.js'; Each mode's keyboard shortcut, Ctrl+Shift with its position in MARKDOWN_VIEW_MODES — as shown in the UI.
markdown_view_mode.ts view source
readonly MarkdownViewMode[] type readonly MarkdownViewMode[]
import {MARKDOWN_VIEW_MODES} from '@fuzdev/zzz/markdown_view_mode.js'; The markdown view's modes, in the order the UI offers them.
markdown_view_mode.ts view source
MarkdownViewMode type "split" | "preview" | "source"
import type {MarkdownViewMode} from '@fuzdev/zzz/markdown_view_mode.js'; split shows the source beside its preview, preview the rendered
markdown alone, and source the source alone.
markdown_view_mode.ts view source
(content_loaded: boolean): MarkdownViewMode import {to_default_markdown_view_mode} from '@fuzdev/zzz/markdown_view_mode.js'; The mode a file opens in until one is chosen: preview where its content
is read-only (not loaded), else split.
content_loadedwhether the file's content was loaded, so it can be edited
booleanmarkdown_view_mode.ts view source
(event: Pick<KeyboardEvent, "code" | "ctrlKey" | "shiftKey" | "altKey" | "metaKey">): MarkdownViewMode | null import {to_markdown_view_mode_for_shortcut} from '@fuzdev/zzz/markdown_view_mode.js'; The mode a keydown switches the markdown view to, or null when it isn't
one of MARKDOWN_VIEW_MODE_SHORTCUTS. Matches the physical digit key
(event.code), since Shift turns the digit into a layout's symbol, and
takes Ctrl on every platform — Cmd+Shift+3 is a macOS screenshot. Ctrl+Shift
types no character, so taking it from a textarea loses no input.
eventthe keydown event
Pick<KeyboardEvent, "ctrlKey" | "shiftKey" | "altKey" | "metaKey" | "code">MarkdownViewMode | null