Text snippet
A text snippet, like this very one, supports an extensible Markdown.
Basic Markdown
Headers:
Header 1
Header 2
Header 3
Formatted text:
italic
bold
fixed size
Multi-line
fixed size text
Link:
Extensions
Lepiter is extensible. One extension mechanism is that of annotations.
Class reference:
LeParser
Method reference:
LePage>>#title
Example reference:
LeTextSnippetExamples>>#textSnippetWithLinkToPage <gtExample> | aPage aSnippet | aSnippet := LeTextSnippet string: (String loremIpsum: 100) allButLast, ' [[two]] ', (String loremIpsum: 100). aPage := self database pageBuilder title: 'one'; add. aPage addSnippet: aSnippet. self assert: aSnippet class equals: LeTextSnippet. ^ aSnippet
Page reference:
Parsing
The basic parser is LeParser
:
LeParser parse: '#Header ##Header 2 ###Header 3 ###Header 4 `fixed size` *italic* **bold** '
The annotation parser is LeAnnotationParser
, but it is composable with the basic parser. For example, explore the result of the code below and notice how there is a single abstract syntax tree that can be browsed uniformly:
LeParser parse: 'This is regular Markdown. But, this is annotation: {{gtExample:LeTextSnippetExamples>>textSnippetWithLinkToPage | noCode= false | previewHeight= 200 | previewExpanded= true}}'