From 37d6000702d7af174954bd5b9d00b8e2def18d61 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sat, 2 Nov 2024 18:12:46 -0500 Subject: [PATCH] Implementing page "semantic splitters". --- src/MiniDocs/ByteString.extension.st | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/MiniDocs/ByteString.extension.st b/src/MiniDocs/ByteString.extension.st index c36f217..35b4f83 100644 --- a/src/MiniDocs/ByteString.extension.st +++ b/src/MiniDocs/ByteString.extension.st @@ -17,3 +17,18 @@ ByteString >> email [ "Quick fix for importing Lepiter pages that have a plain ByteString field as email." ^ self ] + +{ #category : #'*MiniDocs' } +ByteString >> splitLines [ + "I'm useful for conversions between the HedgeDoc Markdown variant and Lepiter page snippets. + I provide broad places to where semantic breaks should be located in a page, + depending on headers or admonitions to create pages snippets with similar divisions. + Further page splits should be provided manually by the document author." + | response | + response := OrderedDictionary new. + response := response + addAll: self markdownHeaders; + addAll: self admonitionStartingLines; + yourself. + ^ (response associations sorted: [ :x :y | x key < y key ]) asOrderedDictionary +]