feat(learn): Markdown files beside the PDFs, read formatted

A studyset's files take Markdown (.md, .markdown) as well as PDFs, in
the same synced rows with a kind (payload schema 3, written only for
Markdown, so older apps skip those rows). Upload a PDF becomes Upload a
file; a Markdown file must be UTF-8 text.

The reader opens one formatted and read-only through the editor's
Markdown reader, keeping fenced code, which that reader drops; the file
itself never changes, and its source text is a tap away, selectable too.
It has neither search, zoom nor screenshots. It reads in 100 parts by
its top-level blocks, so reading progress, deadlines and the cards and
notes tied to a place work as a PDF's pages do, shown as a share; its
outermost headings are its chapters.

Whats-New: Upload Markdown files beside your PDFs: they open formatted, with reading progress, deadlines and flashcards from what you select.
Whats-New-De: Lade Markdown-Dateien neben deine PDFs hoch: Sie öffnen sich formatiert, mit Lesefortschritt, Fristen und Karteikarten aus deiner Auswahl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-10 21:30:46 +01:00
commit 151f848360
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -387,6 +387,37 @@ void main() {
expect((await assets.fileOf(pdf.content.assetId))!.bytes, book);
});
test('a Markdown file is copied as Markdown (decided 10 Nov 2026)', () async {
final release = japanese();
final id = await copier.copy(
PublishedRelease(
publicId: release.publicId,
version: release.version,
items: {
...release.items,
'pdfs/grammar.json': item(
'grammar',
encodePdfSourcePayload(
const PdfSourceContent(
title: 'Grammar',
fileName: 'grammar.md',
assetId: bookAsset,
kind: FileKind.markdown,
),
),
),
},
files: release.files,
),
location: 'halkyon.eu/@alice/japanese',
fileOf: fileOf,
);
final grammar = (await pdfs.sourcesOf(id)).single;
expect(grammar.content.kind, FileKind.markdown);
expect(grammar.content.published?.item, 'grammar');
});
test("a card or note tied to a page of the release's PDF is tied to the "
'PDF made of it', () async {
final release = japanese();