Skip to content

Commit

Permalink
Autolinking and macOS updates pull request #1255 from dvorka/dev/1.52.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorka authored Mar 8, 2020
2 parents 8cc3a10 + 29de855 commit 18c5618
Show file tree
Hide file tree
Showing 82 changed files with 926 additions and 498 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "doc"]
path = doc
url = https://github.com/dvorka/mindforger-repository.git
[submodule "deps/discount"]
path = deps/discount
url = https://github.com/dvorka/discount.git
[submodule "deps/mitie"]
path = deps/mitie
url = https://github.com/dvorka/MITIE.git
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ script: # make lib unit tests > run lib unit tests > make MF > install MF
- cd "${M8RHOME}"
- eval "${MATRIX_EVAL}"
- cd deps/cmark-gfm && mkdir -v build && cd build && cmake -DCMARK_TESTS=OFF -DCMARK_SHARED=OFF .. && cmake --build . && cd ../../..
- "cd deps/discount && ./configure.sh && make ; cd ../.."
- "echo \"M8RDEBUG: g++ compiler is set to: ${CXX}\""
- cd lib/test # UNIT tests
- qmake -r CONFIG+=mfnocxx CONFIG+=mfunits QMAKE_CXX=${CXX} mindforger-lib-unit-tests.pro
Expand Down
13 changes: 7 additions & 6 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ Big thanks to 3rd party FOSS content authors:
* Qt Company ([Qt](https://www.qt.io/) - lib and code)
* Christian Loose ([CuteMarkEd](https://cloose.github.io/CuteMarkEd/) - inspiration and code)
* GitHub ([CMark GFM](https://github.com/github/cmark-gfm) - Markdown rendering - library)
* David Parsons ([Discount](http://www.pell.portland.or.us/~orc/Code/discount/) - Markdown rendering - library)
* NetBSD Foundation (strptime - Windows port - lib)
* Toni Ronkko (dirent - Windows port - lib)
* Microsoft (getopt - Windows port - lib)
* Jordan Russell ([jrsoftware.org](http://jrsoftware.org) - Windows installer framework)
* Davis E. King ([MITIE](https://github.com/mit-nlp/MITIE) - AI/NLP library and tools for information extraction - library)
* Jean-loup Gailly, Mark Adler ([Zlib](https://sourceforge.net/projects/gnuwin32/) - library)
* David Parsons ([Discount](http://www.pell.portland.or.us/~orc/Code/discount/) - Markdown rendering - library used in the past)
* Google ([Google C++ unit testing framework](https://github.com/google/googletest))
* Knut Sveidqvist ([Mermaid.js](https://mermaidjs.github.io/) - diagrams and flowcharts rendering in HTML)
* AMS and SIAM ([MathJax.js](https://www.mathjax.org/) - math rendering in HTML)
* Ivan Sagalaev ([Highlight.js](https://highlightjs.org/) - source code syntax highlighting)
* Danny Allen (primary [icon theme](https://store.kde.org/content/show.php?content=18317) store.kde.com - icons)
* Krita (https://github.com/KDE/krita - menu icons)
* Krita (https://github.com/KDE/krita - menu icons - remixed)
* Travis CI ([travis-ci.org](https://travis-ci.org/) - continous integration tests and builds infra - Ubuntu, macOS)
* AppVeyor CI ([appveyor.com](https://www.appveyor.com/) - continous integration tests and builds infra - Windows)
* Raimund Hocke ([SikuliX](http://sikulix.com/)- GUI automation testing)
Expand All @@ -41,18 +41,19 @@ See [licenses](./licenses) folder for 3rd party content licensing details.
Acknowledgements to researchers:

* Karel Moulik (long term vision and ideas, consultations)
* Gekaremi (comprehensive AI/NLP research, ideas and suggestions)
* Tomas Sieger (MindForger applications ideas, consultations)
* Gekaremi (comprehensive AI/NLP research, ideas and suggestions)

Acknowledgements to reviewers and testers:
Acknowledgements to reviewers, testers and supporters:

* Tomas 'Floex' Dvorak (review, testing)
* Ivan Kudibal (review, adoption and project support)
* Stefan Pacinda (review, testing)
* Petr Kozelka (MacBook borrowing, consultations)
* Tomas 'Floex' Dvorak (review, testing)
* Honza Odstrcil (feedback)

Special thanks to:

* Bjarne Stroustrup (C++ - for inspiring visions and being the authority behind C++ language)
* Linus Torvalds (Linux and Git - for being inspiration and strong opinions)
* Richard Stallman (GNU and GNU GPL - for passionate software freedom activism)

6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2020-03-08 Martin Dvorak <[email protected]>

* Released v1.52.0 - Production quality Autolinking (cmark-gfm and Trie based),
macOS improvements (keyboard shortcuts, drag & drop, key characters, ...),
discount (MD to HTML processor) removal.

2020-02-16 Martin Dvorak <[email protected]>

* Released v1.51.0 - Live HTML preview, (partially) fixed Mermed diagrams,
Expand Down
10 changes: 10 additions & 0 deletions KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
MindForger known issues - see also
[GitHub issues](https://github.com/dvorka/mindforger/issues?q=is%3Aissue+is%3Aopen+label%3A%22bug+%3Abeetle%3A%22).

# 1.52.0

* Autolinking can break MathJax code blocks/text integrity in Markdown text.
* CSV support does not scale and can block the application
* Windows Server R2 2012: empty MF documentation repository in wrong location when MF is launched
at the end of installation.
* Notebook HTML export doesn't export local images: links to filesystem are kept intact, images
are not copied.
* Frontend memleaks.

# 1.51.0

* CSV support does not scale and can block the application
Expand Down
6 changes: 3 additions & 3 deletions PAD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
</Company_Info>
<Program_Info>
<Program_Name>MindForger</Program_Name>
<Program_Version>1.51.0</Program_Version>
<Program_Release_Month>01</Program_Release_Month>
<Program_Release_Day>01</Program_Release_Day>
<Program_Version>1.52.0</Program_Version>
<Program_Release_Month>03</Program_Release_Month>
<Program_Release_Day>08</Program_Release_Day>
<Program_Release_Year>2020</Program_Release_Year>
<Program_Cost_Dollars />
<Program_Cost_Other_Code />
Expand Down
38 changes: 18 additions & 20 deletions app/app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,29 @@ win32 {
LIBS += -L$$OUT_PWD/../lib -lmindforger
}

# Markdown to HTML: Discount if mfmd2htmldiscount and not Windows otherwise cmark-gfm
# Markdown to HTML: cmark-gfm (or nothing)
!mfnomd2html {
# cmark-gfm
DEFINES += MF_MD_2_HTML_CMARK

win32 {
CONFIG(release, debug|release) {
LIBS += -L$$PWD/../deps/cmark-gfm/build/src/Release -lcmark-gfm_static
LIBS += -L$$PWD/../deps/cmark-gfm/build/extensions/Release -lcmark-gfm-extensions_static
LIBS += -L$$PWD/../deps/cmark-gfm/build/src/Release -lcmark-gfm_static
LIBS += -L$$PWD/../deps/cmark-gfm/build/extensions/Release -lcmark-gfm-extensions_static
} else:CONFIG(debug, debug|release) {
LIBS += -L$$PWD/../deps/cmark-gfm/build/src/Debug -lcmark-gfm_static
LIBS += -L$$PWD/../deps/cmark-gfm/build/extensions/Debug -lcmark-gfm-extensions_static
}
} else:mfmd2htmldiscount {
# MF must link against ldiscount.a (built in ../deps/discount) - NOT lmarkdown
LIBS += -L$$OUT_PWD/../deps/discount -ldiscount
} else {
# cmark-gfm

# cmark-gfm to be built by qmake to enable clean system build for Launchpad debuild
libcmark-gfm.target = libcmark-gfm
libcmark-gfm.commands = cd -L$$PWD/../deps/cmark-gfm && mkdir -v build && cd build && cmake -DCMARK_TESTS=OFF -DCMARK_SHARED=OFF .. && cmake --build .
libcmark-gfm_clean.commands = cd -L$$PWD/../deps/cmark-gfm rm -rvf build
QT_EXTRA_TARGETS += libcmark-gfm

LIBS += -L$$PWD/../deps/cmark-gfm/build/extensions -lcmark-gfm-extensions
LIBS += -L$$PWD/../deps/cmark-gfm/build/src -lcmark-gfm
LIBS += -L$$PWD/../deps/cmark-gfm/build/src/Debug -lcmark-gfm_static
LIBS += -L$$PWD/../deps/cmark-gfm/build/extensions/Debug -lcmark-gfm-extensions_static
}
} else {
# cmark-gfm to be built by qmake to enable clean system build for Launchpad debuild
libcmark-gfm.target = libcmark-gfm
libcmark-gfm.commands = cd -L$$PWD/../deps/cmark-gfm && mkdir -v build && cd build && cmake -DCMARK_TESTS=OFF -DCMARK_SHARED=OFF .. && cmake --build .
libcmark-gfm_clean.commands = cd -L$$PWD/../deps/cmark-gfm rm -rvf build
QT_EXTRA_TARGETS += libcmark-gfm

LIBS += -L$$PWD/../deps/cmark-gfm/build/extensions -lcmark-gfm-extensions
LIBS += -L$$PWD/../deps/cmark-gfm/build/src -lcmark-gfm
}
}

# NER library
Expand Down
6 changes: 6 additions & 0 deletions app/src/qt/dialogs/configuration_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ ConfigurationDialog::ViewerTab::ViewerTab(QWidget *parent)

mathSupportCheck = new QCheckBox{tr("math support"), this};

fullOPreviewCheck = new QCheckBox{tr("whole notebook preview"), this};

diagramSupportLabel = new QLabel(tr("Diagram support")+":", this),
diagramSupportCombo = new QComboBox{this};
diagramSupportCombo->addItem(QString{"disable"});
Expand All @@ -208,6 +210,7 @@ ConfigurationDialog::ViewerTab::ViewerTab(QWidget *parent)
viewerLayout->addWidget(diagramSupportCombo);
viewerLayout->addWidget(srcCodeHighlightSupportCheck);
viewerLayout->addWidget(mathSupportCheck);
viewerLayout->addWidget(fullOPreviewCheck);
viewerGroup->setLayout(viewerLayout);

QVBoxLayout* boxesLayout = new QVBoxLayout{this};
Expand All @@ -224,6 +227,7 @@ ConfigurationDialog::ViewerTab::~ViewerTab()
delete zoomSpin;
delete srcCodeHighlightSupportCheck;
delete mathSupportCheck;
delete fullOPreviewCheck;
delete diagramSupportLabel;
delete diagramSupportCombo;
}
Expand All @@ -238,6 +242,7 @@ void ConfigurationDialog::ViewerTab::refresh()
zoomSpin->setValue(config.getUiHtmlZoom());
srcCodeHighlightSupportCheck->setChecked(config.isUiEnableSrcHighlightInMd());
mathSupportCheck->setChecked(config.isUiEnableMathInMd());
fullOPreviewCheck->setChecked(config.isUiFullOPreview());
diagramSupportCombo->setCurrentIndex(config.getUiEnableDiagramsInMd());
}

Expand All @@ -247,6 +252,7 @@ void ConfigurationDialog::ViewerTab::save()
config.setUiHtmlZoom(zoomSpin->value());
config.setUiEnableSrcHighlightInMd(srcCodeHighlightSupportCheck->isChecked());
config.setUiEnableMathInMd(mathSupportCheck->isChecked());
config.setUiFullOPreview(fullOPreviewCheck->isChecked());
config.setUiEnableDiagramsInMd(static_cast<Configuration::JavaScriptLibSupport>(diagramSupportCombo->currentIndex()));
}

Expand Down
1 change: 1 addition & 0 deletions app/src/qt/dialogs/configuration_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class ConfigurationDialog::ViewerTab : public QWidget
QLabel* zoomLabel;
QSpinBox* zoomSpin;
QCheckBox* mathSupportCheck;
QCheckBox* fullOPreviewCheck;
QLabel* diagramSupportLabel;
QComboBox* diagramSupportCombo;
QCheckBox* srcCodeHighlightSupportCheck;
Expand Down
14 changes: 13 additions & 1 deletion app/src/qt/dialogs/insert_image_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ InsertImageDialog::InsertImageDialog(QWidget* parent)

findFileButton = new QPushButton{tr("File")};
copyToRepoCheckBox = new QCheckBox{tr("copy image to repository")};
copyToRepoCheckBox->setChecked(true);
copyToRepoCheckBox->setEnabled(true);

// IMPROVE disable/enable find button if text/path is valid: freedom vs validation
Expand Down Expand Up @@ -73,7 +74,8 @@ InsertImageDialog::~InsertImageDialog()
{
}

void InsertImageDialog::show() {
void InsertImageDialog::show()
{
alternateTextEdit->setText(tr("Image"));
alternateTextEdit->selectAll();
alternateTextEdit->setFocus();
Expand All @@ -82,6 +84,16 @@ void InsertImageDialog::show() {
QDialog::show();
}

void InsertImageDialog::show(const QString& text, const QString& link)
{
pathEdit->setText(link);
alternateTextEdit->setText(text);
alternateTextEdit->selectAll();
alternateTextEdit->setFocus();

QDialog::show();
}

void InsertImageDialog::handleFindFile()
{
QString homeDirectory
Expand Down
1 change: 1 addition & 0 deletions app/src/qt/dialogs/insert_image_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class InsertImageDialog : public QDialog
~InsertImageDialog();

void show();
void show(const QString& text, const QString& link);
QPushButton* getInsertButton() const { return insertButton; }
QString getAlternateText() { return alternateTextEdit->text(); }
QString getPathText() { return pathEdit->text(); }
Expand Down
1 change: 1 addition & 0 deletions app/src/qt/dialogs/insert_link_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ InsertLinkDialog::InsertLinkDialog(QWidget* parent)
findDirectoryButton = new QPushButton{tr("Directory")};

copyToRepoCheckBox = new QCheckBox{tr("copy link target to repository")};
copyToRepoCheckBox->setChecked(true);
copyToRepoCheckBox->setEnabled(true);

// IMPROVE disable/enable find button if text/path is valid: freedom vs validation
Expand Down
35 changes: 31 additions & 4 deletions app/src/qt/gear/apple_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
* - OS keyboard, naming, filesystem, process, ... conventions.
* - OS specifics.
*
* Keyboard modifiers:
* Keyboard modifiers (common):
*
* - Control (or Ctrl) ⌃
* - Option (or Alt) ⌥
* - Command (or Cmd ~ Win key) ⌘
* - Shift ⇧
* - Caps Lock ⇪
* - Fn
*
* Common keyboard shortcuts:
*
Expand All @@ -45,8 +44,6 @@
*
* - ifdef __APPLE__ / if defined(__APPLE__)
*
*
*
* Qt
*
* enum Qt::Modifier:
Expand All @@ -59,6 +56,36 @@
* Qt KEY_META -> macOS control (CTRL)
* Qt KEY_ALT -> macos option (OPTION)
*
* Keyboard unicode & entities (all):
*
* HTML Entity GLYPH NAME
* &#63743;  Apple
* &#8984; ⌘ Command, Cmd, Clover, (formerly) Apple
* &#8963; ⌃ Control, Ctl, Ctrl
* &#8997; ⌥ Option, Opt, (Windows) Alt
* &#8679; ⇧ Shift
* &#8682; ⇪ Caps lock
* &#9167; ⏏ Eject
* &#8617; ↩ Return, Carriage Return
* &#8629; &crarr; ↵ Return, Carriage Return
* &#9166; ⏎ Return, Carriage Return
* &#8996; ⌤ Enter
* &#9003; ⌫ Delete, Backspace
* &#8998; ⌦ Forward Delete
* &#9099; ⎋ Escape, Esc
* &#8594; &rarr; → Right arrow
* &#8592; &larr; ← Left arrow
* &#8593; &uarr; ↑ Up arrow
* &#8595; &darr; ↓ Down arrow
* &#8670; ⇞ Page Up, PgUp
* &#8671; ⇟ Page Down, PgDn
* &#8598; ↖ Home
* &#8600; ↘ End
* &#8999; ⌧ Clear
* &#8677; ⇥ Tab, Tab Right, Horizontal Tab
* &#8676; ⇤ Shift Tab, Tab Left, Back-tab
* &#9250; ␢ Space, Blank
* &#9251; **␣** Space, Blank
*/
namespace m8r {

Expand Down
5 changes: 4 additions & 1 deletion app/src/qt/look_n_feel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ void LookAndFeels::setBlackTheme()
// IMPROVE tooltips are set in two ways
mindforgerApplication->setStyleSheet("QToolTip { color: #ffffff; background-color: #000000; border: 1px solid white; }");

menuStylesheet = QString("QMenu::separator { background: #444; height: 1px; margin-left: 10px; margin-right: 10px; }");
menuStylesheet = QString{
"QMenu::separator { background: #444; height: 1px; margin-left: 10px; margin-right: 10px; }"
"QMenuBar::item:disabled { color: #555; }"
"QMenu::item:disabled { color: #555; background: "}+backgroundColor+QString{"; }"};
}

void LookAndFeels::setNativeTheme()
Expand Down
1 change: 1 addition & 0 deletions app/src/qt/main_menu_presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ MainMenuPresenter::MainMenuPresenter(MainWindowPresenter* mwp)
// menu: Note
QObject::connect(view->actionNoteNew, SIGNAL(triggered()), mwp, SLOT(doActionNoteNew()));
QObject::connect(view->actionNoteEdit, SIGNAL(triggered()), mwp, SLOT(doActionNoteEdit()));
QObject::connect(view->actionNoteClose, SIGNAL(triggered()), mwp, SLOT(doActionNoteLeave()));
QObject::connect(view->actionNoteForget, SIGNAL(triggered()), mwp, SLOT(doActionNoteForget()));
QObject::connect(view->actionNotePromote, SIGNAL(triggered()), mwp, SLOT(doActionNotePromote()));
QObject::connect(view->actionNoteDemote, SIGNAL(triggered()), mwp, SLOT(doActionNoteDemote()));
Expand Down
17 changes: 14 additions & 3 deletions app/src/qt/main_menu_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ MainMenuView::MainMenuView(MainWindowView& mainWindowView)

// think ... toggle mental processes ~ enable associations/similarity/search based suggestions on searching/reading/writing notes
actionMindAutolink = new QAction(QIcon(":/menu-icons/link.svg"), tr("&Autolink"), mainWindow);
#ifdef DO_MF_DEBUG
#ifdef MF_MD_2_HTML_CMARK
actionMindAutolink->setCheckable(true);
actionMindAutolink->setStatusTip(tr("Automatically inject links to relevant Notebooks and Notes when browsing HTML preview"));
actionMindAutolink->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_A));
Expand Down Expand Up @@ -279,11 +279,18 @@ MainMenuView::MainMenuView(MainWindowView& mainWindowView)
menuView->addAction(actionViewFullscreen);

// menu: navigator

#ifdef __APPLE__
actionNavigatorEdgesStretch = new QAction(tr("Str&etch edges"), mainWindow);
#else
actionNavigatorEdgesStretch = new QAction(tr("Str&etch edges\te | mouse wheel"), mainWindow);
#endif
actionNavigatorEdgesStretch->setStatusTip(tr("Stretch knowledge graph edges"));

#ifdef __APPLE__
actionNavigatorEdgesShrink= new QAction(tr("&Sh&rink edge"), mainWindow);
#else
actionNavigatorEdgesShrink= new QAction(tr("&Sh&rink edge\tE | mouse wheel"), mainWindow);
#endif
actionNavigatorEdgesShrink->setStatusTip(tr("Shring knowledge graph edges"));

actionNavigatorZoomIn = new QAction(tr("Zoom &in\tz"), mainWindow);
Expand Down Expand Up @@ -378,11 +385,15 @@ MainMenuView::MainMenuView(MainWindowView& mainWindowView)
actionNoteSave = new QAction(QIcon(":/menu-icons/save.svg"), tr("Remember\tCtrl+S"), mainWindow); // Ctrl+S is handled elsewhere and I don't want menu to handle it
actionNoteSave->setStatusTip(tr("Save Note being edited"));

#ifdef __APPLE__
actionNoteForget = new QAction(QIcon(":/menu-icons/delete.svg"), tr("&Forget\tCtrl+D"), mainWindow);
#else
actionNoteForget = new QAction(QIcon(":/menu-icons/delete.svg"), tr("&Forget\tDel"), mainWindow); // Delete is handled elsewhere and I don't want menu to handle it
#endif
actionNoteForget->setStatusTip(tr("Forget Note"));

#ifdef __APPLE__
actionNoteClose = new QAction(QIcon(":/menu-icons/save.svg"), tr("Leave\t⌘+Left"), mainWindow); // Alt+Left is handled elsewhere and I don't want menu to handle it
actionNoteClose = new QAction(QIcon(":/menu-icons/save.svg"), tr("Save and Leave\tCtrl+L"), mainWindow);
#else
actionNoteClose = new QAction(QIcon(":/menu-icons/save.svg"), tr("Leave\tAlt+Left"), mainWindow); // Alt+Left is handled elsewhere and I don't want menu to handle it
#endif
Expand Down
Loading

0 comments on commit 18c5618

Please sign in to comment.