mirror of
https://git.srhtnin.garden/sarah/SaraView.git
synced 2026-10-14 18:38:11 +02:00
Properties, and ticking checkboxes without editing (client)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c8d29ad6f8
commit
ca37409e37
4 files changed
+245
-29
No files matched your search
+7
-5
@@ -146,10 +146,12 @@ def MaybeDiagram(TheApp, BlockText: str, FontSize: int) -> Optional[ft.Control]:
|
||||
return DiagramBlock(TheApp, Source, FontSize)
|
||||
|
||||
|
||||
def WithDiagrams(TheApp, Document: str, FontSize: int, MakeMarkdown: Callable[[str], ft.Control]) -> list[ft.Control]:
|
||||
"""The rendered view's controls: the Markdown, split around its diagrams."""
|
||||
def WithDiagrams(TheApp, Document: str, FontSize: int,
|
||||
MakeMarkdown: Callable[[str, int], ft.Control]) -> list[ft.Control]:
|
||||
"""The rendered view's controls: the Markdown, split around its diagrams.
|
||||
MakeMarkdown(Part, Start) gets each piece and where it starts in Document."""
|
||||
if not CanDraw(TheApp) or not any(DiagramFence.match(Line) for Line in Document.split("\n")):
|
||||
return [MakeMarkdown(Document)]
|
||||
return [MakeMarkdown(Document, 0)]
|
||||
from LiveMarkdown import SplitBlocks # LiveMarkdown imports this module
|
||||
|
||||
Controls: list[ft.Control] = []
|
||||
@@ -159,9 +161,9 @@ def WithDiagrams(TheApp, Document: str, FontSize: int, MakeMarkdown: Callable[[s
|
||||
if Source is None:
|
||||
continue
|
||||
if Document[Position:Block.Start].strip():
|
||||
Controls.append(MakeMarkdown(Document[Position:Block.Start]))
|
||||
Controls.append(MakeMarkdown(Document[Position:Block.Start], Position))
|
||||
Controls.append(DiagramBlock(TheApp, Source, FontSize))
|
||||
Position = Block.End
|
||||
if Document[Position:].strip():
|
||||
Controls.append(MakeMarkdown(Document[Position:]))
|
||||
Controls.append(MakeMarkdown(Document[Position:], Position))
|
||||
return Controls
|
||||
Reference in new issue
Block a user