From 9b800e5591b1b528d163bd3a54ececa66355515f Mon Sep 17 00:00:00 2001 From: Scharel Clemens Date: Wed, 12 Dec 2018 23:10:45 +0100 Subject: [PATCH] Added syntac page. --- qml/pages/AboutPage.qml | 2 +- qml/pages/EditPage.qml | 5 +- qml/pages/GPLLicense.qml | 2 +- qml/pages/LoginDialog.qml | 2 +- qml/pages/MITLicense.qml | 2 +- qml/pages/NotePage.qml | 2 +- qml/pages/NotesPage.qml | 1 + qml/pages/SettingsPage.qml | 2 +- qml/pages/SyntaxPage.qml | 438 +++++++++++++++++----- qml/pages/UnencryptedDialog.qml | 2 +- rpm/harbour-nextcloudnotes.changes | 8 +- rpm/harbour-nextcloudnotes.spec | 2 +- rpm/harbour-nextcloudnotes.yaml | 2 +- translations/harbour-nextcloudnotes-de.ts | 143 +++++++ translations/harbour-nextcloudnotes-sv.ts | 143 +++++++ translations/harbour-nextcloudnotes.ts | 230 ++++++++++-- 16 files changed, 856 insertions(+), 130 deletions(-) diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml index 11283d7..dac414f 100644 --- a/qml/pages/AboutPage.qml +++ b/qml/pages/AboutPage.qml @@ -7,7 +7,7 @@ Page { SilicaFlickable { id: flickable anchors.fill: parent - contentHeight: column.height + contentHeight: column.height + Theme.paddingLarge Column { id: column diff --git a/qml/pages/EditPage.qml b/qml/pages/EditPage.qml index 92c0443..b07eaa1 100644 --- a/qml/pages/EditPage.qml +++ b/qml/pages/EditPage.qml @@ -21,7 +21,7 @@ Dialog { SilicaFlickable { anchors.fill: parent - contentHeight: mainColumn.height + contentHeight: mainColumn.height + Theme.paddingLarge PullDownMenu { MenuItem { @@ -33,8 +33,7 @@ Dialog { } MenuItem { text: qsTr("Markdown syntax") - //onClicked: pageStack.push(Qt.resolvedUrl("SyntaxPage.qml")) //Qt.openUrlExternally("https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax") - onClicked: Qt.openUrlExternally("https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax") + onClicked: pageStack.push(Qt.resolvedUrl("SyntaxPage.qml")) } } diff --git a/qml/pages/GPLLicense.qml b/qml/pages/GPLLicense.qml index 000cb69..ff53929 100644 --- a/qml/pages/GPLLicense.qml +++ b/qml/pages/GPLLicense.qml @@ -7,7 +7,7 @@ Page { SilicaFlickable { id: flickable anchors.fill: parent - contentHeight: column.height + contentHeight: column.height + Theme.paddingLarge Column { id: column diff --git a/qml/pages/LoginDialog.qml b/qml/pages/LoginDialog.qml index 571afc8..dc19440 100644 --- a/qml/pages/LoginDialog.qml +++ b/qml/pages/LoginDialog.qml @@ -38,7 +38,7 @@ Dialog { SilicaFlickable { anchors.fill: parent - contentHeight: column.height + contentHeight: column.height + Theme.paddingLarge Column { id: column diff --git a/qml/pages/MITLicense.qml b/qml/pages/MITLicense.qml index b953752..6a91ee6 100644 --- a/qml/pages/MITLicense.qml +++ b/qml/pages/MITLicense.qml @@ -7,7 +7,7 @@ Page { SilicaFlickable { id: flickable anchors.fill: parent - contentHeight: column.height + contentHeight: column.height + Theme.paddingLarge Column { id: column diff --git a/qml/pages/NotePage.qml b/qml/pages/NotePage.qml index 59a7a2b..d84850c 100644 --- a/qml/pages/NotePage.qml +++ b/qml/pages/NotePage.qml @@ -69,7 +69,7 @@ Dialog { SilicaFlickable { anchors.fill: parent - contentHeight: mainColumn.height + contentHeight: mainColumn.height + Theme.paddingLarge Column { id: mainColumn diff --git a/qml/pages/NotesPage.qml b/qml/pages/NotesPage.qml index 4027b85..12bfc23 100644 --- a/qml/pages/NotesPage.qml +++ b/qml/pages/NotesPage.qml @@ -18,6 +18,7 @@ Page { SilicaListView { id: notesList anchors.fill: parent + spacing: Theme.paddingLarge PullDownMenu { busy: api.busy diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index 3d4e673..4731755 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -10,7 +10,7 @@ Page { SilicaFlickable { id: flickable anchors.fill: parent - contentHeight: column.height + contentHeight: column.height + Theme.paddingLarge PullDownMenu { MenuItem { diff --git a/qml/pages/SyntaxPage.qml b/qml/pages/SyntaxPage.qml index 5096f8a..dafff88 100644 --- a/qml/pages/SyntaxPage.qml +++ b/qml/pages/SyntaxPage.qml @@ -4,56 +4,25 @@ import Sailfish.Silica 1.0 Page { id: page - Component { - id: syntaxDrawer + SilicaFlickable { + id: mainFlickable + anchors.fill: parent + contentHeight: column.height + Theme.paddingLarge - 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 - } + PullDownMenu { + MenuItem { + text: qsTr("View more on the web") + onClicked: Qt.openUrlExternally("https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax") } - 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 - } + + MenuItem { + id: resetMenuItem + property bool allOpened: false + text: allOpened ? qsTr("Close previews") : + qsTr("Open previews") + onClicked: allOpened = !allOpened } } - } - - SilicaFlickable { - id: flickable - anchors.fill: parent - contentHeight: column.height Column { id: column @@ -63,34 +32,179 @@ Page { 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
" + property string title: qsTr("Paragraphs") + property string description: qsTr("Paragraphs in Showdown are just one or more lines of consecutive text followed by one or more blank lines.") + property string rawText: +"On July 2, an alien mothership entered Earth's orbit and deployed several dozen +saucer-shaped \"destroyer\" spacecraft, each 15 miles (24 km) wide. + +On July 3, the Black Knights, a squadron of Marine Corps F/A-18 Hornets, +participated in an assault on a destroyer near the city of Los Angeles." + property string convertedText: +"

On July 2, an alien mothership entered Earth's orbit and deployed several dozen
+saucer-shaped \"destroyer\" spacecraft, each 15 miles (24 km) wide.

+

On July 3, the Black Knights, a squadron of Marine Corps F/A-18 Hornets,
+participated in an assault on a destroyer near the city of Los Angeles.

" } - SectionHeader { - text: qsTr("Links") + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Headings") + property string description: qsTr("You can create a heading by adding one or more # symbols before your heading text. The number of # you use will determine the size of the heading.") + property string rawText: +"# The largest heading (an

tag) +## The second largest heading (an

tag) +### The third largest heading (an

tag) +#### The 4th largest heading (an

tag) +##### The 5th largest heading (an

tag) +###### The 6th largest heading (an
tag)" + property string convertedText: +"

The largest heading (an \<h1> tag)

+

The second largest heading (an \<h2> tag)

+

The third largest heading (an \<h3> tag)

+

The 4th largest heading (an \<h4> tag)

+
The 5th largest heading (an \<h5> tag)
+
The 6th largest heading (an \<h6> tag)
" } Loader { sourceComponent: syntaxDrawer - property string rawText: " -https://jolla.com + property string description: qsTr("If, for some reason, you need to keep a leading or trailing #, you can either add a space or escape it:") + property string rawText: +"# # My header # # +# \\# My Header \\# #" + property string convertedText: +"

# My header #

+

# My Header #

" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Blockquotes") + property string description: qsTr("You can indicate blockquotes with a >.") + property string rawText: +"In the words of Abraham Lincoln: + +> Pardon my french" + property string convertedText: +"

In the words of Abraham Lincoln:

+
+

Pardon my french

+
" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Bold and Italic") + property string description: qsTr("You can make text bold or italic.") + property string rawText: +"*This text will be italic* +**This text will be bold**" + property string convertedText: +"

This text will be italic
+This text will be bold

" + } + Loader { + sourceComponent: syntaxDrawer + property string description: qsTr("Both bold and italic can use either a * or an _ around the text for styling. This allows you to combine both bold and italic if needed.") + property string rawText: +"**Everyone _must_ attend the meeting at 5 o'clock today.**" + property string convertedText: +"

Everyone must attend the meeting at 5 o'clock today.

" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Strikethrough") + property string description: qsTr("The syntax is the same as GFM, that is, by adding two tilde (~~) characters around a word or groups of words.") + property string rawText: +"a ~~strikethrough~~ element" + property string convertedText: +"

a strikethrough element

" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Emojis") + property string description: qsTr("Since version 1.8.0, showdown supports github's emojis. A complete list of available emojis can be found here: https://github.com/showdownjs/showdown/wiki/emojis.") + property string rawText: +"this is a :smile: smile emoji" + property string convertedText: +"

this is a 🙂 smile emoji

" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Code formatting") + property string description: qsTr("Use single backticks (`) to format text in a special monospace format. Everything within the backticks appear as-is, with no other special formatting.") + property string rawText: +"Here's an idea: why don't we take `SuperiorProject` and turn it into `**Reasonable**Project`." + property string convertedText: +"

Here's an idea: why don't we take SuperiorProject and turn it into **Reasonable**Project.

" + } + Loader { + sourceComponent: syntaxDrawer + property string description: qsTr("To create blocks of code you should indent it by four spaces.") + property string rawText: +" this is a piece + of + code" + property string convertedText: +"
this is a piece
+of
+code
+
" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Lists") + property string description: qsTr("You can make an unordered list by preceding list items with either a *, a - or a +. Markers are interchangeable too.") + property string rawText: +"* Item ++ Item +- Item" + property string convertedText: +"" + } + Loader { + sourceComponent: syntaxDrawer + property string description: qsTr("You can make an ordered list by preceding list items with a number.") + property string rawText: +"1. Item 1 +2. Item 2 +3. Item 3" + property string convertedText: +"
    +
  1. Item 1
  2. +
  3. Item 2
  4. +
  5. Item 3
  6. +
" + } + Loader { + sourceComponent: syntaxDrawer + property string description: qsTr("TaskLists") + property string rawText: +"- [x] checked list item +- [ ] unchecked list item" + property string convertedText: +"" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Links") + property string description: qsTr("Showdown will automagically turn every valid URL it finds in the text body to links for you. In the case of email addreses, Showdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots.") + property string rawText: +"https://jolla.com info@jolla.com [Homepage - Jolla](https://jolla.com) [Link to Jolla][1] @@ -98,40 +212,186 @@ info@jolla.com [1]: https://jolla.com [jolla]: https://jolla.com" - property string convertedText: " -https://jolla.com
-info@jolla.com
-Homepage - Jolla
-Homepage - Jolla
-Homepage - Jolla" + property string convertedText: +"

https://jolla.com
+info@jolla.com
+Homepage - Jolla
+Link to Jolla
+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: " - + property string title: qsTr("Images") + property string description: qsTr("Markdown uses an image syntax that is intended to resemble the syntax for links, also allowing for two styles: inline and reference.") + property string rawText: +"![Alt text](https://cloud.scharel.name/s/harbour-nextcloudnotes/download?path=/&files=nextcloud-logo-transparent.png \"Optional title\") +![Alt text][img] + +[img]: +data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAABWCAYAAABVVmH3AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAWfUlEQVR4nOWdeXQbx33Hv7OLxX2QBMELBCkeoiiRFHVaimVdvi07TmMnTZPYytH4JU1eXpvXlyZu+9o4TXM4sZs4R1/cxHlJ49px0tSX4luyI8mSLMkSJUoiKV4gQRAESRzEjQVm+gcACgSBBUiCZNz+/lrszO+YDwezs7+ZAQn+hIQxJvN4PBYA9RzH1TLGDIQQNSFEDUADQJapw3Fc1mtCSEE+c+lL1ctz3wngicK8L5N4vV5jLB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m6g0zE0BSo3ZKwWXEPJCTU3NM1mdZcjsvq2lDObZ9BljODkwoX/u3cGqYDQ2u3wiUkpSPTclRp0yYi7Vhg/esN5uMerm/QTJcp7myVYvh/7R6urqb2R1kkWyzgoKCSxX4xiAM0NO3ZtXbEabO6CaZzBNGk364PvW1ri3N1X6BI5jS4GzzHC7zGbzVwkh2b/eWSTnrKCQwIBEys8xE5SPTvuVNpdfednu0nlCiSWWTOEAWIy64IaaUv+WhgpfdYk2CqBocJYJbpfP5/sSIWTe25WUyJJjh5ThOfejcUqOXbGXjHsDSrvbr5z0RRQxSucopOur5bJ4g0kfaDcb/ZvqTX6NQhbPZVvKf2bZCsE9muypC4IK5BhjpeBSysiLXcNV8wqTYtQooxajNtRcWRJsqSwJVhpUOY+pLxecYsCllD5vsVj+dSFf/3TJOcbmCk4h46hcxtFojHJKgad6pVysLdOGmisNwdbq0oAx7UDxUt/QVglulBDyA4vFUtDTP5fIFjOY/+1tmwZ1KiGuTC6VLOfr70rCZYzZ4vH4gw0NDXnnqflEcuNxts8AUK5ViAqem1VazXxuMfQJIZRS+rxcLr+vGFCBtKFgOZMWf8o9l1LaJwjCdywWy4WsFRYpBW08zvY52/33Us8lhEwxxr77y1/+8v5iQwWyzAr+H/RcB8dxv/L5fM9ly/wXS/LmY/8vwAVAAZxljB2yWq2v7N+/P+uvdhRTCsrHvhfhkkSGvw/A64yxl5qbm51ZFZZJZEj8j795gQHvObgigBEA5wghpymlZ1paWmawSiKTyWRPiKJIAcxmnBib+2tG6XDSRaosHUAuHSn9dEmbZ4qEkABjLEgICTLGvIyxUY7jrE8++aQ91/rTasj/Andxq7VOKfFFAAAAAElFTkSuQmCC \"Optional title\"" + property string convertedText: +"

\"Alt
+\"Alt

" + } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("Tables") + property string description: qsTr("Tables aren't part of the core Markdown spec, but they are part of GFM and Showdown supports them by turning on the option tables. + +Colons can be used to align columns. + +In the new version, the outer pipes (|) are optional, matching GFM spec. + +You also don't need to make the raw Markdown line up prettily. + +You can also use other markdown syntax inside them.") + property string rawText: +"| Tables | Are | Cool | +| ------------- |:-------------:| -----:| +| **col 3 is** | right-aligned | $1600 | +| col 2 is | *centered* | $12 | +| zebra stripes | ~~are neat~~ | $1 |" + property string convertedText: +"
- + + + + + - - - + + + + + + + + + + + + + + +
Header 1Header 2Header 3
TablesAreCool
Content 1.1Content 2.1Content 3.1
Content 1.2Content 2.2Content 3.2
Content 1.3Content 2.3Content 3.3
col 3 isright-aligned$1600
col 2 iscentered$12
zebra stripesare neat$1
" } + + Loader { + sourceComponent: syntaxDrawer + property string title: qsTr("HTML") + property string description: qsTr("In most cases, HTML tags are leaved untouched in the output document.") + property string rawText: +"some markdown **here** +
this is *not* **parsed**
+Use HTML Tags to format your text." + property string convertedText: +"

some markdown here

+
this is *not* **parsed**
+

Use HTML Tags to format your text.

" + } } - VerticalScrollDecorator {} + VerticalScrollDecorator { flickable: mainFlickable } + } + + Component { + id: syntaxDrawer + + Column { + width: page.width + + SectionHeader { + text: title + } + + Label { + x: Theme.horizontalPageMargin + width: parent.width - 2*x + bottomPadding: Theme.paddingLarge + wrapMode: Text.Wrap + color: Theme.secondaryColor + text: description + } + Separator { + width: parent.width + color: Theme.primaryColor + horizontalAlignment: Qt.AlignLeft + } + Drawer { + id: drawer + width: parent.width + height: rawTextLabel.height + 2*Theme.paddingLarge > 2*Theme.itemSizeHuge ? 2*Theme.itemSizeHuge : rawTextLabel.height + 2*Theme.paddingLarge + backgroundSize: height + hideOnMinimize: true + dock: Dock.Bottom + + Connections { + target: resetMenuItem + onAllOpenedChanged: resetMenuItem.allOpened ? drawer.show() : drawer.hide() + } + + foreground: SilicaFlickable { + id: rawTextFlickable + anchors.fill: parent + contentWidth: parent.width > rawTextLabel.contentWidth ? parent.width : rawTextLabel.contentWidth + 2*Theme.horizontalPageMargin + contentHeight: parent.height > rawTextLabel.height ? parent.height : rawTextLabel.height + BackgroundItem { + anchors.fill: parent + onClicked: drawer.show() + Label { + id: rawTextLabel + x: Theme.horizontalPageMargin + y: Theme.paddingLarge + color: parent.highlighted ? Theme.highlightColor : Theme.primaryColor + font.family: appSettings.useMonoFont ? "DejaVu Sans Mono" : Theme.fontFamily + textFormat: Text.PlainText + text: rawText + } + } + ScrollDecorator { /*flickable: rawTextFlickable*/ } + } + + background: SilicaFlickable { + id: convertedTextFlickable + anchors.fill: parent + contentWidth: parent.width > convertedTextLabel.contentWidth ? parent.width : convertedTextLabel.contentWidth + 2*Theme.horizontalPageMargin + contentHeight: parent.height > convertedTextLabel.height ? parent.height : convertedTextLabel.height + 2*Theme.paddingLarge + BackgroundItem { + anchors.fill: parent + onClicked: drawer.hide() + LinkedLabel { + id: convertedTextLabel + x: Theme.horizontalPageMargin + y: Theme.paddingLarge + textFormat: Text.RichText + linkColor: Theme.primaryColor + defaultLinkActions: false + onLinkActivated: drawer.hide() + text: "\n" + convertedText + } + } + ScrollDecorator { /*flickable: convertedTextFlickable*/ } + } + } + Separator { + width: parent.width + color: Theme.primaryColor + horizontalAlignment: Qt.AlignRight + } + } } allowedOrientations: defaultAllowedOrientations diff --git a/qml/pages/UnencryptedDialog.qml b/qml/pages/UnencryptedDialog.qml index c5f49f8..17d81f9 100644 --- a/qml/pages/UnencryptedDialog.qml +++ b/qml/pages/UnencryptedDialog.qml @@ -8,7 +8,7 @@ Dialog { SilicaFlickable { anchors.fill: parent - contentHeight: column.height + contentHeight: column.height + Theme.paddingLarge Column { id: column diff --git a/rpm/harbour-nextcloudnotes.changes b/rpm/harbour-nextcloudnotes.changes index 075dba4..22c9fb4 100644 --- a/rpm/harbour-nextcloudnotes.changes +++ b/rpm/harbour-nextcloudnotes.changes @@ -12,11 +12,15 @@ # * date Author's Name version-release # - Summary of changes -* Mon Dec 11 2018 Scharel Clemens 0.2-6 +* Wed Dec 12 2018 Scharel Clemens 0.2-7 +- Implementing #18: Page with Markdown syntax +- Added padding to the bottom of the pages + +* Mon Dec 10 2018 Scharel Clemens 0.2-6 - Changed #34: "Do not underline lines with tick boxes" - Began implementing #18: Page with Markdown syntax (not yet included in the build) -* Mon Dec 11 2018 Scharel Clemens 0.2-5 +* Mon Dec 10 2018 Scharel Clemens 0.2-5 - Fixed an issue that prevented to edit accounts * Mon Dec 10 2018 Scharel Clemens 0.2-4 diff --git a/rpm/harbour-nextcloudnotes.spec b/rpm/harbour-nextcloudnotes.spec index 7b745e9..57607a3 100644 --- a/rpm/harbour-nextcloudnotes.spec +++ b/rpm/harbour-nextcloudnotes.spec @@ -14,7 +14,7 @@ Name: harbour-nextcloudnotes %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: Nextcloud Notes Version: 0.2 -Release: 6 +Release: 7 Group: Applications/Editors License: MIT URL: https://github.com/scharel/harbour-nextcloudnotes diff --git a/rpm/harbour-nextcloudnotes.yaml b/rpm/harbour-nextcloudnotes.yaml index 3aa2b38..fa5fc4e 100644 --- a/rpm/harbour-nextcloudnotes.yaml +++ b/rpm/harbour-nextcloudnotes.yaml @@ -1,7 +1,7 @@ Name: harbour-nextcloudnotes Summary: Nextcloud Notes Version: 0.2 -Release: 6 +Release: 7 # The contents of the Group field should be one of the groups listed here: # https://github.com/mer-tools/spectacle/blob/master/data/GROUPS Group: Applications/Editors diff --git a/translations/harbour-nextcloudnotes-de.ts b/translations/harbour-nextcloudnotes-de.ts index 7118e03..6ea51b6 100644 --- a/translations/harbour-nextcloudnotes-de.ts +++ b/translations/harbour-nextcloudnotes-de.ts @@ -415,6 +415,149 @@ Glückwunsch, du hast die Antwort auf die Frage nach dem Leben, dem Universum und dem ganzen Rest gefunden! + + SyntaxPage + + Markdown Syntax + + + + Links + + + + Tables + + + + View more on the web + + + + Close previews + + + + Open previews + + + + Paragraphs + + + + Paragraphs in Showdown are just one or more lines of consecutive text followed by one or more blank lines. + + + + Headings + + + + You can create a heading by adding one or more # symbols before your heading text. The number of # you use will determine the size of the heading. + + + + If, for some reason, you need to keep a leading or trailing #, you can either add a space or escape it: + + + + Blockquotes + + + + You can indicate blockquotes with a >. + + + + Bold and Italic + + + + You can make text bold or italic. + + + + Both bold and italic can use either a * or an _ around the text for styling. This allows you to combine both bold and italic if needed. + + + + Strikethrough + + + + The syntax is the same as GFM, that is, by adding two tilde (~~) characters around a word or groups of words. + + + + Emojis + + + + Since version 1.8.0, showdown supports github's emojis. A complete list of available emojis can be found here: https://github.com/showdownjs/showdown/wiki/emojis. + + + + Code formatting + + + + Use single backticks (`) to format text in a special monospace format. Everything within the backticks appear as-is, with no other special formatting. + + + + To create blocks of code you should indent it by four spaces. + + + + Lists + + + + You can make an unordered list by preceding list items with either a *, a - or a +. Markers are interchangeable too. + + + + You can make an ordered list by preceding list items with a number. + + + + TaskLists + + + + Showdown will automagically turn every valid URL it finds in the text body to links for you. In the case of email addreses, Showdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. + + + + Images + + + + Markdown uses an image syntax that is intended to resemble the syntax for links, also allowing for two styles: inline and reference. + + + + HTML + + + + In most cases, HTML tags are leaved untouched in the output document. + + + + Tables aren't part of the core Markdown spec, but they are part of GFM and Showdown supports them by turning on the option tables. + +Colons can be used to align columns. + +In the new version, the outer pipes (|) are optional, matching GFM spec. + +You also don't need to make the raw Markdown line up prettily. + +You can also use other markdown syntax inside them. + + + UnencryptedDialog diff --git a/translations/harbour-nextcloudnotes-sv.ts b/translations/harbour-nextcloudnotes-sv.ts index 93f9f58..dd4e777 100644 --- a/translations/harbour-nextcloudnotes-sv.ts +++ b/translations/harbour-nextcloudnotes-sv.ts @@ -415,6 +415,149 @@ Grattulerar! Du har funnit svaret på den ultimata frågan om livet, universum och allt! + + SyntaxPage + + Markdown Syntax + + + + Links + + + + Tables + + + + View more on the web + + + + Close previews + + + + Open previews + + + + Paragraphs + + + + Paragraphs in Showdown are just one or more lines of consecutive text followed by one or more blank lines. + + + + Headings + + + + You can create a heading by adding one or more # symbols before your heading text. The number of # you use will determine the size of the heading. + + + + If, for some reason, you need to keep a leading or trailing #, you can either add a space or escape it: + + + + Blockquotes + + + + You can indicate blockquotes with a >. + + + + Bold and Italic + + + + You can make text bold or italic. + + + + Both bold and italic can use either a * or an _ around the text for styling. This allows you to combine both bold and italic if needed. + + + + Strikethrough + + + + The syntax is the same as GFM, that is, by adding two tilde (~~) characters around a word or groups of words. + + + + Emojis + + + + Since version 1.8.0, showdown supports github's emojis. A complete list of available emojis can be found here: https://github.com/showdownjs/showdown/wiki/emojis. + + + + Code formatting + + + + Use single backticks (`) to format text in a special monospace format. Everything within the backticks appear as-is, with no other special formatting. + + + + To create blocks of code you should indent it by four spaces. + + + + Lists + + + + You can make an unordered list by preceding list items with either a *, a - or a +. Markers are interchangeable too. + + + + You can make an ordered list by preceding list items with a number. + + + + TaskLists + + + + Showdown will automagically turn every valid URL it finds in the text body to links for you. In the case of email addreses, Showdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. + + + + Images + + + + Markdown uses an image syntax that is intended to resemble the syntax for links, also allowing for two styles: inline and reference. + + + + HTML + + + + In most cases, HTML tags are leaved untouched in the output document. + + + + Tables aren't part of the core Markdown spec, but they are part of GFM and Showdown supports them by turning on the option tables. + +Colons can be used to align columns. + +In the new version, the outer pipes (|) are optional, matching GFM spec. + +You also don't need to make the raw Markdown line up prettily. + +You can also use other markdown syntax inside them. + + + UnencryptedDialog diff --git a/translations/harbour-nextcloudnotes.ts b/translations/harbour-nextcloudnotes.ts index e9851a0..d2eec55 100644 --- a/translations/harbour-nextcloudnotes.ts +++ b/translations/harbour-nextcloudnotes.ts @@ -186,52 +186,52 @@ NotePage - + Delete - + Reload - + Updating... - + Last update - + never - + Edit - + Notes - + No category - + Category - + Modified @@ -252,87 +252,87 @@ NotesPage - + Settings - + Add note - + Reload - + Updating... - + Last update - + never - + Modified - + Delete - + Deleting note - + No account yet - + Got to the settings to add an account - + No notes yet - + Pull down to add a note - + No result - + Try another query - + An error occurred - + Open the settings to configure your Nextcloud accounts @@ -510,6 +510,182 @@ + + SyntaxPage + + + Markdown Syntax + + + + + View more on the web + + + + + Close previews + + + + + Open previews + + + + + Paragraphs + + + + + Paragraphs in Showdown are just one or more lines of consecutive text followed by one or more blank lines. + + + + + Headings + + + + + You can create a heading by adding one or more # symbols before your heading text. The number of # you use will determine the size of the heading. + + + + + If, for some reason, you need to keep a leading or trailing #, you can either add a space or escape it: + + + + + Blockquotes + + + + + You can indicate blockquotes with a >. + + + + + Bold and Italic + + + + + You can make text bold or italic. + + + + + Both bold and italic can use either a * or an _ around the text for styling. This allows you to combine both bold and italic if needed. + + + + + Strikethrough + + + + + The syntax is the same as GFM, that is, by adding two tilde (~~) characters around a word or groups of words. + + + + + Emojis + + + + + Since version 1.8.0, showdown supports github's emojis. A complete list of available emojis can be found here: https://github.com/showdownjs/showdown/wiki/emojis. + + + + + Code formatting + + + + + Use single backticks (`) to format text in a special monospace format. Everything within the backticks appear as-is, with no other special formatting. + + + + + To create blocks of code you should indent it by four spaces. + + + + + Lists + + + + + You can make an unordered list by preceding list items with either a *, a - or a +. Markers are interchangeable too. + + + + + You can make an ordered list by preceding list items with a number. + + + + + TaskLists + + + + + Links + + + + + Showdown will automagically turn every valid URL it finds in the text body to links for you. In the case of email addreses, Showdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. + + + + + Images + + + + + Markdown uses an image syntax that is intended to resemble the syntax for links, also allowing for two styles: inline and reference. + + + + + Tables + + + + + Tables aren't part of the core Markdown spec, but they are part of GFM and Showdown supports them by turning on the option tables. + +Colons can be used to align columns. + +In the new version, the outer pipes (|) are optional, matching GFM spec. + +You also don't need to make the raw Markdown line up prettily. + +You can also use other markdown syntax inside them. + + + + + HTML + + + + + In most cases, HTML tags are leaved untouched in the output document. + + + UnencryptedDialog