import QtQuick 2.0 import Sailfish.Silica 1.0 Page { id: page Component { id: syntaxDrawer Drawer { id: drawer width: page.width height: rawTextLabel.height > convertedTextLabel.height ? rawTextLabel.height : convertedTextLabel.height backgroundSize: height foreground: BackgroundItem { width: parent.width height: parent.height onClicked: drawer.show() Label { id: rawTextLabel x: Theme.horizontalPageMargin width: parent.width - 2*x wrapMode: Text.Wrap font.family: appSettings.useMonoFont ? "DejaVu Sans Mono" : Theme.fontFamily text: rawText } } background: BackgroundItem { width: parent.width height: parent.height onClicked: drawer.hide() LinkedLabel { id: convertedTextLabel x: Theme.horizontalPageMargin width: parent.width - 2*x textFormat: Text.RichText linkColor: Theme.primaryColor defaultLinkActions: false onLinkActivated: drawer.hide() text: "\n" + convertedText } } } } SilicaFlickable { id: flickable anchors.fill: parent contentHeight: column.height Column { id: column width: parent.width PageHeader { title: qsTr("Markdown Syntax") } SectionHeader { text: qsTr("Header") } Loader { sourceComponent: syntaxDrawer property string rawText: " # Header 1 ## Header 2 ### Header 3 #### Header 4 ##### Header 5 ###### Header 6"; property string convertedText: "

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6
" } SectionHeader { text: qsTr("Links") } Loader { sourceComponent: syntaxDrawer property string rawText: " https://jolla.com info@jolla.com [Homepage - Jolla](https://jolla.com) [Link to Jolla][1] [jolla][] [1]: https://jolla.com [jolla]: https://jolla.com" property string convertedText: " https://jolla.com
info@jolla.com
Homepage - Jolla
Homepage - Jolla
Homepage - Jolla" } SectionHeader { text: qsTr("Tables") } Loader { sourceComponent: syntaxDrawer property string rawText: " |Header 1 |Header 2 |Header 3 | |:-----------|:----------:|-----------:| |Content 1.1 |Content 2.1 |Content 3.1 | |Content 1.2 |Content 2.2 |Content 3.2 | |Content 1.3 |Content 2.3 |Content 3.3 |" property string convertedText: "
Header 1Header 2Header 3
Content 1.1Content 2.1Content 3.1
Content 1.2Content 2.2Content 3.2
Content 1.3Content 2.3Content 3.3
" } } VerticalScrollDecorator {} } allowedOrientations: defaultAllowedOrientations }