├── fontawesomeicon
├── fontawesomeicon.json
├── fontawesome.ttf
├── fontawesomeicon.qrc
└── fontawesomeicon.pro
├── app
├── app-icon.icns
├── app-icon.ico
├── cutemarked.rc
├── images
│ └── icon-close.png
├── icons
│ ├── 128x128
│ │ └── cutemarked.png
│ ├── 16x16
│ │ └── cutemarked.png
│ ├── 22x22
│ │ └── cutemarked.png
│ ├── 32x32
│ │ └── cutemarked.png
│ ├── 48x48
│ │ └── cutemarked.png
│ ├── 64x64
│ │ └── cutemarked.png
│ └── COPYING
├── scripts
│ └── highlight.js
│ │ ├── styles
│ │ ├── pojoaque.jpg
│ │ ├── school_book.png
│ │ ├── brown_papersq.png
│ │ ├── ascetic.css
│ │ ├── mono-blue.css
│ │ ├── tomorrow.css
│ │ ├── paraiso.dark.css
│ │ ├── paraiso.light.css
│ │ ├── vs.css
│ │ ├── kimbie.dark.css
│ │ ├── kimbie.light.css
│ │ ├── tomorrow-night-bright.css
│ │ ├── tomorrow-night-eighties.css
│ │ ├── tomorrow-night.css
│ │ ├── tomorrow-night-blue.css
│ │ ├── rainbow.css
│ │ ├── ir_black.css
│ │ ├── codepen-embed.css
│ │ ├── atelier-dune.dark.css
│ │ ├── atelier-dune.light.css
│ │ ├── atelier-heath.dark.css
│ │ ├── atelier-forest.dark.css
│ │ ├── atelier-heath.light.css
│ │ ├── atelier-forest.light.css
│ │ ├── atelier-seaside.dark.css
│ │ ├── solarized_dark.css
│ │ └── solarized_light.css
│ │ └── LICENSE
├── template.html
├── cutemarked.desktop
├── controls
│ ├── fileexplorerwidget.h
│ ├── fileexplorerwidget.ui
│ ├── linenumberarea.cpp
│ ├── activelabel.h
│ ├── linenumberarea.h
│ ├── activelabel.cpp
│ ├── languagemenu.h
│ ├── recentfilesmenu.h
│ └── fileexplorerwidget.cpp
├── translations.qrc
├── Info.plist
├── themes
│ ├── solarized-dark.txt
│ ├── solarized-light.txt
│ ├── byword-dark.txt
│ ├── default.txt
│ ├── clearness-dark.txt
│ ├── clearness-dark+.txt
│ ├── default+.txt
│ ├── byword-dark+.txt
│ ├── solarized-dark+.txt
│ └── solarized-light+.txt
├── aboutdialog.h
├── styles
│ ├── clearness-dark.css
│ └── clearness.css
├── imagetooldialog.h
├── exportpdfdialog.h
├── exporthtmldialog.h
├── htmlhighlighter.h
├── highlightworkerthread.h
├── hunspell
│ ├── spellchecker.h
│ └── spellchecker_win.cpp
├── snippetcompleter.h
├── aboutdialog.cpp
├── template_presentation.html
├── builtin-htmlpreview-themes.json
├── markdownmanipulator.h
├── tabletooldialog.h
├── optionsdialog.h
├── imagetooldialog.cpp
├── snippetstablemodel.h
└── markdownhighlighter.h
├── test
├── test.pro
├── unit
│ ├── completionlistmodeltest.h
│ ├── dictionarytest.h
│ ├── snippettest.h
│ ├── jsontranslatorfactorytest.h
│ ├── themetest.h
│ ├── stylemanagertest.h
│ ├── slidelinemappingtest.h
│ ├── yamlheadercheckertest.h
│ ├── themecollectiontest.h
│ ├── jsonthemetranslatortest.h
│ ├── jsonsnippettranslatortest.h
│ ├── jsontranslatorfactorytest.cpp
│ ├── snippetcollectiontest.h
│ ├── dictionarytest.cpp
│ └── snippettest.cpp
└── integration
│ ├── htmltemplatetest.h
│ ├── jsonthemefiletest.h
│ ├── themecollectiontest.h
│ ├── jsonsnippetfiletest.h
│ ├── revealmarkdownconvertertest.h
│ ├── htmlpreviewcontrollertest.h
│ ├── pmhmarkdownparsertest.h
│ ├── hoedownmarkdownconvertertest.h
│ ├── discountmarkdownconvertertest.h
│ └── themecollectiontest.cpp
├── libs
├── libs.pro
├── jsonconfig
│ ├── jsontranslatorfactory.h
│ └── jsoncollection.h
└── peg-markdown-highlight
│ ├── definitions.h
│ ├── styleparser.h
│ ├── pmhmarkdownparser.h
│ ├── peg-markdown-highlight.pro
│ └── pmhmarkdownparser.cpp
├── .gitmodules
├── 3rdparty
├── 3rdparty.pro
└── peg-markdown-highlight
│ └── peg-markdown-highlight.pro
├── appveyor.yml
├── CuteMarkEd.pro
├── .gitattributes
├── app-static
├── converter
│ ├── revealmarkdownconverter.h
│ ├── revealmarkdownconverter.cpp
│ └── markdowndocument.h
├── viewsynchronizer.cpp
├── datalocation.h
├── themes
│ ├── jsonthemetranslator.h
│ ├── jsonthemetranslatorfactory.h
│ ├── stylemanager.h
│ ├── themecollection.h
│ ├── themecollection.cpp
│ ├── theme.cpp
│ ├── theme.h
│ └── jsonthemetranslator.cpp
├── yamlheaderchecker.h
├── snippets
│ ├── jsonsnippettranslator.h
│ ├── jsonsnippettranslatorfactory.h
│ ├── snippet.h
│ ├── snippetcollection.h
│ └── jsonsnippettranslator.cpp
├── viewsynchronizer.h
├── template
│ └── presentationtemplate.h
├── datalocation.cpp
├── htmlviewsynchronizer.h
├── spellchecker
│ ├── dictionary.h
│ └── dictionary.cpp
├── completionlistmodel.h
├── slidelinemapping.h
├── yamlheaderchecker.cpp
├── htmlpreviewcontroller.h
└── revealviewsynchronizer.h
└── .travis.yml
/fontawesomeicon/fontawesomeicon.json:
--------------------------------------------------------------------------------
1 | {
2 | "Keys" : [ "fontawesome" ]
3 | }
4 |
--------------------------------------------------------------------------------
/app/app-icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/app-icon.icns
--------------------------------------------------------------------------------
/app/app-icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/app-icon.ico
--------------------------------------------------------------------------------
/app/cutemarked.rc:
--------------------------------------------------------------------------------
1 | IDI_ICON1 ICON DISCARDABLE "app-icon.ico"
2 |
--------------------------------------------------------------------------------
/test/test.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = subdirs
2 |
3 | SUBDIRS += \
4 | unit \
5 | integration
6 |
--------------------------------------------------------------------------------
/libs/libs.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = subdirs
2 |
3 | SUBDIRS += \
4 | peg-markdown-highlight
5 |
6 |
--------------------------------------------------------------------------------
/app/images/icon-close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/images/icon-close.png
--------------------------------------------------------------------------------
/app/icons/128x128/cutemarked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/icons/128x128/cutemarked.png
--------------------------------------------------------------------------------
/app/icons/16x16/cutemarked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/icons/16x16/cutemarked.png
--------------------------------------------------------------------------------
/app/icons/22x22/cutemarked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/icons/22x22/cutemarked.png
--------------------------------------------------------------------------------
/app/icons/32x32/cutemarked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/icons/32x32/cutemarked.png
--------------------------------------------------------------------------------
/app/icons/48x48/cutemarked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/icons/48x48/cutemarked.png
--------------------------------------------------------------------------------
/app/icons/64x64/cutemarked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/icons/64x64/cutemarked.png
--------------------------------------------------------------------------------
/fontawesomeicon/fontawesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/fontawesomeicon/fontawesome.ttf
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/pojoaque.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/scripts/highlight.js/styles/pojoaque.jpg
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/school_book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/scripts/highlight.js/styles/school_book.png
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/brown_papersq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RDFS/CuteMarkEd/develop/app/scripts/highlight.js/styles/brown_papersq.png
--------------------------------------------------------------------------------
/fontawesomeicon/fontawesomeicon.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | fontawesome.ttf
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/icons/COPYING:
--------------------------------------------------------------------------------
1 | Application icon is modified version of work from http://www.oxygen-icons.org/ (License LGPL-3.0)
2 | and from https://github.com/dcurtis/markdown-mark (License CC0 Universal Public Domain Dedication).
--------------------------------------------------------------------------------
/app/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "3rdparty/discount"]
2 | path = 3rdparty/discount
3 | url = https://github.com/cloose/discount.git
4 | [submodule "3rdparty/hunspell"]
5 | path = 3rdparty/hunspell
6 | url = https://github.com/cloose/hunspell-mingw.git
7 | [submodule "3rdparty/hoedown"]
8 | path = 3rdparty/hoedown
9 | url = https://github.com/cloose/hoedown.git
10 |
--------------------------------------------------------------------------------
/3rdparty/3rdparty.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = subdirs
2 |
3 | SUBDIRS += \
4 | peg-markdown-highlight
5 |
6 | win32 {
7 | SUBDIRS += \
8 | discount \
9 | hunspell
10 |
11 | with_hoedown {
12 | message("3rdparty: Build hoedown markdown converter library")
13 | DEFINES += ENABLE_HOEDOWN
14 | SUBDIRS += hoedown
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/3rdparty/peg-markdown-highlight/peg-markdown-highlight.pro:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------
2 | #
3 | # Project created by QtCreator 2013-04-24T19:50:18
4 | #
5 | #-------------------------------------------------
6 |
7 | QT -= core gui
8 |
9 | TARGET = pmh
10 | TEMPLATE = lib
11 | CONFIG += staticlib
12 |
13 | SOURCES += \
14 | pmh_parser.cpp \
15 | pmh_styleparser.cpp
16 |
17 | HEADERS += \
18 | pmh_styleparser.h \
19 | pmh_parser.h \
20 | pmh_definitions.h
21 |
22 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | os: MinGW
2 |
3 | branches:
4 | except:
5 | - gh-pages
6 |
7 | environment:
8 | QTDIR: C:\Qt\5.4\mingw491_32
9 | MINGW_DIR: C:\Qt\Tools\mingw491_32
10 |
11 | install:
12 | - set PATH=%PATH%;%QTDIR%\bin;%MINGW_DIR%\bin
13 | - git submodule update --init --recursive
14 |
15 | before_build:
16 | - mkdir build
17 | - cd build
18 | - qmake ..\CuteMarkEd.pro
19 |
20 | build_script:
21 | - mingw32-make
22 |
23 | test_script:
24 | - cd test\unit
25 | - mingw32-make check
26 |
--------------------------------------------------------------------------------
/CuteMarkEd.pro:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------
2 | #
3 | # Project created by QtCreator 2013-03-16T11:40:15
4 | #
5 | #-------------------------------------------------
6 |
7 | TEMPLATE = subdirs
8 |
9 | CONFIG += c++11
10 |
11 | SUBDIRS = \
12 | 3rdparty \
13 | libs \
14 | app-static \
15 | app \
16 | fontawesomeicon \
17 | test
18 |
19 | # build order: 3rdparty -> libs -> app-static -> app & test
20 | libs.depends = 3rdparty
21 | app.depends = libs app-static
22 | test.depends = libs app-static
23 |
--------------------------------------------------------------------------------
/app/cutemarked.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=Application
3 | Version=1.0
4 | Name=CuteMarkEd
5 | GenericName=Markdown Editor
6 | GenericName[fr]=Éditeur de documents en Markdown
7 | GenericName[pl]=Edytor Markdown
8 | Comment=Editor for Markdown documents with live HTML preview
9 | Comment[fr]=Éditeur de documents en Markdown avec prévisualisation du rendu HTML
10 | Comment[pl]=Edytor dokumentów Markdown z podglądem HTML na żywo
11 | Icon=cutemarked
12 | Terminal=false
13 | Exec=cutemarked %f
14 | MimeType=text/markdown;
15 | Categories=Qt;Utility;TextEditor;
16 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/app-static/converter/revealmarkdownconverter.h:
--------------------------------------------------------------------------------
1 | #ifndef REVEALMARKDOWNCONVERTER_H
2 | #define REVEALMARKDOWNCONVERTER_H
3 |
4 | #include "markdownconverter.h"
5 |
6 | class RevealMarkdownConverter : public MarkdownConverter
7 | {
8 | public:
9 | RevealMarkdownConverter();
10 |
11 | virtual MarkdownDocument *createDocument(const QString &text, ConverterOptions options);
12 | virtual QString renderAsHtml(MarkdownDocument *document);
13 | virtual QString renderAsTableOfContents(MarkdownDocument *document);
14 |
15 | virtual Template *templateRenderer() const;
16 |
17 | virtual ConverterOptions supportedOptions() const;
18 | };
19 |
20 | #endif // REVEALMARKDOWNCONVERTER_H
21 |
--------------------------------------------------------------------------------
/test/unit/completionlistmodeltest.h:
--------------------------------------------------------------------------------
1 | #ifndef COMPLETIONLISTMODELTEST_H
2 | #define COMPLETIONLISTMODELTEST_H
3 |
4 | #include
5 |
6 | struct Snippet;
7 | class CompletionListModel;
8 |
9 |
10 | class CompletionListModelTest : public QObject
11 | {
12 | Q_OBJECT
13 |
14 | private slots:
15 | void acceptsNewSnippet();
16 | void updatesCorrectRowForSnippet();
17 | void removesCorrectRowForSnippet();
18 | void holdsSnippetsInTriggerOrder();
19 |
20 | private:
21 | void assertItemMatchesSnippet(int row, const Snippet &snippet);
22 | QVariant itemValue(int row, int role);
23 |
24 | private:
25 | CompletionListModel *model;
26 | };
27 |
28 | #endif // COMPLETIONLISTMODELTEST_H
29 |
--------------------------------------------------------------------------------
/app/controls/fileexplorerwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef FILEEXPLORERWIDGET_H
2 | #define FILEEXPLORERWIDGET_H
3 |
4 | #include
5 |
6 | namespace Ui {
7 | class FileExplorerWidget;
8 | }
9 | class QFileSystemModel;
10 | class QSortFilterProxyModel;
11 |
12 |
13 | class FileExplorerWidget : public QWidget
14 | {
15 | Q_OBJECT
16 |
17 | public:
18 | explicit FileExplorerWidget(QWidget *parent = 0);
19 | ~FileExplorerWidget();
20 |
21 | signals:
22 | void fileSelected(const QString &filePath);
23 |
24 | private slots:
25 | void fileOpen(const QModelIndex &index);
26 |
27 | private:
28 | Ui::FileExplorerWidget *ui;
29 | QFileSystemModel *model;
30 | QSortFilterProxyModel *sortModel;
31 | };
32 |
33 | #endif // FILEEXPLORERWIDGET_H
34 |
--------------------------------------------------------------------------------
/app/translations.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | translations/cutemarked_cs.qm
4 | translations/cutemarked_da.qm
5 | translations/cutemarked_de.qm
6 | translations/cutemarked_el.qm
7 | translations/cutemarked_es.qm
8 | translations/cutemarked_fr.qm
9 | translations/cutemarked_hu_HU.qm
10 | translations/cutemarked_id.qm
11 | translations/cutemarked_ja.qm
12 | translations/cutemarked_pl.qm
13 | translations/cutemarked_pt_BR.qm
14 | translations/cutemarked_ru.qm
15 | translations/cutemarked_zh_CN.qm
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleName
6 | CuteMarkEd
7 | CFBundleIconFile
8 | app-icon.icns
9 | CFBundlePackageType
10 | APPL
11 | CFBundleShortVersionString
12 | 0.11.2
13 | CFBundleSignature
14 | CMDE
15 | CFBundleExecutable
16 | cutemarked
17 | CFBundleIdentifier
18 | io.github.cloose.CuteMarkEd
19 | NSPrincipalClass
20 | NSApplication
21 | NSHighResolutionCapable
22 | True
23 | NSHumanReadableCopyright
24 | © 2013-2016 Christian Loose
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app-static/viewsynchronizer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Andreas Reischuck
3 | * Copyright 2014 Christian Loose
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | #include "viewsynchronizer.h"
19 |
20 | ViewSynchronizer::ViewSynchronizer(QWebView *webView, QPlainTextEdit *editor, QObject *parent) :
21 | QObject(parent),
22 | m_webView(webView),
23 | m_editor(editor)
24 | {
25 | }
26 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/ascetic.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: white;
12 | color: black;
13 | -webkit-text-size-adjust: none;
14 | }
15 |
16 | .hljs-string,
17 | .hljs-tag .hljs-value,
18 | .hljs-filter .hljs-argument,
19 | .hljs-addition,
20 | .hljs-change,
21 | .apache .hljs-tag,
22 | .apache .hljs-cbracket,
23 | .nginx .hljs-built_in,
24 | .tex .hljs-formula {
25 | color: #888;
26 | }
27 |
28 | .hljs-comment,
29 | .hljs-template_comment,
30 | .hljs-shebang,
31 | .hljs-doctype,
32 | .hljs-pi,
33 | .hljs-javadoc,
34 | .hljs-deletion,
35 | .apache .hljs-sqbracket {
36 | color: #ccc;
37 | }
38 |
39 | .hljs-keyword,
40 | .hljs-tag .hljs-title,
41 | .ini .hljs-title,
42 | .lisp .hljs-title,
43 | .http .hljs-title,
44 | .nginx .hljs-title,
45 | .css .hljs-tag,
46 | .hljs-winutils,
47 | .hljs-flow,
48 | .apache .hljs-tag,
49 | .tex .hljs-command,
50 | .hljs-request,
51 | .hljs-status {
52 | font-weight: bold;
53 | }
54 |
--------------------------------------------------------------------------------
/libs/jsonconfig/jsontranslatorfactory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONTRANSLATORFACTORY_H
18 | #define JSONTRANSLATORFACTORY_H
19 |
20 | #include "jsontranslator.h"
21 |
22 |
23 | template
24 | class JsonTranslatorFactory
25 | {
26 | public:
27 | static JsonTranslator *create() { return 0; }
28 | };
29 |
30 | #endif // JSONTRANSLATORFACTORY_H
31 |
32 |
--------------------------------------------------------------------------------
/test/unit/dictionarytest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef DICTIONARYTEST_H
18 | #define DICTIONARYTEST_H
19 |
20 | #include
21 |
22 | class DictionaryTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void returnsLanguageNameForLanguageCode();
28 | void returnsCountryNameForLanguage();
29 | };
30 |
31 | #endif // DICTIONARYTEST_H
32 |
--------------------------------------------------------------------------------
/test/unit/snippettest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef SNIPPETTEST_H
18 | #define SNIPPETTEST_H
19 |
20 | #include
21 |
22 | class SnippetTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void isLessThanComparable();
28 | void isEqualComparable();
29 | void isInitializedAfterCreation();
30 | };
31 |
32 | #endif // SNIPPETTEST_H
33 |
--------------------------------------------------------------------------------
/app/themes/solarized-dark.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: 839496
3 | background: 002b36
4 | caret: fdf6e3
5 |
6 | editor-selection
7 | foreground: 002b36
8 | background: d33682
9 |
10 | H1
11 | foreground: b58900
12 |
13 | H2
14 | foreground: b58900
15 |
16 | H3
17 | foreground: b58900
18 |
19 | H4
20 | foreground: b58900
21 |
22 | H5
23 | foreground: b58900
24 |
25 | H6
26 | foreground: b58900
27 |
28 | EMPH
29 | foreground: 93a1a1
30 | font-style: italic
31 |
32 | STRONG
33 | foreground: 93a1a1
34 | font-style: bold
35 |
36 | HRULE
37 | foreground: b58900
38 |
39 | LIST_BULLET
40 | foreground: 586e75
41 |
42 | LIST_ENUMERATOR
43 | foreground: 586e75
44 |
45 | LINK
46 | foreground: 268bd2
47 |
48 | AUTO_LINK_URL
49 | foreground: 268bd2
50 |
51 | AUTO_LINK_EMAIL
52 | foreground: 268bd2
53 |
54 | REFERENCE
55 | foreground: 6c71c4
56 |
57 | IMAGE
58 | foreground: cb4b16
59 |
60 | CODE
61 | foreground: 93a1a1
62 | background: 073642
63 |
64 | VERBATIM
65 | foreground: 93a1a1
66 | background: 073642
67 |
68 | HTML_ENTITY
69 | foreground: 586e75
70 |
71 | COMMENT
72 | foreground: 586e75
73 |
74 | BLOCKQUOTE
75 | foreground: 839496
76 |
--------------------------------------------------------------------------------
/app/themes/solarized-light.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: 657b83
3 | background: fdf6e3
4 | caret: 002b36
5 |
6 | editor-selection
7 | foreground: fdf6e3
8 | background: d33682
9 |
10 | H1
11 | foreground: b58900
12 |
13 | H2
14 | foreground: b58900
15 |
16 | H3
17 | foreground: b58900
18 |
19 | H4
20 | foreground: b58900
21 |
22 | H5
23 | foreground: b58900
24 |
25 | H6
26 | foreground: b58900
27 |
28 | EMPH
29 | foreground: 586e75
30 | font-style: italic
31 |
32 | STRONG
33 | foreground: 586e75
34 | font-style: bold
35 |
36 | HRULE
37 | foreground: b58900
38 |
39 | LIST_BULLET
40 | foreground: 93a1a1
41 |
42 | LIST_ENUMERATOR
43 | foreground: 93a1a1
44 |
45 | LINK
46 | foreground: 268bd2
47 |
48 | AUTO_LINK_URL
49 | foreground: 268bd2
50 |
51 | AUTO_LINK_EMAIL
52 | foreground: 268bd2
53 |
54 | REFERENCE
55 | foreground: 6c71c4
56 |
57 | IMAGE
58 | foreground: cb4b16
59 |
60 | CODE
61 | foreground: 586e75
62 | background: eee8d5
63 |
64 | VERBATIM
65 | foreground: 586e75
66 | background: eee8d5
67 |
68 | HTML_ENTITY
69 | foreground: 93a1a1
70 |
71 | COMMENT
72 | foreground: 93a1a1
73 |
74 | BLOCKQUOTE
75 | foreground: 657b83
76 |
--------------------------------------------------------------------------------
/libs/peg-markdown-highlight/definitions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef DEFINITIONS_H
18 | #define DEFINITIONS_H
19 |
20 | #include
21 | #include
22 |
23 |
24 | namespace PegMarkdownHighlight
25 | {
26 |
27 | struct HighlightingStyle
28 | {
29 | pmh_element_type type;
30 | QTextCharFormat format;
31 | };
32 |
33 | }
34 |
35 | #endif // DEFINITIONS_H
36 |
--------------------------------------------------------------------------------
/app/aboutdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef ABOUTDIALOG_H
18 | #define ABOUTDIALOG_H
19 |
20 | #include
21 |
22 | namespace Ui {
23 | class AboutDialog;
24 | }
25 |
26 | class AboutDialog : public QDialog
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | explicit AboutDialog(QWidget *parent = 0);
32 | ~AboutDialog();
33 |
34 | private:
35 | Ui::AboutDialog *ui;
36 | };
37 |
38 | #endif // ABOUTDIALOG_H
39 |
--------------------------------------------------------------------------------
/fontawesomeicon/fontawesomeicon.pro:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------
2 | #
3 | # Project created by QtCreator 2013-05-06T20:13:32
4 | #
5 | #-------------------------------------------------
6 |
7 | QT += core gui
8 |
9 | TARGET = fontawesomeicon
10 | TEMPLATE = lib
11 | CONFIG += plugin
12 |
13 | win32 {
14 | debug:DESTDIR = $$OUT_PWD/../app/debug/iconengines
15 | release:DESTDIR = $$OUT_PWD/../app/release/iconengines
16 | }
17 |
18 | SOURCES += fontawesomeiconengineplugin.cpp \
19 | fontawesomeiconengine.cpp
20 |
21 | HEADERS += fontawesomeiconengineplugin.h \
22 | fontawesomeiconengine.h
23 | OTHER_FILES += fontawesomeicon.json \
24 | fontawesome.ttf
25 |
26 | #unix:!symbian {
27 | # maemo5 {
28 | # target.path = /opt/usr/lib
29 | # } else {
30 | # target.path = /usr/lib
31 | # }
32 | # INSTALLS += target
33 | #}
34 |
35 | RESOURCES += \
36 | fontawesomeicon.qrc
37 |
38 | ## INSTALLATION
39 |
40 | unix {
41 | # install plugin
42 | target.path = $$[QT_INSTALL_PLUGINS]/iconengines
43 | INSTALLS += target
44 | message("The project will be installed in $$[QT_INSTALL_PLUGINS]/iconengines")
45 | }
46 |
--------------------------------------------------------------------------------
/app/controls/fileexplorerwidget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | FileExplorerWidget
4 |
5 |
6 |
7 | 0
8 | 0
9 | 400
10 | 300
11 |
12 |
13 |
14 | Form
15 |
16 |
17 |
18 | 0
19 |
20 |
21 | 0
22 |
23 |
24 | 0
25 |
26 |
27 | 0
28 |
29 |
30 | 0
31 |
32 | -
33 |
34 |
35 | true
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/test/unit/jsontranslatorfactorytest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONTRANSLATORFACTORYTEST_H
18 | #define JSONTRANSLATORFACTORYTEST_H
19 |
20 | #include
21 |
22 | class JsonTranslatorFactoryTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void returnsNullIfNoJsonTranslatorExists();
28 | void returnsValidJsonTranslatorForSnippets();
29 | };
30 |
31 | #endif // JSONTRANSLATORFACTORYTEST_H
32 |
33 |
--------------------------------------------------------------------------------
/app-static/datalocation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef DATALOCATION_H
18 | #define DATALOCATION_H
19 |
20 | #include
21 |
22 |
23 | class DataLocation
24 | {
25 | public:
26 | static QString writableLocation();
27 | static QStringList standardLocations();
28 |
29 | private:
30 | DataLocation();
31 | ~DataLocation();
32 |
33 | static void ensurePathExists(const QString &path);
34 | };
35 |
36 | #endif // DATALOCATION_H
37 |
--------------------------------------------------------------------------------
/app/themes/byword-dark.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: bebebe
3 | background: 1a1a1a
4 | caret: ffffff
5 |
6 | editor-selection
7 | foreground: 686868
8 | background: 312F31
9 |
10 | H1
11 | foreground: bebebe
12 | font-style: bold
13 |
14 | H2
15 | foreground: bebebe
16 | font-style: bold
17 |
18 | H3
19 | foreground: bebebe
20 | font-style: bold
21 |
22 | H4
23 | foreground: bebebe
24 | font-style: bold
25 |
26 | H5
27 | foreground: bebebe
28 | font-style: bold
29 |
30 | H6
31 | foreground: bebebe
32 | font-style: bold
33 |
34 | EMPH
35 | foreground: bebebe
36 | font-style: italic
37 |
38 | STRONG
39 | foreground: bebebe
40 | font-style: bold
41 |
42 | HRULE
43 | foreground: 676767
44 |
45 | LIST_BULLET
46 | foreground: 676767
47 |
48 | LIST_ENUMERATOR
49 | foreground: 676767
50 |
51 | LINK
52 | foreground: 676767
53 |
54 | AUTO_LINK_URL
55 | foreground: 676767
56 |
57 | AUTO_LINK_EMAIL
58 | foreground: 676767
59 |
60 | REFERENCE
61 | foreground: 676767
62 |
63 | IMAGE
64 | foreground: 676767
65 |
66 | CODE
67 | foreground: 676767
68 |
69 | VERBATIM
70 | foreground: 676767
71 |
72 | HTML
73 | foreground: 676767
74 |
75 | COMMENT
76 | foreground: 676767
77 |
78 | BLOCKQUOTE
79 | foreground: 676767
80 |
--------------------------------------------------------------------------------
/app/themes/default.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: 000000
3 | background: ffffff
4 | caret: 000000
5 |
6 | editor-selection
7 | foreground: ffffff
8 | background: ff4f92
9 |
10 | H1
11 | foreground: 6c71c4
12 | font-style: bold
13 |
14 | H2
15 | foreground: 6c71c4
16 | font-style: bold
17 |
18 | H3
19 | foreground: 6c71c4
20 | font-style: bold
21 |
22 | H4
23 | foreground: 268bd2
24 | font-style: bold
25 |
26 | H5
27 | foreground: 268bd2
28 | font-style: bold
29 |
30 | H6
31 | foreground: 268bd2
32 | font-style: bold
33 |
34 | EMPH
35 | foreground: cb4b16
36 | font-style: italic
37 |
38 | STRONG
39 | foreground: dc322f
40 | font-style: bold
41 |
42 | HRULE
43 | foreground: 586e75
44 |
45 | LIST_BULLET
46 | foreground: 93a1a1
47 |
48 | LIST_ENUMERATOR
49 | foreground: 93a1a1
50 |
51 | LINK
52 | foreground: 4e279a
53 |
54 | AUTO_LINK_URL
55 | foreground: 4e279a
56 |
57 | AUTO_LINK_EMAIL
58 | foreground: 4e279a
59 |
60 | REFERENCE
61 | foreground: bc670f
62 |
63 | IMAGE
64 | foreground: cf009a
65 |
66 | CODE
67 | foreground: 008c00
68 |
69 | VERBATIM
70 | foreground: 008c00
71 |
72 | HTML_ENTITY
73 | foreground: 6c71c4
74 |
75 | COMMENT
76 | foreground: 93a1a1
77 |
78 | BLOCKQUOTE
79 | foreground: 93a1a1
--------------------------------------------------------------------------------
/test/integration/htmltemplatetest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HTMLTEMPLATETEST_H
18 | #define HTMLTEMPLATETEST_H
19 |
20 | #include
21 |
22 | class HtmlTemplateTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void rendersContentInsideBodyTags();
28 | void rendersMermaidGraphInsideCodeTags();
29 | void replacesMermaidCodeTagsByDivTagsIfCodeHighlightingEnabled();
30 | };
31 |
32 | #endif // HTMLTEMPLATETEST_H
33 |
--------------------------------------------------------------------------------
/app/themes/clearness-dark.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: eeeeee
3 | background: 282a36
4 | caret: ff3319
5 |
6 | editor-selection
7 | foreground: ffffff
8 | background: ff4f92
9 |
10 | H1
11 | foreground: 8d7cd2
12 | font-style: bold
13 |
14 | H2
15 | foreground: 8d7cd2
16 | font-style: bold
17 |
18 | H3
19 | foreground: 8d7cd2
20 | font-style: bold
21 |
22 | H4
23 | foreground: 8d7cd2
24 | font-style: bold
25 |
26 | H5
27 | foreground: 8d7cd2
28 | font-style: bold
29 |
30 | H6
31 | foreground: 8d7cd2
32 | font-style: bold
33 |
34 | EMPH
35 | foreground: db8d50
36 | font-style: italic
37 |
38 | STRONG
39 | foreground: 00b2ce
40 | font-style: bold
41 |
42 | HRULE
43 | foreground: 586e75
44 |
45 | LIST_BULLET
46 | foreground: ffff00
47 |
48 | LIST_ENUMERATOR
49 | foreground: ffff00
50 |
51 | LINK
52 | foreground: 59acf3
53 |
54 | AUTO_LINK_URL
55 | foreground: 59acf3
56 |
57 | AUTO_LINK_EMAIL
58 | foreground: 59acf3
59 |
60 | REFERENCE
61 | foreground: 618890
62 |
63 | IMAGE
64 | foreground: 85d065
65 |
66 | CODE
67 | foreground: cf009a
68 |
69 | VERBATIM
70 | foreground: cf009a
71 |
72 | HTML_ENTITY
73 | foreground: 6c71c4
74 |
75 | COMMENT
76 | foreground: 93a1a1
77 |
78 | BLOCKQUOTE
79 | foreground: ff0000
--------------------------------------------------------------------------------
/libs/jsonconfig/jsoncollection.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONCOLLECTION_H
18 | #define JSONCOLLECTION_H
19 |
20 | template
21 | class JsonCollection
22 | {
23 | public:
24 | virtual ~JsonCollection() {}
25 |
26 | virtual int insert(const T &item) = 0;
27 |
28 | virtual const QString name() const = 0;
29 | virtual int count() const = 0;
30 | virtual const T &at(int offset) const = 0;
31 | };
32 |
33 | #endif // JSONCOLLECTION_H
34 |
35 |
--------------------------------------------------------------------------------
/app-static/themes/jsonthemetranslator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONTHEMETRANSLATOR_H
18 | #define JSONTHEMETRANSLATOR_H
19 |
20 | #include
21 | #include
22 | #include "theme.h"
23 |
24 |
25 | class JsonThemeTranslator : public JsonTranslator
26 | {
27 | private:
28 | Theme fromJsonObject(const QJsonObject &object);
29 | QJsonObject toJsonObject(const Theme &theme);
30 | };
31 |
32 | #endif // JSONTHEMETRANSLATOR_H
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app-static/yamlheaderchecker.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Aetf <7437103@gmail.com>
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef YAMLHEADERCHECKER_H
18 | #define YAMLHEADERCHECKER_H
19 |
20 | #include
21 |
22 | class YamlHeaderChecker
23 | {
24 | public:
25 | YamlHeaderChecker(const QString &text);
26 |
27 | bool hasHeader() const;
28 | QString header() const;
29 | QString body() const;
30 |
31 | int bodyOffset() const;
32 |
33 | private:
34 | QString m_header;
35 | QString m_body;
36 | };
37 |
38 | #endif // YAMLHEADERCHECKER_H
39 |
--------------------------------------------------------------------------------
/app/themes/clearness-dark+.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: eeeeee
3 | background: 282a36
4 | caret: ff3319
5 |
6 | editor-selection
7 | foreground: ffffff
8 | background: ff4f92
9 |
10 | H1
11 | foreground: 8d7cd2
12 | font-style: bold
13 | font-size: 24px
14 |
15 | H2
16 | foreground: 8d7cd2
17 | font-style: bold
18 | font-size: 20px
19 |
20 | H3
21 | foreground: 8d7cd2
22 | font-size: 17px
23 |
24 | H4
25 | foreground: 8d7cd2
26 | font-size: 15px
27 |
28 | H5
29 | foreground: 8d7cd2
30 | font-size: 13px
31 |
32 | H6
33 | foreground: 8d7cd2
34 | font-size: 11px
35 |
36 | EMPH
37 | foreground: db8d50
38 | font-style: italic
39 |
40 | STRONG
41 | foreground: 00b2ce
42 | font-style: bold
43 |
44 | HRULE
45 | foreground: 586e75
46 |
47 | LIST_BULLET
48 | foreground: ffff00
49 |
50 | LIST_ENUMERATOR
51 | foreground: ffff00
52 |
53 | LINK
54 | foreground: 59acf3
55 |
56 | AUTO_LINK_URL
57 | foreground: 59acf3
58 |
59 | AUTO_LINK_EMAIL
60 | foreground: 59acf3
61 |
62 | REFERENCE
63 | foreground: 618890
64 |
65 | IMAGE
66 | foreground: 85d065
67 |
68 | CODE
69 | foreground: cf009a
70 |
71 | VERBATIM
72 | foreground: cf009a
73 |
74 | HTML_ENTITY
75 | foreground: 6c71c4
76 |
77 | COMMENT
78 | foreground: 93a1a1
79 |
80 | BLOCKQUOTE
81 | foreground: ff0000
--------------------------------------------------------------------------------
/app/controls/linenumberarea.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "linenumberarea.h"
18 |
19 | #include "markdowneditor.h"
20 |
21 |
22 | LineNumberArea::LineNumberArea(MarkdownEditor *editor) :
23 | QWidget(editor)
24 | {
25 | this->editor = editor;
26 | }
27 |
28 | QSize LineNumberArea::sizeHint() const
29 | {
30 | return QSize(editor->lineNumberAreaWidth(), 0);
31 | }
32 |
33 | void LineNumberArea::paintEvent(QPaintEvent *event)
34 | {
35 | editor->lineNumberAreaPaintEvent(event);
36 | }
37 |
--------------------------------------------------------------------------------
/app/controls/activelabel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef ACTIVELABEL_H
18 | #define ACTIVELABEL_H
19 |
20 | #include
21 |
22 | class ActiveLabel : public QLabel
23 | {
24 | Q_OBJECT
25 | public:
26 | explicit ActiveLabel(QWidget *parent = 0);
27 | explicit ActiveLabel(const QString &text, QWidget *parent = 0);
28 |
29 | signals:
30 | void doubleClicked();
31 |
32 | protected:
33 | void mouseDoubleClickEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
34 | };
35 |
36 | #endif // ACTIVELABEL_H
37 |
--------------------------------------------------------------------------------
/test/unit/themetest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef THEMETEST_H
18 | #define THEMETEST_H
19 |
20 | #include
21 |
22 | class ThemeTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void isLessThanComparable();
28 | void isEqualComparable();
29 | void throwsIfNameIsEmpty();
30 | void throwsIfMarkdownHighlightingIsEmpty();
31 | void throwsIfCodeHighlightingIsEmpty();
32 | void throwsIfPreviewStylesheetIsEmpty();
33 | };
34 |
35 | #endif // THEMETEST_H
36 |
37 |
--------------------------------------------------------------------------------
/app-static/snippets/jsonsnippettranslator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONSNIPPETTRANSLATOR_H
18 | #define JSONSNIPPETTRANSLATOR_H
19 |
20 | #include
21 | #include
22 | struct Snippet;
23 |
24 |
25 | class JsonSnippetTranslator : public JsonTranslator
26 | {
27 | private:
28 | Snippet fromJsonObject(const QJsonObject &object) Q_DECL_OVERRIDE;
29 | QJsonObject toJsonObject(const Snippet &snippet) Q_DECL_OVERRIDE;
30 | };
31 |
32 | #endif // JSONSNIPPETTRANSLATOR_H
33 |
--------------------------------------------------------------------------------
/app/controls/linenumberarea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef LINENUMBERAREA_H
18 | #define LINENUMBERAREA_H
19 |
20 | #include
21 |
22 | class MarkdownEditor;
23 |
24 |
25 | class LineNumberArea : public QWidget
26 | {
27 | Q_OBJECT
28 | public:
29 | explicit LineNumberArea(MarkdownEditor *editor);
30 |
31 | QSize sizeHint() const;
32 |
33 | protected:
34 | void paintEvent(QPaintEvent *event);
35 |
36 | private:
37 | MarkdownEditor *editor;
38 | };
39 |
40 | #endif // LINENUMBERAREA_H
41 |
--------------------------------------------------------------------------------
/test/integration/jsonthemefiletest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONTHEMEFILETEST_H
18 | #define JSONTHEMEFILETEST_H
19 |
20 | #include
21 |
22 | class JsonThemeFileTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void loadsEmptyThemeCollectionFromFile();
28 | void loadsThemesCollectionFromFile();
29 |
30 | void savesEmptyThemesCollectionToFile();
31 | void savesThemesCollectionToFile();
32 |
33 | void roundtripTest();
34 | };
35 |
36 | #endif // JSONTHEMEFILETEST_H
37 |
--------------------------------------------------------------------------------
/test/integration/themecollectiontest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef THEMEMANAGERTEST_H
18 | #define THEMEMANAGERTEST_H
19 |
20 | #include
21 | class QTemporaryFile;
22 | class ThemeCollection;
23 |
24 |
25 | class ThemeCollectionTest : public QObject
26 | {
27 | Q_OBJECT
28 |
29 | private slots:
30 | void initTestCase();
31 | void cleanupTestCase();
32 |
33 | void loadsThemesFromFileIntoCollection();
34 |
35 | private:
36 | QTemporaryFile *themeFile;
37 | };
38 |
39 | #endif // THEMEMANAGERTEST_H
40 |
41 |
42 |
--------------------------------------------------------------------------------
/test/integration/jsonsnippetfiletest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONSNIPPETFILETEST_H
18 | #define JSONSNIPPETFILETEST_H
19 |
20 | #include
21 |
22 |
23 | class JsonSnippetFileTest : public QObject
24 | {
25 | Q_OBJECT
26 |
27 | private slots:
28 | void loadsEmptySnippetsCollectionFromFile();
29 | void loadsSnippetsCollectionFromFile();
30 |
31 | void savesEmptySnippetsCollectionToFile();
32 | void savesSnippetsCollectionToFile();
33 |
34 | void roundtripTest();
35 | };
36 |
37 | #endif // JSONSNIPPETFILETEST_H
38 |
--------------------------------------------------------------------------------
/test/unit/stylemanagertest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef STYLEMANAGERTEST_H
18 | #define STYLEMANAGERTEST_H
19 |
20 | #include
21 |
22 | class StyleManagerTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void returnsPathForMarkdownHighlighting();
28 | void returnsPathForCodeHighlighting();
29 | void returnsPathForPreviewStylesheet();
30 | void returnsPathForCustomPreviewStylesheet();
31 | void customPreviewStylesheetOverwritesBuiltin();
32 | };
33 |
34 | #endif // STYLEMANAGERTEST_H
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app-static/themes/jsonthemetranslatorfactory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONTHEMETRANSLATORFACTORY_H
18 | #define JSONTHEMETRANSLATORFACTORY_H
19 |
20 | #include
21 | #include
22 |
23 | #include "themes/theme.h"
24 | #include "themes/jsonthemetranslator.h"
25 |
26 |
27 | template <> class JsonTranslatorFactory
28 | {
29 | public:
30 | static JsonTranslator *create()
31 | {
32 | return new JsonThemeTranslator();
33 | }
34 | };
35 |
36 | #endif // JSONTHEMETRANSLATORFACTORY_H
37 |
38 |
--------------------------------------------------------------------------------
/test/unit/slidelinemappingtest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef SLIDELINEMAPPINGTEST_H
18 | #define SLIDELINEMAPPINGTEST_H
19 |
20 | #include
21 |
22 | class SlideLineMappingTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void holdsSingleEntryForEmptyDocuments();
28 | void horizontalSlideSeparatorMustBeSurroundedByBlankLines();
29 | void verticalSlideSeparatorMustBeSurroundedByBlankLines();
30 | void holdsEntryForeachSlide();
31 | void returnsSlideForEachLine();
32 | };
33 |
34 | #endif // SLIDELINEMAPPINGTEST_H
35 |
36 |
--------------------------------------------------------------------------------
/test/unit/yamlheadercheckertest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Aetf <7437103@gmail.com>
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef YAMLHEADERCHECKERTEST_H
18 | #define YAMLHEADERCHECKERTEST_H
19 |
20 | #include
21 | #include
22 |
23 | class YamlHeaderCheckerTest : public QObject
24 | {
25 | Q_OBJECT
26 |
27 | private slots:
28 | void multipleOccurance();
29 | void HeaderOnlyDocument();
30 | void EmptyHeader();
31 | void partialHeader();
32 | void endMarkNotAtLineBegin();
33 | void tailingSpaces();
34 | void marksWithOtherCharacters();
35 | void dotMark();
36 | };
37 |
38 | #endif // YAMLHEADERCHECKERTEST_H
39 |
--------------------------------------------------------------------------------
/app/themes/default+.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: 000000
3 | background: ffffff
4 | caret: 000000
5 |
6 | editor-selection
7 | foreground: ffffff
8 | background: ff4f92
9 |
10 | H1
11 | foreground: 6c71c4
12 | font-style: bold
13 | font-size: 24px
14 |
15 | H2
16 | foreground: 6c71c4
17 | font-style: bold
18 | font-size: 20px
19 |
20 | H3
21 | foreground: 6c71c4
22 | font-style: bold
23 | font-size: 17px
24 |
25 | H4
26 | foreground: 268bd2
27 | font-style: bold
28 | font-size: 15px
29 |
30 | H5
31 | foreground: 268bd2
32 | font-style: bold
33 | font-size: 13px
34 |
35 | H6
36 | foreground: 268bd2
37 | font-style: bold
38 | font-size: 11px
39 |
40 | EMPH
41 | foreground: cb4b16
42 | font-style: italic
43 |
44 | STRONG
45 | foreground: dc322f
46 | font-style: bold
47 |
48 | HRULE
49 | foreground: 586e75
50 |
51 | LIST_BULLET
52 | foreground: 93a1a1
53 |
54 | LIST_ENUMERATOR
55 | foreground: 93a1a1
56 |
57 | LINK
58 | foreground: 4e279a
59 |
60 | AUTO_LINK_URL
61 | foreground: 4e279a
62 |
63 | AUTO_LINK_EMAIL
64 | foreground: 4e279a
65 |
66 | REFERENCE
67 | foreground: bc670f
68 |
69 | IMAGE
70 | foreground: cf009a
71 |
72 | CODE
73 | foreground: 008c00
74 |
75 | VERBATIM
76 | foreground: 008c00
77 |
78 | HTML_ENTITY
79 | foreground: 6c71c4
80 |
81 | COMMENT
82 | foreground: 93a1a1
83 |
84 | BLOCKQUOTE
85 | foreground: 93a1a1
--------------------------------------------------------------------------------
/test/unit/themecollectiontest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef THEMECOLLECTIONTEST_H
18 | #define THEMECOLLECTIONTEST_H
19 |
20 | #include
21 |
22 | class ThemeCollectionTest : public QObject
23 | {
24 | Q_OBJECT
25 |
26 | private slots:
27 | void returnsConstantNameOfJsonArray();
28 | void returnsNumberOfThemesInCollection();
29 | void returnsThemeAtIndexPosition();
30 | void returnsIfCollectionContainsTheme();
31 | void returnsThemeByName();
32 | void returnsNameOfAllThemes();
33 | };
34 |
35 | #endif // THEMECOLLECTIONTEST_H
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/controls/activelabel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "activelabel.h"
18 |
19 | #include
20 |
21 | ActiveLabel::ActiveLabel(QWidget *parent) :
22 | QLabel(parent)
23 | {
24 | }
25 |
26 | ActiveLabel::ActiveLabel(const QString &text, QWidget *parent) :
27 | QLabel(text, parent)
28 | {
29 | }
30 |
31 | void ActiveLabel::mouseDoubleClickEvent(QMouseEvent *e)
32 | {
33 | // double click with left mouse button?
34 | if (e->button() == Qt::LeftButton) {
35 | emit doubleClicked();
36 | }
37 |
38 | QLabel::mouseDoubleClickEvent(e);
39 | }
40 |
--------------------------------------------------------------------------------
/app/themes/byword-dark+.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: bebebe
3 | background: 1a1a1a
4 | caret: ffffff
5 |
6 | editor-selection
7 | foreground: 686868
8 | background: 312F31
9 |
10 | H1
11 | foreground: bebebe
12 | font-style: bold
13 | font-size: 24px
14 |
15 | H2
16 | foreground: bebebe
17 | font-style: bold
18 | font-size: 20px
19 |
20 | H3
21 | foreground: bebebe
22 | font-style: bold
23 | font-size: 17px
24 |
25 | H4
26 | foreground: bebebe
27 | font-style: bold
28 | font-size: 15px
29 |
30 | H5
31 | foreground: bebebe
32 | font-style: bold
33 | font-size: 13px
34 |
35 | H6
36 | foreground: bebebe
37 | font-style: bold
38 | font-size: 11px
39 |
40 | EMPH
41 | foreground: bebebe
42 | font-style: italic
43 |
44 | STRONG
45 | foreground: bebebe
46 | font-style: bold
47 |
48 | HRULE
49 | foreground: 676767
50 |
51 | LIST_BULLET
52 | foreground: 676767
53 |
54 | LIST_ENUMERATOR
55 | foreground: 676767
56 |
57 | LINK
58 | foreground: 676767
59 |
60 | AUTO_LINK_URL
61 | foreground: 676767
62 |
63 | AUTO_LINK_EMAIL
64 | foreground: 676767
65 |
66 | REFERENCE
67 | foreground: 676767
68 |
69 | IMAGE
70 | foreground: 676767
71 |
72 | CODE
73 | foreground: 676767
74 |
75 | VERBATIM
76 | foreground: 676767
77 |
78 | HTML
79 | foreground: 676767
80 |
81 | COMMENT
82 | foreground: 676767
83 |
84 | BLOCKQUOTE
85 | foreground: 676767
86 |
--------------------------------------------------------------------------------
/app-static/snippets/jsonsnippettranslatorfactory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONSNIPPETTRANSLATORFACTORY_H
18 | #define JSONSNIPPETTRANSLATORFACTORY_H
19 |
20 | #include
21 | #include
22 |
23 | #include "snippets/snippet.h"
24 | #include "snippets/jsonsnippettranslator.h"
25 |
26 |
27 | template <> class JsonTranslatorFactory
28 | {
29 | public:
30 | static JsonTranslator *create()
31 | {
32 | return new JsonSnippetTranslator();
33 | }
34 | };
35 |
36 | #endif // JSONSNIPPETTRANSLATORFACTORY_H
37 |
38 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/mono-blue.css:
--------------------------------------------------------------------------------
1 | /*
2 | Five-color theme from a single blue hue.
3 | */
4 | .hljs {
5 | display: block;
6 | overflow-x: auto;
7 | padding: 0.5em;
8 | background: #eaeef3;
9 | -webkit-text-size-adjust: none;
10 | }
11 |
12 | .hljs,
13 | .hljs-list .hljs-built_in {
14 | color: #00193a;
15 | }
16 |
17 | .hljs-keyword,
18 | .hljs-title,
19 | .hljs-important,
20 | .hljs-request,
21 | .hljs-header,
22 | .hljs-javadoctag {
23 | font-weight: bold;
24 | }
25 |
26 | .hljs-comment,
27 | .hljs-chunk,
28 | .hljs-template_comment {
29 | color: #738191;
30 | }
31 |
32 | .hljs-string,
33 | .hljs-title,
34 | .hljs-parent,
35 | .hljs-built_in,
36 | .hljs-literal,
37 | .hljs-filename,
38 | .hljs-value,
39 | .hljs-addition,
40 | .hljs-tag,
41 | .hljs-argument,
42 | .hljs-link_label,
43 | .hljs-blockquote,
44 | .hljs-header {
45 | color: #0048ab;
46 | }
47 |
48 | .hljs-decorator,
49 | .hljs-prompt,
50 | .hljs-yardoctag,
51 | .hljs-subst,
52 | .hljs-symbol,
53 | .hljs-doctype,
54 | .hljs-regexp,
55 | .hljs-preprocessor,
56 | .hljs-pragma,
57 | .hljs-pi,
58 | .hljs-attribute,
59 | .hljs-attr_selector,
60 | .hljs-javadoc,
61 | .hljs-xmlDocTag,
62 | .hljs-deletion,
63 | .hljs-shebang,
64 | .hljs-string .hljs-variable,
65 | .hljs-link_url,
66 | .hljs-bullet,
67 | .hljs-sqbracket,
68 | .hljs-phony {
69 | color: #4c81c9;
70 | }
71 |
--------------------------------------------------------------------------------
/app/styles/clearness-dark.css:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------
2 | LESS Elements 0.9
3 | ---------------------------------------------------
4 | A set of useful LESS mixins
5 | More info at: http://lesselements.com
6 | ---------------------------------------------------*/
7 | /**
8 | * https://github.com/rhiokim/markdown-css
9 | * solarized-light style
10 | * made by rhio.kim
11 | * powered by http://ethanschoonover.com/solarized
12 | */
13 | body {
14 | padding: 20px;
15 | color: #ffffff;
16 | font-size: 1em;
17 | font-family: Sans-serif;
18 | background: #282a36;
19 | -webkit-font-smoothing: antialiased;
20 | }
21 | a {
22 | color: #e03300;
23 | }
24 | a:hover {
25 | color: #ff4a14;
26 | }
27 | h2 {
28 | border-bottom: 1px solid #21232d;
29 | }
30 | h6 {
31 | color: #a4a296;
32 | }
33 | hr {
34 | border: 1px solid #21232d;
35 | }
36 | pre > code {
37 | /* font-size: .9em;*/
38 | font-family: Consolas, Inconsolata, Courier, monospace;
39 | }
40 | blockquote {
41 | border-left: 4px solid #121319;
42 | padding: 0 15px;
43 | font-style: italic;
44 | }
45 | table {
46 | background-color: #303241;
47 | }
48 | table tr th,
49 | table tr td {
50 | border: 1px solid #4b4e65;
51 | }
52 | table tr:nth-child(2n) {
53 | background-color: #373a4b;
54 | }
55 | /**
56 | * after less
57 | */
58 |
--------------------------------------------------------------------------------
/app-static/viewsynchronizer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Andreas Reischuck
3 | * Copyright 2014 Christian Loose
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | #ifndef VIEWSYNCHRONIZER_H
19 | #define VIEWSYNCHRONIZER_H
20 |
21 | #include
22 |
23 | class QWebView;
24 | class QPlainTextEdit;
25 |
26 |
27 | class ViewSynchronizer : public QObject
28 | {
29 | Q_OBJECT
30 |
31 | public:
32 | ViewSynchronizer(QWebView *webView, QPlainTextEdit *editor, QObject *parent = 0);
33 | virtual ~ViewSynchronizer() {}
34 |
35 | protected:
36 | QWebView *m_webView;
37 | QPlainTextEdit *m_editor;
38 | };
39 |
40 | #endif // VIEWSYNCHRONIZER_H
41 |
--------------------------------------------------------------------------------
/app-static/snippets/snippet.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef SNIPPET_H
18 | #define SNIPPET_H
19 |
20 | #include
21 |
22 |
23 | struct Snippet
24 | {
25 | QString trigger;
26 | QString description;
27 | QString snippet;
28 | int cursorPosition;
29 | bool builtIn;
30 |
31 | Snippet() : cursorPosition(0), builtIn(false) {}
32 |
33 | bool operator<(const Snippet &rhs) const
34 | {
35 | return trigger < rhs.trigger;
36 | }
37 |
38 | bool operator ==(const Snippet &rhs) const
39 | {
40 | return trigger == rhs.trigger;
41 | }
42 | };
43 |
44 | #endif // SNIPPET_H
45 |
--------------------------------------------------------------------------------
/app/themes/solarized-dark+.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: 839496
3 | background: 002b36
4 | caret: fdf6e3
5 |
6 | editor-selection
7 | foreground: 002b36
8 | background: d33682
9 |
10 | H1
11 | foreground: b58900
12 | font-style: bold
13 | font-size: 24px
14 |
15 | H2
16 | foreground: b58900
17 | font-style: bold
18 | font-size: 20px
19 |
20 | H3
21 | foreground: b58900
22 | font-style: bold
23 | font-size: 17px
24 |
25 | H4
26 | foreground: b58900
27 | font-style: bold
28 | font-size: 15px
29 |
30 | H5
31 | foreground: b58900
32 | font-style: bold
33 | font-size: 13px
34 |
35 | H6
36 | foreground: b58900
37 | font-style: bold
38 | font-size: 11px
39 |
40 | EMPH
41 | foreground: 93a1a1
42 | font-style: italic
43 |
44 | STRONG
45 | foreground: 93a1a1
46 | font-style: bold
47 |
48 | HRULE
49 | foreground: b58900
50 |
51 | LIST_BULLET
52 | foreground: 586e75
53 |
54 | LIST_ENUMERATOR
55 | foreground: 586e75
56 |
57 | LINK
58 | foreground: 268bd2
59 |
60 | AUTO_LINK_URL
61 | foreground: 268bd2
62 |
63 | AUTO_LINK_EMAIL
64 | foreground: 268bd2
65 |
66 | REFERENCE
67 | foreground: 6c71c4
68 |
69 | IMAGE
70 | foreground: cb4b16
71 |
72 | CODE
73 | foreground: 93a1a1
74 | background: 073642
75 |
76 | VERBATIM
77 | foreground: 93a1a1
78 | background: 073642
79 |
80 | HTML_ENTITY
81 | foreground: 586e75
82 |
83 | COMMENT
84 | foreground: 586e75
85 |
86 | BLOCKQUOTE
87 | foreground: 839496
88 |
--------------------------------------------------------------------------------
/app/themes/solarized-light+.txt:
--------------------------------------------------------------------------------
1 | editor
2 | foreground: 657b83
3 | background: fdf6e3
4 | caret: 002b36
5 |
6 | editor-selection
7 | foreground: fdf6e3
8 | background: d33682
9 |
10 | H1
11 | foreground: b58900
12 | font-style: bold
13 | font-size: 24px
14 |
15 | H2
16 | foreground: b58900
17 | font-style: bold
18 | font-size: 20px
19 |
20 | H3
21 | foreground: b58900
22 | font-style: bold
23 | font-size: 17px
24 |
25 | H4
26 | foreground: b58900
27 | font-style: bold
28 | font-size: 15px
29 |
30 | H5
31 | foreground: b58900
32 | font-style: bold
33 | font-size: 13px
34 |
35 | H6
36 | foreground: b58900
37 | font-style: bold
38 | font-size: 11px
39 |
40 | EMPH
41 | foreground: 586e75
42 | font-style: italic
43 |
44 | STRONG
45 | foreground: 586e75
46 | font-style: bold
47 |
48 | HRULE
49 | foreground: b58900
50 |
51 | LIST_BULLET
52 | foreground: 93a1a1
53 |
54 | LIST_ENUMERATOR
55 | foreground: 93a1a1
56 |
57 | LINK
58 | foreground: 268bd2
59 |
60 | AUTO_LINK_URL
61 | foreground: 268bd2
62 |
63 | AUTO_LINK_EMAIL
64 | foreground: 268bd2
65 |
66 | REFERENCE
67 | foreground: 6c71c4
68 |
69 | IMAGE
70 | foreground: cb4b16
71 |
72 | CODE
73 | foreground: 586e75
74 | background: eee8d5
75 |
76 | VERBATIM
77 | foreground: 586e75
78 | background: eee8d5
79 |
80 | HTML_ENTITY
81 | foreground: 93a1a1
82 |
83 | COMMENT
84 | foreground: 93a1a1
85 |
86 | BLOCKQUOTE
87 | foreground: 657b83
88 |
--------------------------------------------------------------------------------
/app-static/template/presentationtemplate.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef PRESENTATIONTEMPLATE_H
18 | #define PRESENTATIONTEMPLATE_H
19 |
20 | #include "template.h"
21 |
22 | class PresentationTemplate : public Template
23 | {
24 | public:
25 | PresentationTemplate();
26 |
27 | virtual QString render(const QString &body, RenderOptions options) const;
28 | virtual QString exportAsHtml(const QString &header, const QString &body, RenderOptions options) const;
29 |
30 | private:
31 | QString buildRevealPlugins(RenderOptions options) const;
32 |
33 | QString presentationTemplate;
34 | };
35 |
36 | #endif // PRESENTATIONTEMPLATE_H
37 |
--------------------------------------------------------------------------------
/app-static/datalocation.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "datalocation.h"
18 |
19 | #include
20 | #include
21 |
22 |
23 | QString DataLocation::writableLocation()
24 | {
25 | QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
26 | ensurePathExists(path);
27 | return path;
28 | }
29 |
30 | QStringList DataLocation::standardLocations()
31 | {
32 | return QStandardPaths::standardLocations(QStandardPaths::DataLocation);
33 | }
34 |
35 | void DataLocation::ensurePathExists(const QString &path)
36 | {
37 | QDir p(path);
38 | if (!p.exists()) {
39 | p.mkpath(path);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/imagetooldialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef IMAGETOOLDIALOG_H
18 | #define IMAGETOOLDIALOG_H
19 |
20 | #include
21 |
22 | namespace Ui {
23 | class ImageToolDialog;
24 | }
25 |
26 | class ImageToolDialog : public QDialog
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | explicit ImageToolDialog(QWidget *parent = 0);
32 | ~ImageToolDialog();
33 |
34 | QString alternateText() const;
35 | QString imageSourceLink() const;
36 | QString optionalTitle() const;
37 |
38 | private slots:
39 | void chooseFileButtonClicked();
40 |
41 | private:
42 | Ui::ImageToolDialog *ui;
43 | };
44 |
45 | #endif // IMAGETOOLDIALOG_H
46 |
--------------------------------------------------------------------------------
/app-static/themes/stylemanager.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef STYLEMANAGER_H
18 | #define STYLEMANAGER_H
19 |
20 | #include
21 | #include
22 | #include "theme.h"
23 |
24 |
25 | class StyleManager
26 | {
27 | public:
28 | void insertCustomPreviewStylesheet(const QString &styleName, const QString &stylePath);
29 |
30 | static QString markdownHighlightingPath(const Theme &theme);
31 | static QString codeHighlightingPath(const Theme &theme);
32 | static QString previewStylesheetPath(const Theme &theme);
33 |
34 | private:
35 | static QMap customPreviewStylesheets;
36 | };
37 |
38 | #endif // STYLEMANAGER_H
39 |
40 |
--------------------------------------------------------------------------------
/app/exportpdfdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef EXPORTPDFDIALOG_H
18 | #define EXPORTPDFDIALOG_H
19 |
20 | #include
21 |
22 | namespace Ui {
23 | class ExportPdfDialog;
24 | }
25 | class QPrinter;
26 |
27 | class ExportPdfDialog : public QDialog
28 | {
29 | Q_OBJECT
30 |
31 | public:
32 | explicit ExportPdfDialog(const QString &fileName, QWidget *parent = 0);
33 | ~ExportPdfDialog();
34 |
35 | QPrinter *printer();
36 |
37 | private slots:
38 | void exportToTextChanged(const QString &text);
39 | void chooseFileButtonClicked();
40 |
41 | private:
42 | Ui::ExportPdfDialog *ui;
43 | };
44 |
45 | #endif // EXPORTPDFDIALOG_H
46 |
--------------------------------------------------------------------------------
/test/integration/revealmarkdownconvertertest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef REVEALMARKDOWNCONVERTERTEST_H
18 | #define REVEALMARKDOWNCONVERTERTEST_H
19 |
20 | #include
21 |
22 | class RevealMarkdownConverter;
23 |
24 |
25 | class RevealMarkdownConverterTest : public QObject
26 | {
27 | Q_OBJECT
28 |
29 | private slots:
30 | void initTestCase();
31 |
32 | void convertsEmptyStringToEmptyHtml();
33 | void returnsAnyMarkdownTextUnchanged();
34 | void preservesGermanUmlautsInHtml();
35 |
36 | void cleanupTestCase();
37 |
38 | private:
39 | RevealMarkdownConverter *converter;
40 | };
41 |
42 | #endif // REVEALMARKDOWNCONVERTERTEST_H
43 |
--------------------------------------------------------------------------------
/app-static/htmlviewsynchronizer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HTMLVIEWSYNCHRONIZER_H
18 | #define HTMLVIEWSYNCHRONIZER_H
19 |
20 | #include "viewsynchronizer.h"
21 |
22 |
23 | class HtmlViewSynchronizer : public ViewSynchronizer
24 | {
25 | Q_OBJECT
26 |
27 | public:
28 | HtmlViewSynchronizer(QWebView *webView, QPlainTextEdit *editor);
29 | ~HtmlViewSynchronizer();
30 |
31 | public slots:
32 | void webViewScrolled();
33 | void rememberScrollBarPos();
34 |
35 | private slots:
36 | void scrollValueChanged(int value);
37 | void htmlContentSizeChanged();
38 |
39 | private:
40 | int scrollBarPos;
41 | };
42 |
43 | #endif // HTMLVIEWSYNCHRONIZER_H
44 |
45 |
--------------------------------------------------------------------------------
/app/controls/languagemenu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef LANGUAGEMENU_H
18 | #define LANGUAGEMENU_H
19 |
20 | #include
21 |
22 | class Dictionary;
23 |
24 | class LanguageMenu : public QMenu
25 | {
26 | Q_OBJECT
27 | public:
28 | explicit LanguageMenu(QWidget *parent = 0);
29 |
30 | void loadDictionaries(const QString ¤tLanguage);
31 |
32 | signals:
33 | void languageTriggered(const Dictionary &dictionary);
34 |
35 | private slots:
36 | void languageTriggered();
37 |
38 | private:
39 | QAction *createAction(const Dictionary &dictionary);
40 |
41 | private:
42 | QActionGroup *dictionariesGroup;
43 | };
44 |
45 | #endif // LANGUAGEMENU_H
46 |
--------------------------------------------------------------------------------
/app-static/spellchecker/dictionary.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef DICTIONARY_H
18 | #define DICTIONARY_H
19 |
20 | #include
21 | #include
22 |
23 | class Dictionary
24 | {
25 | public:
26 | Dictionary();
27 | Dictionary(const QString &language, const QString &filePath);
28 | Dictionary(const Dictionary &other);
29 | ~Dictionary();
30 |
31 | QString language() const;
32 | QString languageName() const;
33 |
34 | QString countryName() const;
35 |
36 | QString filePath() const;
37 |
38 | private:
39 | QString m_language;
40 | QString m_filePath;
41 | };
42 |
43 | Q_DECLARE_METATYPE(Dictionary);
44 |
45 | #endif // DICTIONARY_H
46 |
--------------------------------------------------------------------------------
/test/unit/jsonthemetranslatortest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONTHEMETRANSLATORTEST_H
18 | #define JSONTHEMETRANSLATORTEST_H
19 |
20 | #include
21 | class JsonThemeTranslator;
22 |
23 |
24 | class JsonThemeTranslatorTest : public QObject
25 | {
26 | Q_OBJECT
27 |
28 | private slots:
29 | void initTestCase();
30 | void cleanupTestCase();
31 |
32 | void doesNotProcessInvalidJsonDocument();
33 | void translatesEmptyJsonDocumentToEmptyThemes();
34 | void translatesJsonDocumentToThemes();
35 | void translatesThemesToJsonDocument();
36 |
37 | private:
38 | JsonThemeTranslator *translator;
39 | };
40 |
41 | #endif // JSONTHEMETRANSLATORTEST_H
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/test/unit/jsonsnippettranslatortest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef JSONSNIPPETTRANSLATORTEST_H
18 | #define JSONSNIPPETTRANSLATORTEST_H
19 |
20 | #include
21 | class JsonSnippetTranslator;
22 |
23 |
24 | class JsonSnippetTranslatorTest : public QObject
25 | {
26 | Q_OBJECT
27 |
28 | private slots:
29 | void initTestCase();
30 |
31 | void translatesJsonDocumentToSnippets();
32 | void translatesEmptyJsonDocumentToEmptySnippets();
33 | void defectIfJsonDocumentIsInvalid();
34 |
35 | void translatesSnippetCollectionToJsonDocument();
36 |
37 | void cleanupTestCase();
38 |
39 | private:
40 | JsonSnippetTranslator *translator;
41 | };
42 |
43 | #endif // JSONSNIPPETTRANSLATORTEST_H
44 |
--------------------------------------------------------------------------------
/app/controls/recentfilesmenu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef RECENTFILESMENU_H
18 | #define RECENTFILESMENU_H
19 |
20 | #include
21 |
22 | class RecentFilesMenu : public QMenu
23 | {
24 | Q_OBJECT
25 | public:
26 | explicit RecentFilesMenu(QWidget *parent = 0);
27 |
28 | void readState();
29 | void saveState() const;
30 |
31 | signals:
32 | void recentFileTriggered(const QString &fileName);
33 |
34 | public slots:
35 | void addFile(const QString &fileName);
36 | void clearMenu();
37 |
38 | private slots:
39 | void recentFileTriggered();
40 |
41 | private:
42 | void updateMenu();
43 |
44 | private:
45 | QStringList recentFiles;
46 | };
47 |
48 | #endif // RECENTFILESMENU_H
49 |
--------------------------------------------------------------------------------
/libs/peg-markdown-highlight/styleparser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef STYLEPARSER_H
18 | #define STYLEPARSER_H
19 |
20 | #include "definitions.h"
21 | #include
22 |
23 |
24 | namespace PegMarkdownHighlight
25 | {
26 |
27 | class StyleParser
28 | {
29 | public:
30 | explicit StyleParser(const QString& styleSheet);
31 | ~StyleParser();
32 |
33 | QVector highlightingStyles(QFont baseFont) const;
34 | QPalette editorPalette() const;
35 |
36 | void handleStyleParsingError(char *errorMessage, int lineNumber);
37 |
38 | private:
39 | pmh_style_collection *styles;
40 | QList > styleParsingErrorList;
41 | };
42 |
43 | }
44 |
45 | #endif // STYLEPARSER_H
46 |
--------------------------------------------------------------------------------
/test/unit/jsontranslatorfactorytest.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "jsontranslatorfactorytest.h"
18 |
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 |
27 | void JsonTranslatorFactoryTest::returnsNullIfNoJsonTranslatorExists()
28 | {
29 | JsonTranslator *translator = JsonTranslatorFactory::create();
30 |
31 | QVERIFY(translator == 0);
32 | }
33 |
34 | void JsonTranslatorFactoryTest::returnsValidJsonTranslatorForSnippets()
35 | {
36 | JsonTranslator *translator = JsonTranslatorFactory::create();
37 |
38 | QVERIFY(translator != 0);
39 | }
40 |
--------------------------------------------------------------------------------
/app/exporthtmldialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef EXPORTHTMLDIALOG_H
18 | #define EXPORTHTMLDIALOG_H
19 |
20 | #include
21 |
22 | namespace Ui {
23 | class ExportHtmlDialog;
24 | }
25 | class QPrinter;
26 |
27 | class ExportHtmlDialog : public QDialog
28 | {
29 | Q_OBJECT
30 |
31 | public:
32 | explicit ExportHtmlDialog(const QString &fileName, QWidget *parent = 0);
33 | ~ExportHtmlDialog();
34 |
35 | QString fileName() const;
36 | bool includeCSS() const;
37 | bool includeCodeHighlighting() const;
38 |
39 | private slots:
40 | void exportToTextChanged(const QString &text);
41 | void chooseFileButtonClicked();
42 |
43 | private:
44 | Ui::ExportHtmlDialog *ui;
45 | };
46 |
47 | #endif // EXPORTHTMLDIALOG_H
48 |
--------------------------------------------------------------------------------
/app-static/converter/revealmarkdownconverter.cpp:
--------------------------------------------------------------------------------
1 | #include "revealmarkdownconverter.h"
2 |
3 | #include
4 |
5 | #include "markdowndocument.h"
6 | #include "template/presentationtemplate.h"
7 |
8 | class RevealMarkdownDocument : public MarkdownDocument
9 | {
10 | public:
11 | QString markdownText;
12 | };
13 |
14 | RevealMarkdownConverter::RevealMarkdownConverter()
15 | {
16 | }
17 |
18 | MarkdownDocument *RevealMarkdownConverter::createDocument(const QString &text, MarkdownConverter::ConverterOptions options)
19 | {
20 | Q_UNUSED(options)
21 |
22 | RevealMarkdownDocument *doc = new RevealMarkdownDocument();
23 | doc->markdownText = text;
24 | return doc;
25 | }
26 |
27 | QString RevealMarkdownConverter::renderAsHtml(MarkdownDocument *document)
28 | {
29 | QString html;
30 |
31 | if (document) {
32 | RevealMarkdownDocument *doc = dynamic_cast(document);
33 | if (doc) {
34 | html = doc->markdownText;
35 | }
36 | }
37 |
38 | return html;
39 | }
40 |
41 | QString RevealMarkdownConverter::renderAsTableOfContents(MarkdownDocument *document)
42 | {
43 | Q_UNUSED(document)
44 |
45 | return QString();
46 | }
47 |
48 | Template *RevealMarkdownConverter::templateRenderer() const
49 | {
50 | static PresentationTemplate presentationTemplate;
51 | return &presentationTemplate;
52 | }
53 |
54 | MarkdownConverter::ConverterOptions RevealMarkdownConverter::supportedOptions() const
55 | {
56 | return 0;
57 | }
58 |
--------------------------------------------------------------------------------
/app-static/themes/themecollection.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef THEMECOLLECTION_H
18 | #define THEMECOLLECTION_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include "theme.h"
24 |
25 |
26 | class ThemeCollection : public JsonCollection
27 | {
28 | public:
29 | bool load(const QString &fileName);
30 |
31 | int insert(const Theme &theme);
32 |
33 | int count() const;
34 | const Theme &at(int offset) const;
35 | bool contains(const QString &name) const;
36 | const Theme theme(const QString &name) const;
37 | QStringList themeNames() const;
38 |
39 | const QString name() const;
40 |
41 | private:
42 | QStringList themesIndex;
43 | QList themes;
44 | };
45 |
46 | #endif // THEMECOLLECTION_H
47 |
48 |
--------------------------------------------------------------------------------
/app/htmlhighlighter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HTMLHIGHLIGHTER_H
18 | #define HTMLHIGHLIGHTER_H
19 |
20 | #include
21 |
22 | class HtmlHighlighter : public QSyntaxHighlighter
23 | {
24 | public:
25 | explicit HtmlHighlighter(QTextDocument *document);
26 |
27 | bool isEnabled() const;
28 | void setEnabled(bool enabled);
29 |
30 | protected:
31 | void highlightBlock(const QString &text) Q_DECL_OVERRIDE;
32 |
33 | private:
34 | struct HighlightingRule
35 | {
36 | QRegExp pattern;
37 | QTextCharFormat *format;
38 | };
39 | QList highlightingRules;
40 |
41 | QTextCharFormat keywordFormat;
42 | QTextCharFormat imageFormat;
43 | QTextCharFormat linkFormat;
44 | bool enabled;
45 | };
46 |
47 | #endif // HTMLHIGHLIGHTER_H
48 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2006, Ivan Sagalaev
2 | All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are met:
5 |
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | * Neither the name of highlight.js nor the names of its contributors
12 | may be used to endorse or promote products derived from this software
13 | without specific prior written permission.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
--------------------------------------------------------------------------------
/test/integration/htmlpreviewcontrollertest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HTMLPREVIEWCONTROLLERTEST_H
18 | #define HTMLPREVIEWCONTROLLERTEST_H
19 |
20 | #include
21 | class QWebView;
22 | class HtmlPreviewController;
23 |
24 | class HtmlPreviewControllerTest : public QObject
25 | {
26 | Q_OBJECT
27 |
28 | private slots:
29 | void initTestCase();
30 | void cleanupTestCase();
31 |
32 | void increasesZoomFactorOnZoomIn();
33 | void decreasesZoomFactorOnZoomOut();
34 | void resetsZoomFactorOnZoomReset();
35 |
36 | void zoomsInOnCtrlPlusKeyPress();
37 | void zoomsOutOnCtrlMinusKeyPress();
38 | void resetsZoomOnCtrlZeroKeyPress();
39 |
40 | void setupsNetworkDiskCache();
41 |
42 | private:
43 | QWebView *webView;
44 | HtmlPreviewController *controller;
45 | };
46 |
47 | #endif // HTMLPREVIEWCONTROLLERTEST_H
48 |
49 |
--------------------------------------------------------------------------------
/test/integration/pmhmarkdownparsertest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef PMHMARKDOWNPARSERTEST_H
18 | #define PMHMARKDOWNPARSERTEST_H
19 |
20 | #include
21 |
22 | class PmhMarkdownParser;
23 |
24 | class PmhMarkdownParserTest : public QObject
25 | {
26 | Q_OBJECT
27 |
28 | private slots:
29 | void initTestCase();
30 | void cleanupTestCase();
31 |
32 | void returnsEmptyMapForEmptyMarkdownDocument();
33 | void returnsNoEntryForNonExistingMarkdownElements();
34 | void returnsEntryForMarkdownElement();
35 | void returnsListOfEntriesForSingleMarkdownElementType();
36 | void entryKnowsItsMarkdownElementType();
37 | void entryHasStartAndEndPosition();
38 |
39 | void benchmark_data();
40 | void benchmark();
41 |
42 | private:
43 | PmhMarkdownParser *parser;
44 | };
45 |
46 | #endif // PMHMARKDOWNPARSERTEST_H
47 |
48 |
--------------------------------------------------------------------------------
/test/unit/snippetcollectiontest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef SNIPPETCOLLECTIONTEST_H
18 | #define SNIPPETCOLLECTIONTEST_H
19 |
20 | #include
21 | #include
22 |
23 |
24 | class SnippetCollectionTest : public QObject
25 | {
26 | Q_OBJECT
27 |
28 | private slots:
29 | void initTestCase();
30 |
31 | void notifiesListenersOfNewSnippets();
32 | void notifiesListenersOfChangedSnippets();
33 | void notifiesListenersOfRemovedSnippets();
34 |
35 | void holdsSnippetsInTriggerOrder();
36 |
37 | void returnsNewCollectionOfUserDefinedSnippets();
38 | void returnsConstantNameOfJsonArray();
39 | void returnsEmptySnippetForNonExistingTrigger();
40 | };
41 |
42 | Q_DECLARE_METATYPE(SnippetCollection::CollectionChangedType) // for QSignalSpy
43 | Q_DECLARE_METATYPE(Snippet) // for QSignalSpy
44 |
45 | #endif // SNIPPETCOLLECTIONTEST_H
46 |
--------------------------------------------------------------------------------
/app-static/completionlistmodel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef COMPLETIONLISTMODEL_H
18 | #define COMPLETIONLISTMODEL_H
19 |
20 | #include
21 | #include
22 | struct Snippet;
23 |
24 |
25 | class CompletionListModel : public QAbstractListModel
26 | {
27 | Q_OBJECT
28 | public:
29 | explicit CompletionListModel(QObject *parent = 0);
30 |
31 | int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
32 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
33 |
34 | void setWords(const QStringList &words);
35 |
36 | public slots:
37 | void snippetCollectionChanged(SnippetCollection::CollectionChangedType changedType, const Snippet &snippet);
38 |
39 | private:
40 | QList snippets;
41 | QStringList words;
42 | };
43 |
44 | #endif // COMPLETIONLISTMODEL_H
45 |
--------------------------------------------------------------------------------
/app-static/slidelinemapping.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Andreas Reischuck
3 | * Copyright 2014 Christian Loose
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | #ifndef SLIDELINEMAPPING_H
19 | #define SLIDELINEMAPPING_H
20 |
21 | #include
22 | #include
23 |
24 |
25 | class SlideLineMapping
26 | {
27 | public:
28 | void build(const QString &code);
29 |
30 | int lineForSlide(const QPair& slide) const;
31 | QPair slideForLine(int lineNumber) const;
32 |
33 | QMap > lineToSlide() const;
34 | QMap, int> slideToLine() const;
35 |
36 | private:
37 | bool isHorizontalSlideSeparator(const QStringList &lines, int lineNumber) const;
38 | bool isVerticalSlideSeparator(const QStringList &lines, int lineNumber) const;
39 |
40 | QMap > m_lineToSlide;
41 | QMap, int> m_slideToLine;
42 | };
43 |
44 | #endif // SLIDELINEMAPPING_H
45 |
--------------------------------------------------------------------------------
/app/highlightworkerthread.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HIGHLIGHTWORKERTHREAD_H
18 | #define HIGHLIGHTWORKERTHREAD_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include "pmh_definitions.h"
26 |
27 | struct Task
28 | {
29 | QString text;
30 | unsigned long offset;
31 | };
32 |
33 | class HighlightWorkerThread : public QThread
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | explicit HighlightWorkerThread(QObject *parent = 0);
39 |
40 | void enqueue(const QString &text, unsigned long offset = 0);
41 |
42 | signals:
43 | void resultReady(pmh_element **elements, unsigned long offset);
44 |
45 | protected:
46 | virtual void run();
47 |
48 | private:
49 | QQueue tasks;
50 | QMutex tasksMutex;
51 | QWaitCondition bufferNotEmpty;
52 | };
53 |
54 | #endif // HIGHLIGHTWORKERTHREAD_H
55 |
--------------------------------------------------------------------------------
/test/integration/hoedownmarkdownconvertertest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HOEDOWNMARKDOWNCONVERTERTEST_H
18 | #define HOEDOWNMARKDOWNCONVERTERTEST_H
19 |
20 | #include
21 |
22 | class HoedownMarkdownConverter;
23 |
24 |
25 | class HoedownMarkdownConverterTest : public QObject
26 | {
27 | Q_OBJECT
28 |
29 | private slots:
30 | void initTestCase();
31 |
32 | void convertsEmptyStringToEmptyHtml();
33 | void convertsMarkdownParagraphToHtml();
34 | void preservesGermanUmlautsInHtml();
35 |
36 | void supportsSuperscriptIfEnabled();
37 | void ignoresSuperscriptIfDisabled();
38 |
39 | void benchmark_data();
40 | void benchmark();
41 | void benchmarkTableOfContents_data();
42 | void benchmarkTableOfContents();
43 |
44 | void cleanupTestCase();
45 |
46 | private:
47 | HoedownMarkdownConverter *converter;
48 | };
49 |
50 | #endif // HOEDOWNMARKDOWNCONVERTERTEST_H
51 |
--------------------------------------------------------------------------------
/app-static/spellchecker/dictionary.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "dictionary.h"
18 |
19 | #include
20 |
21 | Dictionary::Dictionary()
22 | {
23 | }
24 |
25 | Dictionary::Dictionary(const QString &language, const QString &filePath) :
26 | m_language(language),
27 | m_filePath(filePath)
28 | {
29 | }
30 |
31 | Dictionary::Dictionary(const Dictionary &other)
32 | {
33 | m_language = other.m_language;
34 | m_filePath = other.m_filePath;
35 | }
36 |
37 | Dictionary::~Dictionary()
38 | {
39 | }
40 |
41 | QString Dictionary::language() const
42 | {
43 | return m_language;
44 | }
45 |
46 | QString Dictionary::languageName() const
47 | {
48 | return QLocale(m_language).nativeLanguageName();
49 | }
50 |
51 | QString Dictionary::countryName() const
52 | {
53 | return QLocale(m_language).nativeCountryName();
54 | }
55 |
56 | QString Dictionary::filePath() const
57 | {
58 | return m_filePath;
59 | }
60 |
--------------------------------------------------------------------------------
/app/hunspell/spellchecker.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HUNSPELL_SPELLCHECKER_H
18 | #define HUNSPELL_SPELLCHECKER_H
19 |
20 | #include
21 | #include
22 |
23 | class Dictionary;
24 | class Hunspell;
25 | class QTextCodec;
26 |
27 | namespace hunspell {
28 |
29 | class SpellChecker
30 | {
31 | public:
32 | SpellChecker();
33 | ~SpellChecker();
34 |
35 | bool isCorrect(const QString &word);
36 | QStringList suggestions(const QString &word);
37 | void addToUserWordlist(const QString &word);
38 |
39 | void loadDictionary(const QString &dictFilePath);
40 | void loadUserWordlist(const QString &userWordlistPath);
41 |
42 | static QMap availableDictionaries();
43 |
44 | private:
45 | Hunspell *hunspellChecker;
46 | QString userWordlist;
47 | QTextCodec *textCodec;
48 | };
49 |
50 | } // namespace Hunspell
51 |
52 | #endif // HUNSPELL_SPELLCHECKER_H
53 |
--------------------------------------------------------------------------------
/app-static/yamlheaderchecker.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Aetf <7437103@gmail.com>
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include
18 | #include "yamlheaderchecker.h"
19 |
20 | YamlHeaderChecker::YamlHeaderChecker(const QString &text)
21 | {
22 | QRegularExpression rx(R"(^---\s*\n(.*?\n)?(---|\.\.\.)\s*(\n|$))",
23 | QRegularExpression::DotMatchesEverythingOption);
24 | QRegularExpressionMatch match = rx.match(text);
25 | if (match.hasMatch()) {
26 | m_header = match.captured(0);
27 | m_body = text.mid(m_header.length());
28 | } else {
29 | m_body = text;
30 | }
31 | }
32 |
33 | bool YamlHeaderChecker::hasHeader() const
34 | {
35 | return !m_header.isEmpty();
36 | }
37 |
38 | QString YamlHeaderChecker::header() const
39 | {
40 | return m_header;
41 | }
42 |
43 | QString YamlHeaderChecker::body() const
44 | {
45 | return m_body;
46 | }
47 |
48 | int YamlHeaderChecker::bodyOffset() const
49 | {
50 | return m_header.length();
51 | }
52 |
--------------------------------------------------------------------------------
/app/styles/clearness.css:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------
2 | LESS Elements 0.9
3 | ---------------------------------------------------
4 | A set of useful LESS mixins
5 | More info at: http://lesselements.com
6 | ---------------------------------------------------*/
7 | /**
8 | * https://github.com/rhiokim/markdown-css
9 | * solarized-light style
10 | * made by rhio.kim
11 | * powered by http://ethanschoonover.com/solarized
12 | */
13 | body {
14 | padding: 20px;
15 | color: #737373;
16 | font-size: 1em;
17 | font-family: Sans-serif;
18 | background: #ffffff;
19 | -webkit-font-smoothing: antialiased;
20 | }
21 | a {
22 | color: #1e6ea7;
23 | }
24 | a:hover {
25 | color: #268bd2;
26 | }
27 | h1,
28 | h2,
29 | h3,
30 | h4,
31 | h5 {
32 | color: #404040;
33 | }
34 | h2 {
35 | border-bottom: 1px solid #cccccc;
36 | }
37 | h6 {
38 | color: #666666;
39 | }
40 | hr {
41 | border: 1px solid #e6e6e6;
42 | }
43 | pre > code {
44 | /* font-size: .9em;*/
45 | font-family: Consolas, Inconsolata, Courier, monospace;
46 | }
47 | blockquote {
48 | padding: 0 15px;
49 | font-style: italic;
50 | }
51 | blockquote:before {
52 | content: "\201C";
53 | font-size: 40px;
54 | margin-left: -20px;
55 | color: #aaa;
56 | }
57 | table {
58 | background-color: #ffffff;
59 | border-collapse: separate;
60 | border-spacing: 2px;
61 | }
62 | table tr th,
63 | table tr td {
64 | border: 0px;
65 | padding: .2em 1em;
66 | }
67 | table tr th {
68 | border-bottom: 1px solid #bfbfbf;
69 | }
70 | table tr td {
71 | border-bottom: 1px solid #d9d9d9;
72 | }
73 | table tr:nth-child(2n) {
74 | background-color: #ffffff;
75 | }
76 | /**
77 | * after less
78 | */
79 |
--------------------------------------------------------------------------------
/app-static/htmlpreviewcontroller.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef HTMLPREVIEWCONTROLLER_H
18 | #define HTMLPREVIEWCONTROLLER_H
19 |
20 | #include
21 |
22 | class QAction;
23 | class QNetworkDiskCache;
24 | class QWebView;
25 |
26 | class HtmlPreviewController : public QObject
27 | {
28 | Q_OBJECT
29 | public:
30 | explicit HtmlPreviewController(QWebView *view, QObject *parent = 0);
31 |
32 | public slots:
33 | void zoomInView();
34 | void zoomOutView();
35 | void resetZoomOfView();
36 |
37 | private:
38 | void createActions();
39 | QAction *createAction(const QString &text, const QKeySequence &shortcut);
40 | void registerActionsWithView();
41 |
42 | void setupNetworkDiskCache();
43 |
44 | private:
45 | QWebView *view;
46 | QAction *zoomInAction;
47 | QAction *zoomOutAction;
48 | QAction *zoomResetAction;
49 | QNetworkDiskCache *diskCache;
50 | };
51 |
52 | #endif // HTMLPREVIEWCONTROLLER_H
53 |
54 |
--------------------------------------------------------------------------------
/app/snippetcompleter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef SNIPPETCOMPLETER_H
18 | #define SNIPPETCOMPLETER_H
19 |
20 | #include
21 |
22 | class QCompleter;
23 | class SnippetCollection;
24 |
25 |
26 | class SnippetCompleter : public QObject
27 | {
28 | Q_OBJECT
29 | public:
30 | explicit SnippetCompleter(SnippetCollection *collection, QWidget *parentWidget);
31 |
32 | void performCompletion(const QString &textUnderCursor, const QStringList &words, const QRect &popupRect);
33 |
34 | bool isPopupVisible() const;
35 | void hidePopup();
36 |
37 | signals:
38 | void snippetSelected(const QString &trigger, const QString &snippetContent, int newCursorPos);
39 |
40 | private slots:
41 | void insertSnippet(const QString &trigger);
42 |
43 | private:
44 | void replaceClipboardVariable(QString &snippetContent);
45 |
46 | private:
47 | SnippetCollection *snippetCollection;
48 | QCompleter *completer;
49 | };
50 |
51 | #endif // SNIPPETCOMPLETER_H
52 |
--------------------------------------------------------------------------------
/app/aboutdialog.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "aboutdialog.h"
18 | #include "ui_aboutdialog.h"
19 |
20 | static const QString COPYRIGHT = QStringLiteral("Copyright 2013-2016 Christian Loose");
21 | static const QString HOMEPAGE = QStringLiteral("http://cloose.github.io/CuteMarkEd");
22 |
23 | AboutDialog::AboutDialog(QWidget *parent) :
24 | QDialog(parent),
25 | ui(new Ui::AboutDialog)
26 | {
27 | ui->setupUi(this);
28 |
29 | ui->messageLabel->setText(QString("CuteMarkEd
Version %1
").arg(qApp->applicationVersion()));
30 |
31 | const QString description = QString("%1
%2
%3
")
32 | .arg(tr("Qt-based, free and open source markdown editor with live HTML preview"))
33 | .arg(COPYRIGHT)
34 | .arg(HOMEPAGE);
35 | ui->descriptionLabel->setText(description);
36 | }
37 |
38 | AboutDialog::~AboutDialog()
39 | {
40 | delete ui;
41 | }
42 |
--------------------------------------------------------------------------------
/app/template_presentation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/libs/peg-markdown-highlight/pmhmarkdownparser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef PMHMARKDOWNPARSER_H
18 | #define PMHMARKDOWNPARSER_H
19 |
20 | #include
21 | class QString;
22 |
23 | class MarkdownElement
24 | {
25 | public:
26 | enum Type
27 | {
28 | LINK,
29 | AUTO_LINK_URL,
30 | AUTO_LINK_EMAIL,
31 | IMAGE,
32 | CODE,
33 | HTML,
34 | HTML_ENTITY,
35 | EMPHASIZED,
36 | STRONG,
37 | LIST_BULLET,
38 | LIST_ENUMERATOR,
39 | COMMENT,
40 | H1,
41 | H2,
42 | H3,
43 | H4,
44 | H5,
45 | H6,
46 | BLOCKQUOTE,
47 | VERBATIM,
48 | HTMLBLOCK,
49 | HRULE,
50 | REFERENCE,
51 | NOTE
52 | };
53 |
54 | Type type;
55 | unsigned long start;
56 | unsigned long end;
57 | };
58 |
59 | class PmhMarkdownParser
60 | {
61 | public:
62 | QMap > parseMarkdown(const QString &text);
63 | };
64 |
65 | #endif // PMHMARKDOWNPARSER_H
66 |
67 |
--------------------------------------------------------------------------------
/test/unit/dictionarytest.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "dictionarytest.h"
18 |
19 | #include
20 |
21 | #include
22 |
23 | void DictionaryTest::returnsLanguageNameForLanguageCode()
24 | {
25 | Dictionary german("de_DE", "");
26 | QCOMPARE(german.languageName(), QStringLiteral("Deutsch"));
27 |
28 | Dictionary americanEnglish("en_US", "");
29 | // Qt 5.3 and higher uses at least CLDR v24 which introduced long/short
30 | // names for english language variantes
31 | #if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
32 | QCOMPARE(americanEnglish.languageName(), QStringLiteral("U.S. English"));
33 | #else
34 | QCOMPARE(americanEnglish.languageName(), QStringLiteral("American English"));
35 | #endif
36 | }
37 |
38 | void DictionaryTest::returnsCountryNameForLanguage()
39 | {
40 | Dictionary german("de_DE", "");
41 | QCOMPARE(german.countryName(), QStringLiteral("Deutschland"));
42 |
43 | Dictionary americanEnglish("en_US", "");
44 | QCOMPARE(americanEnglish.countryName(), QStringLiteral("United States"));
45 | }
46 |
--------------------------------------------------------------------------------
/libs/peg-markdown-highlight/peg-markdown-highlight.pro:
--------------------------------------------------------------------------------
1 | #
2 | # PEG Markdown Highlight Adapter Static Libary Project for CuteMarkEd
3 | #
4 | # Github : https://github.com/cloose/CuteMarkEd
5 | #
6 |
7 | QT += core gui widgets
8 |
9 | TARGET = pmh-adapter
10 | TEMPLATE = lib
11 | CONFIG += staticlib
12 | CONFIG += c++11
13 |
14 | SOURCES += \
15 | pmhmarkdownparser.cpp \
16 | styleparser.cpp
17 |
18 | HEADERS += \
19 | pmhmarkdownparser.h \
20 | styleparser.h \
21 | definitions.h
22 |
23 | ###################################################################################################
24 | ## DEPENDENCIES
25 | ###################################################################################################
26 |
27 | #
28 | # peg-markdown-highlight
29 | #
30 | win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../3rdparty/peg-markdown-highlight/release/ -lpmh
31 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../3rdparty/peg-markdown-highlight/debug/ -lpmh
32 | else:unix: LIBS += -L$$OUT_PWD/../../3rdparty/peg-markdown-highlight/ -lpmh
33 |
34 | INCLUDEPATH += $$PWD/../../3rdparty/peg-markdown-highlight
35 | DEPENDPATH += $$PWD/../../3rdparty/peg-markdown-highlight
36 |
37 | win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../3rdparty/peg-markdown-highlight/release/libpmh.a
38 | else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../3rdparty/peg-markdown-highlight/debug/libpmh.a
39 | else:win32-msvc*:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../3rdparty/peg-markdown-highlight/release/pmh.lib
40 | else:win32-msvc*:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../3rdparty/peg-markdown-highlight/debug/pmh.lib
41 | else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../3rdparty/peg-markdown-highlight/libpmh.a
42 |
43 |
--------------------------------------------------------------------------------
/test/integration/discountmarkdownconvertertest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef DISCOUNTMARKDOWNCONVERTERTEST_H
18 | #define DISCOUNTMARKDOWNCONVERTERTEST_H
19 |
20 | #include
21 |
22 | class DiscountMarkdownConverter;
23 |
24 |
25 | class DiscountMarkdownConverterTest : public QObject
26 | {
27 | Q_OBJECT
28 |
29 | private slots:
30 | void initTestCase();
31 |
32 | void convertsEmptyStringToEmptyHtml();
33 | void convertsMarkdownParagraphToHtml();
34 | void convertsMarkdownHeaderToHtml();
35 | void preservesGermanUmlautsInHtml();
36 |
37 | void supportsSuperscriptIfEnabled();
38 | void ignoresSuperscriptIfDisabled();
39 |
40 | void benchmark_data();
41 | void benchmark();
42 | void benchmarkTableOfContents_data();
43 | void benchmarkTableOfContents();
44 |
45 | void cleanupTestCase();
46 |
47 | private:
48 | QString transformMarkdownToHtml(const QString &text);
49 | bool isIdAnchorDisabled(const QString &html);
50 | DiscountMarkdownConverter *converter;
51 | };
52 |
53 | #endif // DISCOUNTMARKDOWNCONVERTERTEST_H
54 |
--------------------------------------------------------------------------------
/app/builtin-htmlpreview-themes.json:
--------------------------------------------------------------------------------
1 | {
2 | "themes": [
3 | {
4 | "name": "Default",
5 | "markdownHighlighting": "Default",
6 | "codeHighlighting": "Default",
7 | "previewStylesheet": "Default",
8 | "builtIn": true
9 | },
10 | {
11 | "name": "Github",
12 | "markdownHighlighting": "Default",
13 | "codeHighlighting": "Github",
14 | "previewStylesheet": "Github",
15 | "builtIn": true
16 | },
17 | {
18 | "name": "Solarized Light",
19 | "markdownHighlighting": "Solarized Light",
20 | "codeHighlighting": "Solarized Light",
21 | "previewStylesheet": "Solarized Light",
22 | "builtIn": true
23 | },
24 | {
25 | "name": "Solarized Dark",
26 | "markdownHighlighting": "Solarized Dark",
27 | "codeHighlighting": "Solarized Dark",
28 | "previewStylesheet": "Solarized Dark",
29 | "builtIn": true
30 | },
31 | {
32 | "name": "Clearness",
33 | "markdownHighlighting": "Default",
34 | "codeHighlighting": "Default",
35 | "previewStylesheet": "Clearness",
36 | "builtIn": true
37 | },
38 | {
39 | "name": "Clearness Dark",
40 | "markdownHighlighting": "Clearness Dark",
41 | "codeHighlighting": "Default",
42 | "previewStylesheet": "Clearness Dark",
43 | "builtIn": true
44 | },
45 | {
46 | "name": "Byword Dark",
47 | "markdownHighlighting": "Byword Dark",
48 | "codeHighlighting": "Default",
49 | "previewStylesheet": "Byword Dark",
50 | "builtIn": true
51 | }
52 | ]
53 | }
54 |
--------------------------------------------------------------------------------
/app-static/themes/themecollection.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "themecollection.h"
18 |
19 | #include
20 | #include
21 |
22 | bool ThemeCollection::load(const QString &fileName)
23 | {
24 | return JsonFile::load(fileName, this);
25 | }
26 |
27 | int ThemeCollection::insert(const Theme &theme)
28 | {
29 | themesIndex << theme.name();
30 | themes << theme;
31 | return 0;
32 | }
33 |
34 | int ThemeCollection::count() const
35 | {
36 | return themes.count();
37 | }
38 |
39 | const Theme &ThemeCollection::at(int offset) const
40 | {
41 | return themes.at(offset);
42 | }
43 |
44 | bool ThemeCollection::contains(const QString &name) const
45 | {
46 | return themesIndex.contains(name);
47 | }
48 |
49 | const Theme ThemeCollection::theme(const QString &name) const
50 | {
51 | return at(themesIndex.indexOf(name));
52 | }
53 |
54 | QStringList ThemeCollection::themeNames() const
55 | {
56 | return themesIndex;
57 | }
58 |
59 | const QString ThemeCollection::name() const
60 | {
61 | return QStringLiteral("themes");
62 | }
63 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 | compiler:
3 | - g++
4 | - clang
5 | before_install:
6 | - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test # for g++ 4.8
7 | - sudo add-apt-repository -y ppa:beineri/opt-qt521 # for Qt 5.2
8 | - sudo apt-get update -qq
9 | - "export DISPLAY=:99.0"
10 | - "sh -e /etc/init.d/xvfb start"
11 | install:
12 | - if [ "$CXX" == "g++" ]; then sudo apt-get install -qq g++-4.8; sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90; fi
13 | - sudo apt-get install -qq qt52base qt52declarative qt52webkit qt52tools libhunspell-dev
14 | - sudo apt-get install -qq libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
15 | before_script:
16 | - source /opt/qt52/bin/qt52-env.sh
17 | - lrelease app/translations/cutemarked_cs.ts -qm app/translations/cutemarked_cs.qm
18 | - lrelease app/translations/cutemarked_de.ts -qm app/translations/cutemarked_de.qm
19 | - lrelease app/translations/cutemarked_el.ts -qm app/translations/cutemarked_el.qm
20 | - lrelease app/translations/cutemarked_es.ts -qm app/translations/cutemarked_es.qm
21 | - lrelease app/translations/cutemarked_fr.ts -qm app/translations/cutemarked_fr.qm
22 | - lrelease app/translations/cutemarked_ja.ts -qm app/translations/cutemarked_ja.qm
23 | - lrelease app/translations/cutemarked_pt_BR.ts -qm app/translations/cutemarked_pt_BR.qm
24 | - lrelease app/translations/cutemarked_ru.ts -qm app/translations/cutemarked_ru.qm
25 | - lrelease app/translations/cutemarked_zh_CN.ts -qm app/translations/cutemarked_zh_CN.qm
26 | script:
27 | - cd 3rdparty/discount && ./configure.sh --with-id-anchor && make && sudo make install ; cd ../..
28 | - cd 3rdparty/hoedown && qmake QMAKE_CC=$CC hoedown.pro && make && sudo make install ; cd ../..
29 | - qmake QMAKE_CXX=$CXX CuteMarkEd.pro "CONFIG += with_hoedown"
30 | - make
31 | - make check
32 | - sudo make install
33 |
--------------------------------------------------------------------------------
/app-static/converter/markdowndocument.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are
6 | * met:
7 | *
8 | * (1) Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * (2) Redistributions in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * (3) The name of the author may not be used to
17 | * endorse or promote products derived from this software without
18 | * specific prior written permission.
19 | *
20 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
24 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 | * POSSIBILITY OF SUCH DAMAGE.
31 | */
32 | #ifndef MARKDOWNDOCUMENT_H
33 | #define MARKDOWNDOCUMENT_H
34 |
35 | class MarkdownDocument
36 | {
37 | public:
38 | virtual ~MarkdownDocument() {}
39 | };
40 |
41 | #endif // MARKDOWNDOCUMENT_H
42 |
--------------------------------------------------------------------------------
/app-static/themes/theme.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "theme.h"
18 |
19 | Theme::Theme(const QString &name,
20 | const QString &markdownHighlighting,
21 | const QString &codeHighlighting,
22 | const QString &previewStylesheet,
23 | bool builtIn) :
24 | m_name(name),
25 | m_markdownHighlighting(markdownHighlighting),
26 | m_codeHighlighting(codeHighlighting),
27 | m_previewStylesheet(previewStylesheet),
28 | m_builtIn(builtIn)
29 | {
30 | checkInvariants();
31 | }
32 |
33 | void Theme::checkInvariants() const
34 | {
35 | if (m_name.isEmpty()) {
36 | throw std::runtime_error("theme name must not be empty");
37 | }
38 | if (m_markdownHighlighting.isEmpty()) {
39 | throw std::runtime_error("markdown highlighting style must not be empty");
40 | }
41 | if (m_codeHighlighting.isEmpty()) {
42 | throw std::runtime_error("code highlighting style must not be empty");
43 | }
44 | if (m_previewStylesheet.isEmpty()) {
45 | throw std::runtime_error("preview stylesheet must not be empty");
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/markdownmanipulator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef MARKDOWNMANIPULATOR_H
18 | #define MARKDOWNMANIPULATOR_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | class QChar;
25 | class QPlainTextEdit;
26 | class QStringList;
27 |
28 | class MarkdownManipulator
29 | {
30 | public:
31 | explicit MarkdownManipulator(QPlainTextEdit *editor);
32 |
33 | void wrapSelectedText(const QString &tag);
34 | void wrapCurrentParagraph(const QString &startTag, const QString &endTag);
35 |
36 | void appendToLine(const QString &text);
37 | void prependToLine(const QChar &mark);
38 |
39 | void increaseHeadingLevel();
40 | void decreaseHeadingLevel();
41 |
42 | void formatTextAsQuote();
43 |
44 | void insertTable(int rows, int columns, const QList &alignments, const QList &cells);
45 | void insertImageLink(const QString &alternateText, const QString &imageSource, const QString &optionalTitle = QString());
46 |
47 | private:
48 | void formatBlock(const QChar &mark);
49 |
50 | QPlainTextEdit *editor;
51 | };
52 |
53 | #endif // MARKDOWNMANIPULATOR_H
54 |
--------------------------------------------------------------------------------
/app/tabletooldialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef TABLETOOLDIALOG_H
18 | #define TABLETOOLDIALOG_H
19 |
20 | #include
21 |
22 | #include
23 | #include
24 |
25 | namespace Ui {
26 | class TableToolDialog;
27 | }
28 | class QComboBox;
29 | class QLineEdit;
30 |
31 |
32 | class TableToolDialog : public QDialog
33 | {
34 | Q_OBJECT
35 |
36 | public:
37 | explicit TableToolDialog(QWidget *parent = 0);
38 | ~TableToolDialog();
39 |
40 | int rows() const;
41 | int columns() const;
42 |
43 | QList alignments() const;
44 | QList tableCells() const;
45 |
46 | private slots:
47 | void tableSizeChanged();
48 |
49 | private:
50 | void addColumns(int newColumns);
51 | void removeColumns(int removedColumns);
52 | void addRows(int newRows);
53 | void removeRows(int removedRows);
54 |
55 | void updateTabOrder();
56 |
57 | private:
58 | Ui::TableToolDialog *ui;
59 | int previousRowCount;
60 | int previousColumnCount;
61 | QList alignmentComboBoxList;
62 | QMap cellEditorMap;
63 | };
64 |
65 | #endif // TABLETOOLDIALOG_H
66 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/tomorrow.css:
--------------------------------------------------------------------------------
1 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
2 |
3 | /* Tomorrow Comment */
4 | .hljs-comment,
5 | .hljs-title {
6 | color: #8e908c;
7 | }
8 |
9 | /* Tomorrow Red */
10 | .hljs-variable,
11 | .hljs-attribute,
12 | .hljs-tag,
13 | .hljs-regexp,
14 | .ruby .hljs-constant,
15 | .xml .hljs-tag .hljs-title,
16 | .xml .hljs-pi,
17 | .xml .hljs-doctype,
18 | .html .hljs-doctype,
19 | .css .hljs-id,
20 | .css .hljs-class,
21 | .css .hljs-pseudo {
22 | color: #c82829;
23 | }
24 |
25 | /* Tomorrow Orange */
26 | .hljs-number,
27 | .hljs-preprocessor,
28 | .hljs-pragma,
29 | .hljs-built_in,
30 | .hljs-literal,
31 | .hljs-params,
32 | .hljs-constant {
33 | color: #f5871f;
34 | }
35 |
36 | /* Tomorrow Yellow */
37 | .ruby .hljs-class .hljs-title,
38 | .css .hljs-rules .hljs-attribute {
39 | color: #eab700;
40 | }
41 |
42 | /* Tomorrow Green */
43 | .hljs-string,
44 | .hljs-value,
45 | .hljs-inheritance,
46 | .hljs-header,
47 | .ruby .hljs-symbol,
48 | .xml .hljs-cdata {
49 | color: #718c00;
50 | }
51 |
52 | /* Tomorrow Aqua */
53 | .css .hljs-hexcolor {
54 | color: #3e999f;
55 | }
56 |
57 | /* Tomorrow Blue */
58 | .hljs-function,
59 | .python .hljs-decorator,
60 | .python .hljs-title,
61 | .ruby .hljs-function .hljs-title,
62 | .ruby .hljs-title .hljs-keyword,
63 | .perl .hljs-sub,
64 | .javascript .hljs-title,
65 | .coffeescript .hljs-title {
66 | color: #4271ae;
67 | }
68 |
69 | /* Tomorrow Purple */
70 | .hljs-keyword,
71 | .javascript .hljs-function {
72 | color: #8959a8;
73 | }
74 |
75 | .hljs {
76 | display: block;
77 | overflow-x: auto;
78 | background: white;
79 | color: #4d4d4c;
80 | padding: 0.5em;
81 | -webkit-text-size-adjust: none;
82 | }
83 |
84 | .coffeescript .javascript,
85 | .javascript .xml,
86 | .tex .hljs-formula,
87 | .xml .javascript,
88 | .xml .vbscript,
89 | .xml .css,
90 | .xml .hljs-cdata {
91 | opacity: 0.5;
92 | }
93 |
--------------------------------------------------------------------------------
/app/optionsdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef OPTIONSDIALOG_H
18 | #define OPTIONSDIALOG_H
19 |
20 | #include
21 |
22 | namespace Ui {
23 | class OptionsDialog;
24 | }
25 | class Options;
26 | class SnippetCollection;
27 |
28 |
29 | class OptionsDialog : public QDialog
30 | {
31 | Q_OBJECT
32 |
33 | public:
34 | OptionsDialog(Options *opt, SnippetCollection *collection, const QList &acts, QWidget *parent = 0);
35 | ~OptionsDialog();
36 |
37 | protected:
38 | void done(int result);
39 |
40 | private slots:
41 | void manualProxyRadioButtonToggled(bool checked);
42 | void currentSnippetChanged(const QModelIndex ¤t, const QModelIndex &previous);
43 | void snippetTextChanged();
44 | void addSnippetButtonClicked();
45 | void removeSnippetButtonClicked();
46 | void validateShortcut(int row, int column);
47 |
48 | private:
49 | void setupShortcutsTable();
50 | void readState();
51 | void saveState();
52 |
53 | private:
54 | Ui::OptionsDialog *ui;
55 | Options *options;
56 | SnippetCollection *snippetCollection;
57 | QList actions;
58 | };
59 |
60 | #endif // OPTIONSDIALOG_H
61 |
--------------------------------------------------------------------------------
/app/controls/fileexplorerwidget.cpp:
--------------------------------------------------------------------------------
1 | #include "fileexplorerwidget.h"
2 | #include "ui_fileexplorerwidget.h"
3 |
4 | #include
5 | #include
6 |
7 | class FileSortFilterProxyModel : public QSortFilterProxyModel
8 | {
9 | public:
10 | FileSortFilterProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {}
11 |
12 | protected:
13 | bool lessThan(const QModelIndex &left, const QModelIndex &right) const
14 | {
15 | QFileSystemModel *model = static_cast(this->sourceModel());
16 |
17 | QFileInfo leftInfo = model->fileInfo(left);
18 | QFileInfo rightInfo = model->fileInfo(right);
19 |
20 | if (leftInfo.isDir() == rightInfo.isDir())
21 | return (leftInfo.filePath().compare(rightInfo.filePath(), Qt::CaseInsensitive) < 0);
22 |
23 | return leftInfo.isDir();
24 | }
25 | };
26 |
27 |
28 | FileExplorerWidget::FileExplorerWidget(QWidget *parent) :
29 | QWidget(parent),
30 | ui(new Ui::FileExplorerWidget),
31 | model(new QFileSystemModel(this)),
32 | sortModel(new FileSortFilterProxyModel(this))
33 | {
34 | ui->setupUi(this);
35 |
36 | model->setRootPath("");
37 |
38 | sortModel->setDynamicSortFilter(true);
39 | sortModel->setSourceModel(model);
40 |
41 | ui->fileTreeView->setModel(sortModel);
42 | ui->fileTreeView->hideColumn(1);
43 | ui->fileTreeView->sortByColumn(0, Qt::AscendingOrder);
44 |
45 | connect(ui->fileTreeView, SIGNAL(doubleClicked(QModelIndex)),
46 | SLOT(fileOpen(QModelIndex)));
47 | }
48 |
49 | FileExplorerWidget::~FileExplorerWidget()
50 | {
51 | delete ui;
52 | }
53 |
54 | void FileExplorerWidget::fileOpen(const QModelIndex &index)
55 | {
56 | QFileInfo info = model->fileInfo(sortModel->mapToSource(index));
57 | if (info.isFile()) {
58 | const QString filePath = info.filePath();
59 |
60 | emit fileSelected(filePath);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/libs/peg-markdown-highlight/pmhmarkdownparser.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "pmhmarkdownparser.h"
18 |
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | QMap > PmhMarkdownParser::parseMarkdown(const QString &text)
25 | {
26 | // parse markdown and generate syntax elements
27 | pmh_element **elements;
28 | pmh_markdown_to_elements(text.toUtf8().data(), pmh_EXT_NONE, &elements);
29 |
30 | QMap > elementMap;
31 | for (int i = 0; i < pmh_NUM_LANG_TYPES; i++) {
32 | if (elements[i] != NULL) {
33 | MarkdownElement::Type type = (MarkdownElement::Type)i;
34 | QList list;
35 |
36 | pmh_element *element = elements[i];
37 | while (element != NULL) {
38 | MarkdownElement e;
39 | e.type = type;
40 | e.start = element->pos;
41 | e.end = element->end;
42 | list.append(e);
43 | element = element->next;
44 | }
45 | elementMap[type] = list;
46 | }
47 | }
48 | return elementMap;
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/app/imagetooldialog.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "imagetooldialog.h"
18 | #include "ui_imagetooldialog.h"
19 |
20 | #include
21 | #include
22 |
23 | ImageToolDialog::ImageToolDialog(QWidget *parent) :
24 | QDialog(parent),
25 | ui(new Ui::ImageToolDialog)
26 | {
27 | ui->setupUi(this);
28 | }
29 |
30 | ImageToolDialog::~ImageToolDialog()
31 | {
32 | delete ui;
33 | }
34 |
35 | QString ImageToolDialog::alternateText() const
36 | {
37 | return ui->alternateTextEdit->text();
38 | }
39 |
40 | QString ImageToolDialog::imageSourceLink() const
41 | {
42 | return ui->imageLinkEdit->text();
43 | }
44 |
45 | QString ImageToolDialog::optionalTitle() const
46 | {
47 | return ui->optionalTitleEdit->text();
48 | }
49 |
50 | void ImageToolDialog::chooseFileButtonClicked()
51 | {
52 | QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
53 | QString(),
54 | tr("Images (*.bmp *.gif *.jpg *.jpe *.jpeg *.png *.tif *.tiff *.xpm);;All Files (*)"));
55 | if (!fileName.isEmpty()) {
56 | ui->imageLinkEdit->setText(QUrl::fromLocalFile(fileName).toDisplayString());
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/paraiso.dark.css:
--------------------------------------------------------------------------------
1 | /*
2 | Paraíso (dark)
3 | Created by Jan T. Sott (http://github.com/idleberg)
4 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
5 | */
6 |
7 | /* Paraíso Comment */
8 | .hljs-comment,
9 | .hljs-title {
10 | color: #8d8687;
11 | }
12 |
13 | /* Paraíso Red */
14 | .hljs-variable,
15 | .hljs-attribute,
16 | .hljs-tag,
17 | .hljs-regexp,
18 | .ruby .hljs-constant,
19 | .xml .hljs-tag .hljs-title,
20 | .xml .hljs-pi,
21 | .xml .hljs-doctype,
22 | .html .hljs-doctype,
23 | .css .hljs-id,
24 | .css .hljs-class,
25 | .css .hljs-pseudo {
26 | color: #ef6155;
27 | }
28 |
29 | /* Paraíso Orange */
30 | .hljs-number,
31 | .hljs-preprocessor,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #f99b15;
37 | }
38 |
39 | /* Paraíso Yellow */
40 | .ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #fec418;
43 | }
44 |
45 | /* Paraíso Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #48b685;
53 | }
54 |
55 | /* Paraíso Aqua */
56 | .css .hljs-hexcolor {
57 | color: #5bc4bf;
58 | }
59 |
60 | /* Paraíso Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #06b6ef;
70 | }
71 |
72 | /* Paraíso Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #815ba4;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #2f1e2e;
82 | color: #a39e9b;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/paraiso.light.css:
--------------------------------------------------------------------------------
1 | /*
2 | Paraíso (light)
3 | Created by Jan T. Sott (http://github.com/idleberg)
4 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
5 | */
6 |
7 | /* Paraíso Comment */
8 | .hljs-comment,
9 | .hljs-title {
10 | color: #776e71;
11 | }
12 |
13 | /* Paraíso Red */
14 | .hljs-variable,
15 | .hljs-attribute,
16 | .hljs-tag,
17 | .hljs-regexp,
18 | .ruby .hljs-constant,
19 | .xml .hljs-tag .hljs-title,
20 | .xml .hljs-pi,
21 | .xml .hljs-doctype,
22 | .html .hljs-doctype,
23 | .css .hljs-id,
24 | .css .hljs-class,
25 | .css .hljs-pseudo {
26 | color: #ef6155;
27 | }
28 |
29 | /* Paraíso Orange */
30 | .hljs-number,
31 | .hljs-preprocessor,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #f99b15;
37 | }
38 |
39 | /* Paraíso Yellow */
40 | .ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #fec418;
43 | }
44 |
45 | /* Paraíso Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #48b685;
53 | }
54 |
55 | /* Paraíso Aqua */
56 | .css .hljs-hexcolor {
57 | color: #5bc4bf;
58 | }
59 |
60 | /* Paraíso Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #06b6ef;
70 | }
71 |
72 | /* Paraíso Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #815ba4;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #e7e9db;
82 | color: #4f424c;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app-static/themes/theme.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef THEME_H
18 | #define THEME_H
19 |
20 | #include
21 | #include
22 |
23 |
24 | class Theme
25 | {
26 | public:
27 | Theme(const QString &name,
28 | const QString &markdownHighlighting,
29 | const QString &codeHighlighting,
30 | const QString &previewStylesheet,
31 | bool builtIn = false);
32 |
33 | QString name() const { return m_name; }
34 |
35 | QString markdownHighlighting() const { return m_markdownHighlighting; }
36 |
37 | QString codeHighlighting() const { return m_codeHighlighting; }
38 |
39 | QString previewStylesheet() const { return m_previewStylesheet; }
40 |
41 | bool isBuiltIn() const { return m_builtIn; }
42 |
43 | bool operator<(const Theme &rhs) const
44 | {
45 | return m_name < rhs.name();
46 | }
47 |
48 | bool operator ==(const Theme &rhs) const
49 | {
50 | return m_name == rhs.name();
51 | }
52 |
53 | private:
54 | void checkInvariants() const;
55 |
56 | private:
57 | QString m_name;
58 | QString m_markdownHighlighting;
59 | QString m_codeHighlighting;
60 | QString m_previewStylesheet;
61 | bool m_builtIn;
62 | };
63 |
64 | #endif // THEME_H
65 |
--------------------------------------------------------------------------------
/app/snippetstablemodel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef SNIPPETSTABLEMODEL_H
18 | #define SNIPPETSTABLEMODEL_H
19 |
20 | #include
21 |
22 | struct Snippet;
23 | class SnippetCollection;
24 |
25 | class SnippetsTableModel : public QAbstractTableModel
26 | {
27 | Q_OBJECT
28 | public:
29 | SnippetsTableModel(SnippetCollection *collection, QObject *parent);
30 | ~SnippetsTableModel() {}
31 |
32 | int rowCount(const QModelIndex &parent = QModelIndex()) const;
33 | int columnCount(const QModelIndex &parent = QModelIndex()) const;
34 | Qt::ItemFlags flags(const QModelIndex &index) const;
35 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
36 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
37 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
38 |
39 | QModelIndex createSnippet();
40 | void removeSnippet(const QModelIndex &index);
41 |
42 | private:
43 | void replaceSnippet(const Snippet &snippet, const QModelIndex &index);
44 | bool isValidTrigger(const QString &trigger);
45 |
46 | private:
47 | SnippetCollection *snippetCollection;
48 | };
49 |
50 | #endif // SNIPPETSTABLEMODEL_H
51 |
--------------------------------------------------------------------------------
/app-static/snippets/snippetcollection.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef SNIPPETCOLLECTION_H
18 | #define SNIPPETCOLLECTION_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include "snippet.h"
24 |
25 |
26 | class SnippetCollection : public QObject, public JsonCollection
27 | {
28 | Q_OBJECT
29 | Q_ENUMS(CollectionChangedType)
30 |
31 | public:
32 | enum CollectionChangedType
33 | {
34 | ItemAdded,
35 | ItemChanged,
36 | ItemDeleted
37 | };
38 |
39 | explicit SnippetCollection(QObject *parent = 0);
40 |
41 | int count() const;
42 |
43 | int insert(const Snippet& snippet);
44 | void update(const Snippet& snippet);
45 | void remove(const Snippet& snippet);
46 |
47 | const QString name() const;
48 | bool contains(const QString &trigger) const;
49 | const Snippet snippet(const QString &trigger) const;
50 | const Snippet &at(int offset) const;
51 |
52 | QSharedPointer userDefinedSnippets() const;
53 |
54 | signals:
55 | void collectionChanged(SnippetCollection::CollectionChangedType changedType, const Snippet &snippet);
56 |
57 | private:
58 | QMap snippets;
59 | };
60 |
61 | #endif // SNIPPETCOLLECTION_H
62 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/vs.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Visual Studio-like style based on original C# coloring by Jason Diamond
4 |
5 | */
6 | .hljs {
7 | display: block;
8 | overflow-x: auto;
9 | padding: 0.5em;
10 | background: white;
11 | color: black;
12 | -webkit-text-size-adjust: none;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-annotation,
17 | .hljs-template_comment,
18 | .diff .hljs-header,
19 | .hljs-chunk,
20 | .apache .hljs-cbracket {
21 | color: #008000;
22 | }
23 |
24 | .hljs-keyword,
25 | .hljs-id,
26 | .hljs-built_in,.css
27 | .smalltalk .hljs-class,
28 | .hljs-winutils,
29 | .bash .hljs-variable,
30 | .tex .hljs-command,
31 | .hljs-request,
32 | .hljs-status,
33 | .nginx .hljs-title,
34 | .xml .hljs-tag,
35 | .xml .hljs-tag .hljs-value {
36 | color: #00f;
37 | }
38 |
39 | .hljs-string,
40 | .hljs-title,
41 | .hljs-parent,
42 | .hljs-tag .hljs-value,
43 | .hljs-rules .hljs-value,
44 | .ruby .hljs-symbol,
45 | .ruby .hljs-symbol .hljs-string,
46 | .hljs-template_tag,
47 | .django .hljs-variable,
48 | .hljs-addition,
49 | .hljs-flow,
50 | .hljs-stream,
51 | .apache .hljs-tag,
52 | .hljs-date,
53 | .tex .hljs-formula,
54 | .coffeescript .hljs-attribute {
55 | color: #a31515;
56 | }
57 |
58 | .ruby .hljs-string,
59 | .hljs-decorator,
60 | .hljs-filter .hljs-argument,
61 | .hljs-localvars,
62 | .hljs-array,
63 | .hljs-attr_selector,
64 | .hljs-pseudo,
65 | .hljs-pi,
66 | .hljs-doctype,
67 | .hljs-deletion,
68 | .hljs-envvar,
69 | .hljs-shebang,
70 | .hljs-preprocessor,
71 | .hljs-pragma,
72 | .userType,
73 | .apache .hljs-sqbracket,
74 | .nginx .hljs-built_in,
75 | .tex .hljs-special,
76 | .hljs-prompt {
77 | color: #2b91af;
78 | }
79 |
80 | .hljs-phpdoc,
81 | .hljs-dartdoc,
82 | .hljs-javadoc,
83 | .hljs-xmlDocTag {
84 | color: #808080;
85 | }
86 |
87 | .hljs-type,
88 | .hljs-typename { font-weight: bold; }
89 |
90 | .vhdl .hljs-string { color: #666666; }
91 | .vhdl .hljs-literal { color: #a31515; }
92 | .vhdl .hljs-attribute { color: #00b0e8; }
93 |
94 | .xml .hljs-attribute { color: #f00; }
95 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/kimbie.dark.css:
--------------------------------------------------------------------------------
1 | /*
2 | Name: Kimbie (dark)
3 | Author: Jan T. Sott
4 | License: Creative Commons Attribution-ShareAlike 4.0 Unported License
5 | URL: https://github.com/idleberg/Kimbie-highlight.js
6 | */
7 |
8 | /* Kimbie Comment */
9 | .hljs-comment,
10 | .hljs-title {
11 | color: #d6baad;
12 | }
13 |
14 | /* Kimbie Red */
15 | .hljs-variable,
16 | .hljs-attribute,
17 | .hljs-tag,
18 | .hljs-regexp,
19 | .ruby .hljs-constant,
20 | .xml .hljs-tag .hljs-title,
21 | .xml .hljs-pi,
22 | .xml .hljs-doctype,
23 | .html .hljs-doctype,
24 | .css .hljs-id,
25 | .css .hljs-class,
26 | .css .hljs-pseudo {
27 | color: #dc3958;
28 | }
29 |
30 | /* Kimbie Orange */
31 | .hljs-number,
32 | .hljs-preprocessor,
33 | .hljs-built_in,
34 | .hljs-literal,
35 | .hljs-params,
36 | .hljs-constant {
37 | color: #f79a32;
38 | }
39 |
40 | /* Kimbie Yellow */
41 | .ruby .hljs-class .hljs-title,
42 | .css .hljs-rules .hljs-attribute {
43 | color: #f06431;
44 | }
45 |
46 | /* Kimbie Green */
47 | .hljs-string,
48 | .hljs-value,
49 | .hljs-inheritance,
50 | .hljs-header,
51 | .ruby .hljs-symbol,
52 | .xml .hljs-cdata {
53 | color: #889b4a;
54 | }
55 |
56 | /* Kimbie Aqua */
57 | .css .hljs-hexcolor {
58 | color: #088649;
59 | }
60 |
61 | /* Kimbie Blue */
62 | .hljs-function,
63 | .python .hljs-decorator,
64 | .python .hljs-title,
65 | .ruby .hljs-function .hljs-title,
66 | .ruby .hljs-title .hljs-keyword,
67 | .perl .hljs-sub,
68 | .javascript .hljs-title,
69 | .coffeescript .hljs-title {
70 | color: #8ab1b0;
71 | }
72 |
73 | /* Kimbie Purple */
74 | .hljs-keyword,
75 | .javascript .hljs-function {
76 | color: #98676a;
77 | }
78 |
79 | .hljs {
80 | display: block;
81 | overflow-x: auto;
82 | background: #221a0f;
83 | color: #d3af86;
84 | padding: 0.5em;
85 | -webkit-text-size-adjust: none;
86 | }
87 |
88 | .coffeescript .javascript,
89 | .javascript .xml,
90 | .tex .hljs-formula,
91 | .xml .javascript,
92 | .xml .vbscript,
93 | .xml .css,
94 | .xml .hljs-cdata {
95 | opacity: 0.5;
96 | }
97 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/kimbie.light.css:
--------------------------------------------------------------------------------
1 | /*
2 | Name: Kimbie (light)
3 | Author: Jan T. Sott
4 | License: Creative Commons Attribution-ShareAlike 4.0 Unported License
5 | URL: https://github.com/idleberg/Kimbie-highlight.js
6 | */
7 |
8 | /* Kimbie Comment */
9 | .hljs-comment,
10 | .hljs-title {
11 | color: #a57a4c;
12 | }
13 |
14 | /* Kimbie Red */
15 | .hljs-variable,
16 | .hljs-attribute,
17 | .hljs-tag,
18 | .hljs-regexp,
19 | .ruby .hljs-constant,
20 | .xml .hljs-tag .hljs-title,
21 | .xml .hljs-pi,
22 | .xml .hljs-doctype,
23 | .html .hljs-doctype,
24 | .css .hljs-id,
25 | .css .hljs-class,
26 | .css .hljs-pseudo {
27 | color: #dc3958;
28 | }
29 |
30 | /* Kimbie Orange */
31 | .hljs-number,
32 | .hljs-preprocessor,
33 | .hljs-built_in,
34 | .hljs-literal,
35 | .hljs-params,
36 | .hljs-constant {
37 | color: #f79a32;
38 | }
39 |
40 | /* Kimbie Yellow */
41 | .ruby .hljs-class .hljs-title,
42 | .css .hljs-rules .hljs-attribute {
43 | color: #f06431;
44 | }
45 |
46 | /* Kimbie Green */
47 | .hljs-string,
48 | .hljs-value,
49 | .hljs-inheritance,
50 | .hljs-header,
51 | .ruby .hljs-symbol,
52 | .xml .hljs-cdata {
53 | color: #889b4a;
54 | }
55 |
56 | /* Kimbie Aqua */
57 | .css .hljs-hexcolor {
58 | color: #088649;
59 | }
60 |
61 | /* Kimbie Blue */
62 | .hljs-function,
63 | .python .hljs-decorator,
64 | .python .hljs-title,
65 | .ruby .hljs-function .hljs-title,
66 | .ruby .hljs-title .hljs-keyword,
67 | .perl .hljs-sub,
68 | .javascript .hljs-title,
69 | .coffeescript .hljs-title {
70 | color: #8ab1b0;
71 | }
72 |
73 | /* Kimbie Purple */
74 | .hljs-keyword,
75 | .javascript .hljs-function {
76 | color: #98676a;
77 | }
78 |
79 | .hljs {
80 | display: block;
81 | overflow-x: auto;
82 | background: #fbebd4;
83 | color: #84613d;
84 | padding: 0.5em;
85 | -webkit-text-size-adjust: none;
86 | }
87 |
88 | .coffeescript .javascript,
89 | .javascript .xml,
90 | .tex .hljs-formula,
91 | .xml .javascript,
92 | .xml .vbscript,
93 | .xml .css,
94 | .xml .hljs-cdata {
95 | opacity: 0.5;
96 | }
97 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/tomorrow-night-bright.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Bright Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
4 |
5 | /* Tomorrow Comment */
6 | .hljs-comment,
7 | .hljs-title {
8 | color: #969896;
9 | }
10 |
11 | /* Tomorrow Red */
12 | .hljs-variable,
13 | .hljs-attribute,
14 | .hljs-tag,
15 | .hljs-regexp,
16 | .ruby .hljs-constant,
17 | .xml .hljs-tag .hljs-title,
18 | .xml .hljs-pi,
19 | .xml .hljs-doctype,
20 | .html .hljs-doctype,
21 | .css .hljs-id,
22 | .css .hljs-class,
23 | .css .hljs-pseudo {
24 | color: #d54e53;
25 | }
26 |
27 | /* Tomorrow Orange */
28 | .hljs-number,
29 | .hljs-preprocessor,
30 | .hljs-pragma,
31 | .hljs-built_in,
32 | .hljs-literal,
33 | .hljs-params,
34 | .hljs-constant {
35 | color: #e78c45;
36 | }
37 |
38 | /* Tomorrow Yellow */
39 | .ruby .hljs-class .hljs-title,
40 | .css .hljs-rules .hljs-attribute {
41 | color: #e7c547;
42 | }
43 |
44 | /* Tomorrow Green */
45 | .hljs-string,
46 | .hljs-value,
47 | .hljs-inheritance,
48 | .hljs-header,
49 | .ruby .hljs-symbol,
50 | .xml .hljs-cdata {
51 | color: #b9ca4a;
52 | }
53 |
54 | /* Tomorrow Aqua */
55 | .css .hljs-hexcolor {
56 | color: #70c0b1;
57 | }
58 |
59 | /* Tomorrow Blue */
60 | .hljs-function,
61 | .python .hljs-decorator,
62 | .python .hljs-title,
63 | .ruby .hljs-function .hljs-title,
64 | .ruby .hljs-title .hljs-keyword,
65 | .perl .hljs-sub,
66 | .javascript .hljs-title,
67 | .coffeescript .hljs-title {
68 | color: #7aa6da;
69 | }
70 |
71 | /* Tomorrow Purple */
72 | .hljs-keyword,
73 | .javascript .hljs-function {
74 | color: #c397d8;
75 | }
76 |
77 | .hljs {
78 | display: block;
79 | overflow-x: auto;
80 | background: black;
81 | color: #eaeaea;
82 | padding: 0.5em;
83 | -webkit-text-size-adjust: none;
84 | }
85 |
86 | .coffeescript .javascript,
87 | .javascript .xml,
88 | .tex .hljs-formula,
89 | .xml .javascript,
90 | .xml .vbscript,
91 | .xml .css,
92 | .xml .hljs-cdata {
93 | opacity: 0.5;
94 | }
95 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/tomorrow-night-eighties.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Eighties Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
4 |
5 | /* Tomorrow Comment */
6 | .hljs-comment,
7 | .hljs-title {
8 | color: #999999;
9 | }
10 |
11 | /* Tomorrow Red */
12 | .hljs-variable,
13 | .hljs-attribute,
14 | .hljs-tag,
15 | .hljs-regexp,
16 | .ruby .hljs-constant,
17 | .xml .hljs-tag .hljs-title,
18 | .xml .hljs-pi,
19 | .xml .hljs-doctype,
20 | .html .hljs-doctype,
21 | .css .hljs-id,
22 | .css .hljs-class,
23 | .css .hljs-pseudo {
24 | color: #f2777a;
25 | }
26 |
27 | /* Tomorrow Orange */
28 | .hljs-number,
29 | .hljs-preprocessor,
30 | .hljs-pragma,
31 | .hljs-built_in,
32 | .hljs-literal,
33 | .hljs-params,
34 | .hljs-constant {
35 | color: #f99157;
36 | }
37 |
38 | /* Tomorrow Yellow */
39 | .ruby .hljs-class .hljs-title,
40 | .css .hljs-rules .hljs-attribute {
41 | color: #ffcc66;
42 | }
43 |
44 | /* Tomorrow Green */
45 | .hljs-string,
46 | .hljs-value,
47 | .hljs-inheritance,
48 | .hljs-header,
49 | .ruby .hljs-symbol,
50 | .xml .hljs-cdata {
51 | color: #99cc99;
52 | }
53 |
54 | /* Tomorrow Aqua */
55 | .css .hljs-hexcolor {
56 | color: #66cccc;
57 | }
58 |
59 | /* Tomorrow Blue */
60 | .hljs-function,
61 | .python .hljs-decorator,
62 | .python .hljs-title,
63 | .ruby .hljs-function .hljs-title,
64 | .ruby .hljs-title .hljs-keyword,
65 | .perl .hljs-sub,
66 | .javascript .hljs-title,
67 | .coffeescript .hljs-title {
68 | color: #6699cc;
69 | }
70 |
71 | /* Tomorrow Purple */
72 | .hljs-keyword,
73 | .javascript .hljs-function {
74 | color: #cc99cc;
75 | }
76 |
77 | .hljs {
78 | display: block;
79 | overflow-x: auto;
80 | background: #2d2d2d;
81 | color: #cccccc;
82 | padding: 0.5em;
83 | -webkit-text-size-adjust: none;
84 | }
85 |
86 | .coffeescript .javascript,
87 | .javascript .xml,
88 | .tex .hljs-formula,
89 | .xml .javascript,
90 | .xml .vbscript,
91 | .xml .css,
92 | .xml .hljs-cdata {
93 | opacity: 0.5;
94 | }
95 |
--------------------------------------------------------------------------------
/app-static/snippets/jsonsnippettranslator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "jsonsnippettranslator.h"
18 |
19 | #include "snippet.h"
20 |
21 | namespace {
22 |
23 | static const QLatin1String TRIGGER("trigger");
24 | static const QLatin1String DESCRIPTION("description");
25 | static const QLatin1String SNIPPET("snippet");
26 | static const QLatin1String CURSOR("cursor");
27 | static const QLatin1String BUILTIN("builtIn");
28 |
29 | }
30 |
31 |
32 | Snippet JsonSnippetTranslator::fromJsonObject(const QJsonObject &object)
33 | {
34 | Snippet snippet;
35 |
36 | snippet.trigger = object.value(TRIGGER).toString();
37 | snippet.description = object.value(DESCRIPTION).toString();
38 | snippet.snippet = object.value(SNIPPET).toString();
39 | snippet.cursorPosition = object.value(CURSOR).toDouble();
40 | snippet.builtIn = object.value(BUILTIN).toBool();
41 |
42 | return snippet;
43 | }
44 |
45 | QJsonObject JsonSnippetTranslator::toJsonObject(const Snippet &snippet)
46 | {
47 | QJsonObject object;
48 |
49 | object.insert(TRIGGER, snippet.trigger);
50 | object.insert(DESCRIPTION, snippet.description);
51 | object.insert(SNIPPET, snippet.snippet);
52 | object.insert(CURSOR, snippet.cursorPosition);
53 | object.insert(BUILTIN, snippet.builtIn);
54 |
55 | return object;
56 | }
57 |
--------------------------------------------------------------------------------
/test/unit/snippettest.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "snippettest.h"
18 |
19 | #include
20 |
21 | #include
22 |
23 | void SnippetTest::isLessThanComparable()
24 | {
25 | Snippet snippet1;
26 | snippet1.trigger = "abc";
27 |
28 | Snippet snippet2;
29 | snippet2.trigger = "xyz";
30 |
31 | QCOMPARE(snippet1 < snippet2, true);
32 | QCOMPARE(snippet2 < snippet1, false);
33 | QCOMPARE(snippet1 < snippet1, false);
34 | }
35 |
36 | void SnippetTest::isEqualComparable()
37 | {
38 | Snippet snippet1;
39 | snippet1.trigger = "abc";
40 | snippet1.description = "description 1";
41 |
42 | Snippet snippet2;
43 | snippet2.trigger = "abc";
44 | snippet2.description = "description 2";
45 |
46 | Snippet snippet3;
47 | snippet3.trigger = "xyz";
48 | snippet3.description = "description 1";
49 |
50 | QCOMPARE(snippet1 == snippet1, true);
51 | QCOMPARE(snippet1 == snippet2, true);
52 | QCOMPARE(snippet1 == snippet3, false);
53 | }
54 |
55 | void SnippetTest::isInitializedAfterCreation()
56 | {
57 | Snippet snippet;
58 | QVERIFY(snippet.trigger.isNull());
59 | QVERIFY(snippet.description.isNull());
60 | QVERIFY(snippet.snippet.isNull());
61 | QCOMPARE(snippet.cursorPosition, 0);
62 | QCOMPARE(snippet.builtIn, false);
63 | }
64 |
--------------------------------------------------------------------------------
/app/hunspell/spellchecker_win.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "spellchecker.h"
18 | using hunspell::SpellChecker;
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include
26 | #include
27 |
28 | QMap SpellChecker::availableDictionaries()
29 | {
30 | QMap dictionaries;
31 |
32 | QStringList paths = DataLocation::standardLocations();
33 | paths << qApp->applicationDirPath();
34 |
35 | foreach (const QString &path, paths) {
36 | QDir dictPath(path + QDir::separator() + "dictionaries");
37 | dictPath.setFilter(QDir::Files);
38 | dictPath.setNameFilters(QStringList() << "*.dic");
39 | if (dictPath.exists()) {
40 | // loop over all dictionaries in directory
41 | QDirIterator it(dictPath);
42 | while (it.hasNext()) {
43 | it.next();
44 |
45 | QString language = it.fileName().remove(".dic");
46 | language.truncate(5); // just language and country code
47 |
48 | Dictionary dict(it.fileName(), it.filePath());
49 | dictionaries.insert(language, dict);
50 | }
51 | }
52 | }
53 |
54 | return dictionaries;
55 | }
56 |
--------------------------------------------------------------------------------
/app-static/revealviewsynchronizer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Andreas Reischuck
3 | * Copyright 2014 Christian Loose
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | #ifndef REVEALVIEWSYNCHRONIZER_H
19 | #define REVEALVIEWSYNCHRONIZER_H
20 |
21 | #include "viewsynchronizer.h"
22 |
23 | #include
24 |
25 | class SlideLineMapping;
26 |
27 |
28 | class RevealViewSynchronizer : public ViewSynchronizer
29 | {
30 | Q_OBJECT
31 | Q_PROPERTY(int horizontalSlide READ horizontalSlide NOTIFY gotoSlideRequested)
32 | Q_PROPERTY(int verticalSlide READ verticalSlide NOTIFY gotoSlideRequested)
33 |
34 | public:
35 | RevealViewSynchronizer(QWebView *webView, QPlainTextEdit *editor);
36 | ~RevealViewSynchronizer();
37 |
38 | int horizontalSlide() const;
39 | int verticalSlide() const;
40 |
41 | signals:
42 | void gotoSlideRequested(int horizontal, int vertical);
43 |
44 | public slots:
45 | void slideChanged(int horizontal, int vertical);
46 |
47 | private slots:
48 | void registerEvents();
49 | void restoreSlidePosition();
50 | void cursorPositionChanged();
51 | void textChanged();
52 |
53 | private:
54 | void gotoLine(int lineNumber);
55 | void gotoSlide(QPair slide);
56 |
57 | private:
58 | QPair currentSlide;
59 | SlideLineMapping *slideLineMapping;
60 | };
61 |
62 | #endif // REVEALVIEWSYNCHRONIZER_H
63 |
64 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/tomorrow-night.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Theme */
2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
5 |
6 | /* Tomorrow Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #969896;
10 | }
11 |
12 | /* Tomorrow Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #cc6666;
26 | }
27 |
28 | /* Tomorrow Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #de935f;
37 | }
38 |
39 | /* Tomorrow Yellow */
40 | .ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #f0c674;
43 | }
44 |
45 | /* Tomorrow Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #b5bd68;
53 | }
54 |
55 | /* Tomorrow Aqua */
56 | .css .hljs-hexcolor {
57 | color: #8abeb7;
58 | }
59 |
60 | /* Tomorrow Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #81a2be;
70 | }
71 |
72 | /* Tomorrow Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #b294bb;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #1d1f21;
82 | color: #c5c8c6;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/tomorrow-night-blue.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Blue Theme */
2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
5 |
6 | /* Tomorrow Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #7285b7;
10 | }
11 |
12 | /* Tomorrow Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #ff9da4;
26 | }
27 |
28 | /* Tomorrow Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #ffc58f;
37 | }
38 |
39 | /* Tomorrow Yellow */
40 | .ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #ffeead;
43 | }
44 |
45 | /* Tomorrow Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #d1f1a9;
53 | }
54 |
55 | /* Tomorrow Aqua */
56 | .css .hljs-hexcolor {
57 | color: #99ffff;
58 | }
59 |
60 | /* Tomorrow Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #bbdaff;
70 | }
71 |
72 | /* Tomorrow Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #ebbbff;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #002451;
82 | color: white;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/rainbow.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Style with support for rainbow parens
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #474949;
12 | color: #d1d9e1;
13 | -webkit-text-size-adjust: none;
14 | }
15 |
16 |
17 | .hljs-body,
18 | .hljs-collection {
19 | color: #d1d9e1;
20 | }
21 |
22 | .hljs-comment,
23 | .hljs-template_comment,
24 | .diff .hljs-header,
25 | .hljs-doctype,
26 | .lisp .hljs-string,
27 | .hljs-javadoc {
28 | color: #969896;
29 | font-style: italic;
30 | }
31 |
32 | .hljs-keyword,
33 | .clojure .hljs-attribute,
34 | .hljs-winutils,
35 | .javascript .hljs-title,
36 | .hljs-addition,
37 | .css .hljs-tag {
38 | color: #cc99cc;
39 | }
40 |
41 | .hljs-number { color: #f99157; }
42 |
43 | .hljs-command,
44 | .hljs-string,
45 | .hljs-tag .hljs-value,
46 | .hljs-phpdoc,
47 | .hljs-dartdoc,
48 | .tex .hljs-formula,
49 | .hljs-regexp,
50 | .hljs-hexcolor {
51 | color: #8abeb7;
52 | }
53 |
54 | .hljs-title,
55 | .hljs-localvars,
56 | .hljs-function .hljs-title,
57 | .hljs-chunk,
58 | .hljs-decorator,
59 | .hljs-built_in,
60 | .hljs-identifier {
61 | color: #b5bd68;
62 | }
63 |
64 | .hljs-class .hljs-keyword {
65 | color: #f2777a;
66 | }
67 |
68 | .hljs-variable,
69 | .smalltalk .hljs-number,
70 | .hljs-constant,
71 | .hljs-class .hljs-title,
72 | .hljs-parent,
73 | .haskell .hljs-label,
74 | .hljs-id {
75 | color: #ffcc66;
76 | }
77 |
78 | .hljs-tag .hljs-title,
79 | .hljs-rules .hljs-property,
80 | .django .hljs-tag .hljs-keyword {
81 | font-weight: bold;
82 | }
83 |
84 | .hljs-attribute {
85 | color: #81a2be;
86 | }
87 |
88 | .hljs-preprocessor,
89 | .hljs-pragma,
90 | .hljs-pi,
91 | .hljs-shebang,
92 | .hljs-symbol,
93 | .hljs-symbol .hljs-string,
94 | .diff .hljs-change,
95 | .hljs-special,
96 | .hljs-attr_selector,
97 | .hljs-important,
98 | .hljs-subst,
99 | .hljs-cdata {
100 | color: #f99157;
101 | }
102 |
103 | .hljs-deletion {
104 | color: #dc322f;
105 | }
106 |
107 | .tex .hljs-formula {
108 | background: #eee8d5;
109 | }
110 |
--------------------------------------------------------------------------------
/test/integration/themecollectiontest.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "themecollectiontest.h"
18 |
19 | #include
20 |
21 | #include
22 |
23 | void ThemeCollectionTest::initTestCase()
24 | {
25 | themeFile = new QTemporaryFile(this);
26 | if (!themeFile->open())
27 | QFAIL("Failed to create temporary theme file");
28 |
29 | QTextStream out(themeFile);
30 | out << "{ \"themes\": ["
31 | << " { \"name\": \"default\","
32 | << " \"markdownHighlighting\": \"default\","
33 | << " \"codeHighlighting\": \"default\","
34 | << " \"previewStylesheet\": \"default\" },"
35 | << " { \"name\": \"dark\","
36 | << " \"markdownHighlighting\": \"dark\","
37 | << " \"codeHighlighting\": \"black\","
38 | << " \"previewStylesheet\": \"dark\" } ] }";
39 | }
40 |
41 | void ThemeCollectionTest::cleanupTestCase()
42 | {
43 | themeFile->close();
44 | }
45 |
46 | void ThemeCollectionTest::loadsThemesFromFileIntoCollection()
47 | {
48 | ThemeCollection themeCollection;
49 |
50 | themeCollection.load(themeFile->fileName());
51 |
52 | QStringList themeNames = themeCollection.themeNames();
53 | QCOMPARE(themeNames.count(), 2);
54 | QCOMPARE(themeNames.at(0), QLatin1String("default"));
55 | QCOMPARE(themeNames.at(1), QLatin1String("dark"));
56 | }
57 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/ir_black.css:
--------------------------------------------------------------------------------
1 | /*
2 | IR_Black style (c) Vasily Mikhailitchenko
3 | */
4 |
5 | .hljs {
6 | display: block;
7 | overflow-x: auto;
8 | padding: 0.5em;
9 | background: #000;
10 | color: #f8f8f8;
11 | -webkit-text-size-adjust: none;
12 | }
13 |
14 | .hljs-shebang,
15 | .hljs-comment,
16 | .hljs-template_comment,
17 | .hljs-javadoc {
18 | color: #7c7c7c;
19 | }
20 |
21 | .hljs-keyword,
22 | .hljs-tag,
23 | .tex .hljs-command,
24 | .hljs-request,
25 | .hljs-status,
26 | .clojure .hljs-attribute {
27 | color: #96cbfe;
28 | }
29 |
30 | .hljs-sub .hljs-keyword,
31 | .method,
32 | .hljs-list .hljs-title,
33 | .nginx .hljs-title {
34 | color: #ffffb6;
35 | }
36 |
37 | .hljs-string,
38 | .hljs-tag .hljs-value,
39 | .hljs-cdata,
40 | .hljs-filter .hljs-argument,
41 | .hljs-attr_selector,
42 | .apache .hljs-cbracket,
43 | .hljs-date,
44 | .coffeescript .hljs-attribute {
45 | color: #a8ff60;
46 | }
47 |
48 | .hljs-subst {
49 | color: #daefa3;
50 | }
51 |
52 | .hljs-regexp {
53 | color: #e9c062;
54 | }
55 |
56 | .hljs-title,
57 | .hljs-sub .hljs-identifier,
58 | .hljs-pi,
59 | .hljs-decorator,
60 | .tex .hljs-special,
61 | .hljs-type,
62 | .hljs-constant,
63 | .smalltalk .hljs-class,
64 | .hljs-javadoctag,
65 | .hljs-yardoctag,
66 | .hljs-phpdoc,
67 | .hljs-dartdoc,
68 | .nginx .hljs-built_in {
69 | color: #ffffb6;
70 | }
71 |
72 | .hljs-symbol,
73 | .ruby .hljs-symbol .hljs-string,
74 | .hljs-number,
75 | .hljs-variable,
76 | .vbscript,
77 | .hljs-literal {
78 | color: #c6c5fe;
79 | }
80 |
81 | .css .hljs-tag {
82 | color: #96cbfe;
83 | }
84 |
85 | .css .hljs-rules .hljs-property,
86 | .css .hljs-id {
87 | color: #ffffb6;
88 | }
89 |
90 | .css .hljs-class {
91 | color: #fff;
92 | }
93 |
94 | .hljs-hexcolor {
95 | color: #c6c5fe;
96 | }
97 |
98 | .hljs-number {
99 | color:#ff73fd;
100 | }
101 |
102 | .coffeescript .javascript,
103 | .javascript .xml,
104 | .tex .hljs-formula,
105 | .xml .javascript,
106 | .xml .vbscript,
107 | .xml .css,
108 | .xml .hljs-cdata {
109 | opacity: 0.7;
110 | }
111 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/codepen-embed.css:
--------------------------------------------------------------------------------
1 | /*
2 | codepen.io Embed Theme
3 | Author: Justin Perry
4 | Original theme - https://github.com/chriskempson/tomorrow-theme
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #222;
12 | color: #fff;
13 | font-family: Menlo, Monaco, 'Andale Mono', 'Lucida Console', 'Courier New', monospace;
14 | -webkit-text-size-adjust: none;
15 | }
16 |
17 | .hljs-comment,
18 | .hljs-title {
19 | color: #777;
20 | }
21 |
22 | .hljs-variable,
23 | .hljs-attribute,
24 | .hljs-tag,
25 | .hljs-regexp,
26 | .ruby .constant,
27 | .xml .tag .title,
28 | .xml .pi,
29 | .xml .doctype,
30 | .html .doctype {
31 | color: #ab875d;
32 | }
33 |
34 | .css .value {
35 | color: #cd6a51;
36 | }
37 |
38 | .css .value .function,
39 | .css .value .string {
40 | color: #a67f59;
41 | }
42 |
43 | .css .value .number {
44 | color: #9b869c;
45 | }
46 |
47 | .css .id,
48 | .css .class,
49 | .css-pseudo,
50 | .css .selector,
51 | .css .tag {
52 | color: #dfc48c;
53 | }
54 |
55 | .hljs-number,
56 | .hljs-preprocessor,
57 | .hljs-built_in,
58 | .hljs-literal,
59 | .hljs-params,
60 | .hljs-constant {
61 | color: #ab875d;
62 | }
63 |
64 | .ruby .class .title,
65 | .css .rules .attribute {
66 | color: #9b869b;
67 | }
68 |
69 | .hljs-string,
70 | .hljs-value,
71 | .hljs-inheritance,
72 | .hljs-header,
73 | .ruby .symbol,
74 | .xml .cdata {
75 | color: #8f9c6c;
76 | }
77 |
78 | .css .hexcolor {
79 | color: #cd6a51;
80 | }
81 |
82 | .function,
83 | .python .decorator,
84 | .python .title,
85 | .ruby .function .title,
86 | .ruby .title .keyword,
87 | .perl .sub,
88 | .javascript .title,
89 | .coffeescript .title {
90 | color: #fff;
91 | }
92 |
93 | .hljs-keyword,
94 | .javascript .function {
95 | color: #8f9c6c;
96 | }
97 |
98 | .coffeescript .javascript,
99 | .javascript,
100 | .javascript .xml,
101 | .tex .formula,
102 | .xml .javascript,
103 | .xml .vbscript,
104 | .xml .css,
105 | .xml .cdata {
106 | background: transparent;
107 | opacity: 1;
108 | }
109 |
--------------------------------------------------------------------------------
/app-static/themes/jsonthemetranslator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #include "jsonthemetranslator.h"
18 |
19 | namespace {
20 |
21 | static const QLatin1String NAME("name");
22 | static const QLatin1String MARKDOWN_HIGHLIGHTING("markdownHighlighting");
23 | static const QLatin1String CODE_HIGHLIGHTING("codeHighlighting");
24 | static const QLatin1String PREVIEW_STYLESHEET("previewStylesheet");
25 | static const QLatin1String BUILT_IN("builtIn");
26 |
27 | }
28 |
29 | Theme JsonThemeTranslator::fromJsonObject(const QJsonObject &object)
30 | {
31 | QString name = object.value(NAME).toString();
32 | QString markdownHighlighting = object.value(MARKDOWN_HIGHLIGHTING).toString();
33 | QString codeHighlighting = object.value(CODE_HIGHLIGHTING).toString();
34 | QString previewStylesheet = object.value(PREVIEW_STYLESHEET).toString();
35 | bool builtIn = object.value(BUILT_IN).toBool();
36 |
37 | return { name, markdownHighlighting, codeHighlighting, previewStylesheet, builtIn };
38 | }
39 |
40 | QJsonObject JsonThemeTranslator::toJsonObject(const Theme &theme)
41 | {
42 | QJsonObject object;
43 | object.insert(NAME, theme.name());
44 | object.insert(MARKDOWN_HIGHLIGHTING, theme.markdownHighlighting());
45 | object.insert(CODE_HIGHLIGHTING, theme.codeHighlighting());
46 | object.insert(PREVIEW_STYLESHEET, theme.previewStylesheet());
47 | object.insert(BUILT_IN, theme.isBuiltIn());
48 |
49 | return object;
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/atelier-dune.dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Dune Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 | /* https://github.com/jmblog/color-themes-for-highlightjs */
5 |
6 | /* Atelier Dune Dark Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #999580;
10 | }
11 |
12 | /* Atelier Dune Dark Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #d73737;
26 | }
27 |
28 | /* Atelier Dune Dark Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #b65611;
37 | }
38 |
39 | /* Atelier Dune Dark Yellow */
40 | .ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #cfb017;
43 | }
44 |
45 | /* Atelier Dune Dark Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #60ac39;
53 | }
54 |
55 | /* Atelier Dune Dark Aqua */
56 | .css .hljs-hexcolor {
57 | color: #1fad83;
58 | }
59 |
60 | /* Atelier Dune Dark Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #6684e1;
70 | }
71 |
72 | /* Atelier Dune Dark Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #b854d4;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #292824;
82 | color: #a6a28c;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/atelier-dune.light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Dune Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 | /* https://github.com/jmblog/color-themes-for-highlightjs */
5 |
6 | /* Atelier Dune Light Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #7d7a68;
10 | }
11 |
12 | /* Atelier Dune Light Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #d73737;
26 | }
27 |
28 | /* Atelier Dune Light Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #b65611;
37 | }
38 |
39 | /* Atelier Dune Light Yellow */
40 | .hljs-ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #cfb017;
43 | }
44 |
45 | /* Atelier Dune Light Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #60ac39;
53 | }
54 |
55 | /* Atelier Dune Light Aqua */
56 | .css .hljs-hexcolor {
57 | color: #1fad83;
58 | }
59 |
60 | /* Atelier Dune Light Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #6684e1;
70 | }
71 |
72 | /* Atelier Dune Light Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #b854d4;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #fefbec;
82 | color: #6e6b5e;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/atelier-heath.dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Heath Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 | /* https://github.com/jmblog/color-themes-for-highlightjs */
5 |
6 | /* Atelier Heath Dark Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #9e8f9e;
10 | }
11 |
12 | /* Atelier Heath Dark Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #ca402b;
26 | }
27 |
28 | /* Atelier Heath Dark Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #a65926;
37 | }
38 |
39 | /* Atelier Heath Dark Yellow */
40 | .hljs-ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #bb8a35;
43 | }
44 |
45 | /* Atelier Heath Dark Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #379a37;
53 | }
54 |
55 | /* Atelier Heath Dark Aqua */
56 | .css .hljs-hexcolor {
57 | color: #159393;
58 | }
59 |
60 | /* Atelier Heath Dark Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #516aec;
70 | }
71 |
72 | /* Atelier Heath Dark Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #7b59c0;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #292329;
82 | color: #ab9bab;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/atelier-forest.dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Forest Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 | /* https://github.com/jmblog/color-themes-for-highlightjs */
5 |
6 | /* Atelier Forest Dark Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #9c9491;
10 | }
11 |
12 | /* Atelier Forest Dark Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #f22c40;
26 | }
27 |
28 | /* Atelier Forest Dark Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #df5320;
37 | }
38 |
39 | /* Atelier Forest Dark Yellow */
40 | .hljs-ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #d5911a;
43 | }
44 |
45 | /* Atelier Forest Dark Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #5ab738;
53 | }
54 |
55 | /* Atelier Forest Dark Aqua */
56 | .css .hljs-hexcolor {
57 | color: #00ad9c;
58 | }
59 |
60 | /* Atelier Forest Dark Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #407ee7;
70 | }
71 |
72 | /* Atelier Forest Dark Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #6666ea;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #2c2421;
82 | color: #a8a19f;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/atelier-heath.light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Heath Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 | /* https://github.com/jmblog/color-themes-for-highlightjs */
5 |
6 | /* Atelier Heath Light Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #776977;
10 | }
11 |
12 | /* Atelier Heath Light Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #ca402b;
26 | }
27 |
28 | /* Atelier Heath Light Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #a65926;
37 | }
38 |
39 | /* Atelier Heath Light Yellow */
40 | .hljs-ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #bb8a35;
43 | }
44 |
45 | /* Atelier Heath Light Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #379a37;
53 | }
54 |
55 | /* Atelier Heath Light Aqua */
56 | .css .hljs-hexcolor {
57 | color: #159393;
58 | }
59 |
60 | /* Atelier Heath Light Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #516aec;
70 | }
71 |
72 | /* Atelier Heath Light Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #7b59c0;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #f7f3f7;
82 | color: #695d69;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/atelier-forest.light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Forest Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 | /* https://github.com/jmblog/color-themes-for-highlightjs */
5 |
6 | /* Atelier Forest Light Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #766e6b;
10 | }
11 |
12 | /* Atelier Forest Light Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #f22c40;
26 | }
27 |
28 | /* Atelier Forest Light Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #df5320;
37 | }
38 |
39 | /* Atelier Forest Light Yellow */
40 | .hljs-ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #d5911a;
43 | }
44 |
45 | /* Atelier Forest Light Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #5ab738;
53 | }
54 |
55 | /* Atelier Forest Light Aqua */
56 | .css .hljs-hexcolor {
57 | color: #00ad9c;
58 | }
59 |
60 | /* Atelier Forest Light Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #407ee7;
70 | }
71 |
72 | /* Atelier Forest Light Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #6666ea;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #f1efee;
82 | color: #68615e;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/atelier-seaside.dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Seaside Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 | /* https://github.com/jmblog/color-themes-for-highlightjs */
5 |
6 | /* Atelier Seaside Dark Comment */
7 | .hljs-comment,
8 | .hljs-title {
9 | color: #809980;
10 | }
11 |
12 | /* Atelier Seaside Dark Red */
13 | .hljs-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-regexp,
17 | .ruby .hljs-constant,
18 | .xml .hljs-tag .hljs-title,
19 | .xml .hljs-pi,
20 | .xml .hljs-doctype,
21 | .html .hljs-doctype,
22 | .css .hljs-id,
23 | .css .hljs-class,
24 | .css .hljs-pseudo {
25 | color: #e6193c;
26 | }
27 |
28 | /* Atelier Seaside Dark Orange */
29 | .hljs-number,
30 | .hljs-preprocessor,
31 | .hljs-pragma,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-params,
35 | .hljs-constant {
36 | color: #87711d;
37 | }
38 |
39 | /* Atelier Seaside Dark Yellow */
40 | .hljs-ruby .hljs-class .hljs-title,
41 | .css .hljs-rules .hljs-attribute {
42 | color: #c3c322;
43 | }
44 |
45 | /* Atelier Seaside Dark Green */
46 | .hljs-string,
47 | .hljs-value,
48 | .hljs-inheritance,
49 | .hljs-header,
50 | .ruby .hljs-symbol,
51 | .xml .hljs-cdata {
52 | color: #29a329;
53 | }
54 |
55 | /* Atelier Seaside Dark Aqua */
56 | .css .hljs-hexcolor {
57 | color: #1999b3;
58 | }
59 |
60 | /* Atelier Seaside Dark Blue */
61 | .hljs-function,
62 | .python .hljs-decorator,
63 | .python .hljs-title,
64 | .ruby .hljs-function .hljs-title,
65 | .ruby .hljs-title .hljs-keyword,
66 | .perl .hljs-sub,
67 | .javascript .hljs-title,
68 | .coffeescript .hljs-title {
69 | color: #3d62f5;
70 | }
71 |
72 | /* Atelier Seaside Dark Purple */
73 | .hljs-keyword,
74 | .javascript .hljs-function {
75 | color: #ad2bee;
76 | }
77 |
78 | .hljs {
79 | display: block;
80 | overflow-x: auto;
81 | background: #242924;
82 | color: #8ca68c;
83 | padding: 0.5em;
84 | -webkit-text-size-adjust: none;
85 | }
86 |
87 | .coffeescript .javascript,
88 | .javascript .xml,
89 | .tex .hljs-formula,
90 | .xml .javascript,
91 | .xml .vbscript,
92 | .xml .css,
93 | .xml .hljs-cdata {
94 | opacity: 0.5;
95 | }
96 |
--------------------------------------------------------------------------------
/app/markdownhighlighter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Christian Loose
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | #ifndef MARKDOWNHIGHLIGHTER_H
18 | #define MARKDOWNHIGHLIGHTER_H
19 |
20 | #include
21 |
22 | #include "pmh_definitions.h"
23 | #include "peg-markdown-highlight/definitions.h"
24 | #include "highlightworkerthread.h"
25 |
26 | namespace hunspell {
27 | class SpellChecker;
28 | }
29 |
30 | class MarkdownHighlighter : public QSyntaxHighlighter
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | MarkdownHighlighter(QTextDocument *document, hunspell::SpellChecker *spellChecker);
36 | ~MarkdownHighlighter();
37 |
38 | void reset();
39 | void setStyles(const QVector &styles);
40 | void setSpellingCheckEnabled(bool enabled);
41 | void setYamlHeaderSupportEnabled(bool enabled);
42 |
43 | protected:
44 | void highlightBlock(const QString &textBlock) Q_DECL_OVERRIDE;
45 |
46 | private slots:
47 | void resultReady(pmh_element **elements, unsigned long base_offset);
48 |
49 | private:
50 | void applyFormat(unsigned long pos, unsigned long end, QTextCharFormat format, bool merge);
51 | void checkSpelling(const QString &textBlock);
52 |
53 | HighlightWorkerThread *workerThread;
54 | QVector highlightingStyles;
55 | QString previousText;
56 | QTextCharFormat spellFormat;
57 | hunspell::SpellChecker *spellChecker;
58 | bool spellingCheckEnabled;
59 | bool yamlHeaderSupportEnabled;
60 | };
61 |
62 | #endif // MARKDOWNHIGHLIGHTER_H
63 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/solarized_dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #002b36;
12 | color: #839496;
13 | -webkit-text-size-adjust: none;
14 | }
15 |
16 | .hljs-comment,
17 | .hljs-template_comment,
18 | .diff .hljs-header,
19 | .hljs-doctype,
20 | .hljs-pi,
21 | .lisp .hljs-string,
22 | .hljs-javadoc {
23 | color: #586e75;
24 | }
25 |
26 | /* Solarized Green */
27 | .hljs-keyword,
28 | .hljs-winutils,
29 | .method,
30 | .hljs-addition,
31 | .css .hljs-tag,
32 | .hljs-request,
33 | .hljs-status,
34 | .nginx .hljs-title {
35 | color: #859900;
36 | }
37 |
38 | /* Solarized Cyan */
39 | .hljs-number,
40 | .hljs-command,
41 | .hljs-string,
42 | .hljs-tag .hljs-value,
43 | .hljs-rules .hljs-value,
44 | .hljs-phpdoc,
45 | .hljs-dartdoc,
46 | .tex .hljs-formula,
47 | .hljs-regexp,
48 | .hljs-hexcolor,
49 | .hljs-link_url {
50 | color: #2aa198;
51 | }
52 |
53 | /* Solarized Blue */
54 | .hljs-title,
55 | .hljs-localvars,
56 | .hljs-chunk,
57 | .hljs-decorator,
58 | .hljs-built_in,
59 | .hljs-identifier,
60 | .vhdl .hljs-literal,
61 | .hljs-id,
62 | .css .hljs-function {
63 | color: #268bd2;
64 | }
65 |
66 | /* Solarized Yellow */
67 | .hljs-attribute,
68 | .hljs-variable,
69 | .lisp .hljs-body,
70 | .smalltalk .hljs-number,
71 | .hljs-constant,
72 | .hljs-class .hljs-title,
73 | .hljs-parent,
74 | .hljs-type,
75 | .hljs-link_reference {
76 | color: #b58900;
77 | }
78 |
79 | /* Solarized Orange */
80 | .hljs-preprocessor,
81 | .hljs-preprocessor .hljs-keyword,
82 | .hljs-pragma,
83 | .hljs-shebang,
84 | .hljs-symbol,
85 | .hljs-symbol .hljs-string,
86 | .diff .hljs-change,
87 | .hljs-special,
88 | .hljs-attr_selector,
89 | .hljs-subst,
90 | .hljs-cdata,
91 | .css .hljs-pseudo,
92 | .hljs-header {
93 | color: #cb4b16;
94 | }
95 |
96 | /* Solarized Red */
97 | .hljs-deletion,
98 | .hljs-important {
99 | color: #dc322f;
100 | }
101 |
102 | /* Solarized Violet */
103 | .hljs-link_label {
104 | color: #6c71c4;
105 | }
106 |
107 | .tex .hljs-formula {
108 | background: #073642;
109 | }
110 |
--------------------------------------------------------------------------------
/app/scripts/highlight.js/styles/solarized_light.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull