Compare commits

..

1586 Commits
v1.4 ... master

Author SHA1 Message Date
Le Tan
856d2597df release v3.19.2 2025-05-15 20:23:24 +08:00
Le Tan
44a0d75996 theme: fix toolbar expansion button style 2025-05-14 15:16:55 +08:00
Le Tan
62f6b7f3c5 theme: support hot-reload via --watch-themes cmd option 2025-05-13 22:10:00 +08:00
Le Tan
6150d327da fix macos build 2025-05-13 19:07:52 +08:00
Le Tan
522ccfecc4
fix macos deployment (#2610) 2025-05-11 19:56:24 +08:00
Le
4788ae4ccf add icons for macOS store 2025-04-24 23:17:19 +08:00
Le Tan
c3191e8f88 add privacy policy 2025-04-23 20:21:16 +08:00
Le Tan
4952c88b2e fix readme 2025-04-23 19:35:35 +08:00
Le Tan
ebd4489adf update welcome doc 2025-04-23 19:14:01 +08:00
Le Tan
d9aee037ad
code sign and notarization on macOS(#2605) 2025-04-23 15:27:13 +08:00
Le Tan
87e87619fb release v3.19.1 2025-04-17 09:48:02 +08:00
Le Tan
8494a714cd
fix button popup (#2603) 2025-04-16 22:29:56 +08:00
goodl3000
3ec78f4c36 !1 fix popup windows
* fix popup windows
2025-04-16 13:33:06 +00:00
Le Tan
a27485c021 add gitee project 2025-04-15 21:04:08 +08:00
Le Tan
713b98f29e release v3.19.0 2025-04-10 20:46:58 +08:00
Le Tan
82b0ec751d update vtextedit for VSCode-style shortcuts 2025-04-10 10:25:55 +08:00
Le Tan
a7348c0aa0 update vtextedit 2025-04-08 22:23:49 +08:00
Le Tan
85d2ee950d export: allow local file remote access 2025-04-07 23:23:29 +08:00
Le Tan
b0b51570b0 init stylesheet before mainwindow is shown 2025-04-02 22:00:29 +08:00
Le Tan
a5a9b32ea3
upgrade to Qt 6.8.3 (#2598)
* upgrade to Qt 6.8.3

* fix cache action

* use 2022 for 6.8

* fix vs

* fix linjux

* fix
2025-04-02 13:27:30 +08:00
Le Tan
ac20b7f80c fix mainwindow flashing issue 2025-04-01 21:54:23 +08:00
Le Tan
b462337824 fix build error on Linux 2025-02-11 16:04:48 +08:00
faveoled
bbb88ded57
Metainfo update (#2584) 2025-02-10 08:06:22 +08:00
Integral
0f0995d4fe
ci: update actions/upload-artifact to v4 (#2568) 2024-12-03 10:34:05 +08:00
Integral
0881dd581a
refactor: replace non-empty QString constructors with QStringLiteral() (#2563) 2024-12-02 21:09:57 +08:00
Le Tan
c4512bb69a change minimum macOS supported version 2024-08-13 14:44:17 +08:00
Le Tan
5e4a6fa72a release v3.18.2 2024-08-06 21:56:46 +08:00
Le Tan
5da9268aa7 fix open alert 2024-08-06 21:23:48 +08:00
Le Tan
f1af78573a
fix xss (#2531) 2024-07-22 22:36:38 +08:00
Le Tan
a7600fa7f7
codesign --remove-signature will cause broken binary (#2530)
* codesign --remove-signature will cause broken binary

* fix
2024-07-19 19:44:24 +08:00
Le Tan
78de724757 update xss whitelist 2024-07-18 23:20:32 +08:00
Le Tan
05078a7857 update xss whitelist 2024-07-18 22:58:29 +08:00
Le Tan
84d396f6c4 release v3.18.1 2024-07-10 22:23:14 +08:00
Le Tan
b2fb5b1664 add mark for exemption 2024-07-08 21:52:02 +08:00
Le Tan
3477469b66 check link before open 2024-07-07 22:51:07 +08:00
Le Tan
bed95b1757 update vtextedit 2024-07-07 22:07:46 +08:00
Le Tan
f83761d95f fix artifact suffix 2024-07-03 14:46:45 +08:00
Le Tan
84cb60d882 release v3.18.0 2024-07-01 22:51:24 +08:00
Suman Kumar Chakraborty
313764b533
Create SECURITY.md (#2517) 2024-06-28 14:52:14 +08:00
Le Tan
44b5251045 fix todo list with XSS 2024-06-27 21:48:59 +08:00
Le Tan
743e63edbf [markdown-it] support markdown-it-mark for mark == 2024-06-20 23:11:55 +08:00
Le Tan
74e20dcb3e turn on XSS protection by default 2024-06-19 23:11:13 +08:00
Le Tan
9a971860e0 upgrade markdown-it 2024-06-19 22:39:17 +08:00
Le Tan
b1a1bf05d2 update flowchart.js 2024-06-19 22:26:33 +08:00
Le Tan
06c712cb64 upgrade Mermaid.js to v10 2024-06-19 16:46:21 +08:00
Le Tan
84891fb2f2 update QHotkey lib to support Wayland 2024-06-17 22:54:24 +08:00
Le Tan
889026bece fix main window blinking issue caused by OpenGL on Qt6 2024-06-11 22:41:29 +08:00
Le Tan
2ebb210c57 fix QMenu delete crash issue in WebViewer 2024-06-11 22:13:56 +08:00
Le Tan
bfb0e5bd29
fix build break on Qt 6.7 (#2511) 2024-06-11 21:22:08 +08:00
Le Tan
61528de505
remove code signature (#2506) 2024-05-29 23:10:39 +08:00
Le Tan
f62a82364c update readme 2024-05-24 16:14:20 +08:00
Le Tan
f461c706d1
fix Linux build (#2505) 2024-05-24 16:09:33 +08:00
Le Tan
898c82ec8f
try fix macOS CI (#2499) 2024-05-23 23:09:41 +08:00
Le Tan
f5b69b73cf
fix CI (#2497) 2024-05-11 22:58:25 +08:00
Le Tan
5a01b4bb35
Fix app dir path (#2496)
* fix app data location

* fix
2024-05-11 21:46:26 +08:00
Le Tan
918aa15e74
fix Linux build (#2494)
Fix Linux build

TODO: fix application dir path locations with AppImage. Translations and vnote_extra.rcc does not work now.
2024-05-10 16:22:05 +08:00
Le Tan
522b37425f
try fix Win CI (#2492)
fix CI and openssl
2024-05-03 22:51:25 +08:00
Le Tan
a04968913c refine translations 2024-04-30 22:07:00 +08:00
Le Tan
3b755287e7 support windows packaging 2024-04-30 15:13:21 +08:00
Le Tan
25b556ae14 migrate to cmake 2024-04-24 22:39:13 +08:00
faveoled
daa2fe1785
AppStream metadata (#2474) 2024-01-18 10:54:29 +08:00
zz of NSFOCUS Security Team
30712745bc
fix rcc path in QT5 (#2454)
see: https://github.com/mesonbuild/meson/pull/9792

Co-authored-by: henices <henices@163.com>
2023-11-22 22:54:55 +08:00
Le Tan
15d14359d7
try fix win ci (#2434)
* try fix win ci

* remove win32

* add more modules

* fix ci

* try fix linux-ci

* fix linux ci

* try fix rcc

* fix rcc path

* tree

* add back qt 5

* use jom
2023-10-08 23:09:31 +08:00
Le Tan
75f7250ed1 fix 2023-09-27 23:30:51 +08:00
Le Tan
853e9c08e0 add back Qt5 2023-09-27 23:24:24 +08:00
Le Tan
2f6afb2f97 upgrade to Qt6 2023-09-17 17:17:15 +08:00
hello
cbd3956cdc
remove Qt 5 (#2423)
Co-authored-by: plopop <plopop@github.com>
2023-09-15 00:09:19 +08:00
Le Tan
4ab2033a81 release v3.17.0 2023-08-27 23:03:19 +08:00
chendapao
e8fe0726ff
QuickAccess: add quick note (#2373)
* feature_quick_create_note

* adj name and complete quick create

* del unused

* del unused

* adj name

* adj to const

* adj name 2

* adj

* fix

---------

Co-authored-by: Le Tan <tamlokveer@gmail.com>
2023-08-24 22:51:17 +08:00
chendapao
f773bc0348
Merge pull request #2387 from dbkuaizi/hotifx-嵌套代码块样式问题修复
嵌套代码块样式问题修复
2023-05-08 10:36:21 +08:00
dbkuaizi
d208d4f9a7 嵌套代码块样式问题修复 2023-05-07 16:29:27 +08:00
Le Tan
a5f6d5a142 upgrade Mermaid and Flowchart.js 2023-05-04 22:09:02 +08:00
Le Tan
cfce10b0ca
fix ubuntu ci (#2383) 2023-05-01 21:15:14 +08:00
两双筷子
2ccfb5ca9f
增加标题层级显示功能 (#2381) 2023-04-30 21:47:08 +08:00
Le Tan
c7f471cb8f refine navigation mode 2023-04-13 22:01:28 +08:00
chendapao
c255cd54ed
feature/support_insert_multiple_mimedata (#2339)
* feature/support_insert_multiple_mimedata

* format

* reset

* adj

* adj isProcess

* adj func name

* adj logic and name
2023-02-03 10:53:29 +08:00
chendapao
075380749c
fix/pdf_name_ascii (#2341)
* fix/pdf_name_ascii

* adj

* Update src/widgets/pdfviewwindow.cpp

---------

Co-authored-by: Le Tan <tamlokveer@gmail.com>
2023-01-29 22:55:54 +08:00
两双筷子
f1a03554f0
优化分割线样式 (#2342) 2023-01-28 07:41:08 +08:00
Jachin
9353c9ef40
Fix mermaid display problem in the editing state. (#2334) 2023-01-16 21:54:46 +08:00
chendapao
d664c5a1c6
feature/adj_history_open_use_conf (#2330) 2023-01-11 18:32:21 +08:00
chendapao
d499b0d7be
feature/add_treewidget_enter_event_compat (#2323)
* feature/add_treewidget_enter_event_compat

* restore
2023-01-06 10:27:58 +08:00
chendapao
f764fec458
fix/selectdialog_QListWidget_to_ListWidget (#2320) 2023-01-04 14:40:36 +08:00
Le Tan
0cb502520f PdfViewer: set useWorkerFetch to false 2023-01-01 09:47:18 +08:00
Le Tan
b4e38409a9 release v3.16.0 2023-01-01 09:47:18 +08:00
Le Tan
03ffb12ff1 refine mindmap 2023-01-01 09:47:18 +08:00
Le Tan
31d4ad151e
Dev (#2316)
* refine mindmap

* update release

* release v3.16.0
2022-12-30 18:29:54 +08:00
Le Tan
5229be4687 add MindMap editor 2022-12-25 13:09:49 +08:00
chendapao
e76c6829f7
feature/add_history_del (#2297)
* feature/add_history_del

* del debug

* adj 1

* adj 2

* adj name

* adj to call by address

* adj to call by address

* adj to call by address

* adj func name

* adj code grammar

* adj per
2022-12-23 22:53:56 +08:00
Le Tan
e7a7895c6e embed pdfviewer reader 2022-12-18 14:20:30 +08:00
Le Tan
7f2cfe4f52
Pdf view (#2312)
* Draft: feature/pdf_view (#2268)

* build base code

* simple run successful

* add save session

* add pdfjs resource

* simple pdf viewer

Co-authored-by: chendapao <feloxx@163.com>
2022-12-17 18:52:37 +08:00
chendapao
7f27745303
fix/adj_snippet_state_store (#2300)
* fix/adj_snippet_state_store

* revert
2022-11-27 15:56:27 +08:00
Le Tan
4002cbca1b
fix macos ci (#2301) 2022-11-27 11:51:38 +08:00
两双筷子
f2c7abcc6f
修复因边距导致代码块与行号对不齐的问题 (#2294)
* 修改代码块边距

* Update src/data/extra/themes/vue-light/web.css

Co-authored-by: Le Tan <tamlokveer@gmail.com>
2022-11-21 22:46:45 +08:00
chendapao
e47b813b69
feature/add_shortcuts_paste_to_md (#2277)
* feature/add_shortcuts_paste_to_md

* feature/add_shortcuts_paste_to_md

* submodule update

* adj
2022-10-12 22:54:09 +08:00
Le Tan
0f635fba7d ci-win: do not package ico 2022-10-11 14:01:04 +08:00
Le Tan
9a10b210ec ViewWindow: add shortcut Ctrl_G,V to alternate view mode 2022-10-09 12:05:33 +08:00
两双筷子
038de48d54
Update highlight (#2270) 2022-10-08 21:54:47 +08:00
Le Tan
89cd40d0cf NotebookExplorer: support view mode for notbooks 2022-10-07 21:02:00 +08:00
Le Tan
3d77c29393 [Release] test CI 12 2022-10-04 21:13:51 +08:00
Le Tan
aea0da5570 [Release] test CI 13 2022-10-04 18:56:40 +08:00
Le Tan
7a88d1ef99 [Release] test CI 12 2022-10-04 17:15:01 +08:00
Le Tan
ee2dc9ccc5 [Release] test CI 11 2022-10-04 16:33:43 +08:00
Le Tan
73bb88e61f [Release] test CI 10 2022-10-04 15:54:56 +08:00
Le Tan
2846e590d5 [Release] test CI 9 2022-10-04 13:42:39 +08:00
Le Tan
cdf7091ae1 [Release] test CI 8 2022-10-04 10:36:19 +08:00
Le Tan
bed49cf038 [Release] test CI 7 2022-10-04 10:26:48 +08:00
Le Tan
4120ea2601 [Release] test CI 6 2022-10-04 09:39:03 +08:00
Le Tan
0e9b6894c7 [Release] test CI5 2022-10-04 09:36:43 +08:00
Le Tan
ff6031209f [Release] test CI 4 2022-10-03 20:52:17 +08:00
Le Tan
7e5ea84f37 [Release] test CI 3 2022-10-03 20:00:00 +08:00
Le Tan
e87be24e5d [Release] test ci 3 2022-10-03 19:27:56 +08:00
Le Tan
8141d58652 [Release] test CI 2 2022-10-03 17:50:48 +08:00
Le Tan
d6631280e5 [Release] test CI 2022-10-03 17:23:19 +08:00
Le Tan
0da7200898 [Release] v3.15.1
A fake release to test CI.
2022-10-03 16:00:50 +08:00
Le Tan
ed87ea3df1
Update ci-win.yml (#2265)
* Update ci-win.yml

* Update ci-win.yml

* Update ci-win.yml

* fix win

* release
2022-10-03 14:58:11 +08:00
Le Tan
749c4006a2 MarkdownEditor: bug fix about typing markers 2022-09-24 07:20:27 +08:00
Le Tan
66ed2cdda1 CI: remove private Qt 5.15.x build 2022-09-24 06:52:08 +08:00
Le Tan
3739cfd0ef add two themes 2022-09-24 06:49:05 +08:00
Le Tan
815ef927cb MainWindow: fix content area expand 2022-09-24 06:49:05 +08:00
chendapao
1d94617837
Fix/quick access open mode (#2239)
* fix/quick_access_open_mode

* fix/quick_access_open_mode

* adj quick access open mode location

* adj quick access open mode location
2022-09-17 18:07:15 +08:00
uRick
a25b75f828
add vx-idea theme (#2236) 2022-09-12 11:21:45 +08:00
chendapao
e92ea5061a
feature/adj_linux_build (#2234) 2022-09-06 15:04:00 +08:00
两双筷子
d9f009953f
添加vue暗黑主题 (#2232) 2022-09-05 20:58:30 +08:00
Le Tan
08fe335a80 check name conflicts when loading nodes 2022-08-28 21:58:57 +08:00
Le Tan
73ebcaeb90 fix read mode search 2022-08-27 21:41:40 +08:00
Le Tan
6de3663269
fix CI (#2225) 2022-08-26 22:19:15 +08:00
Le Tan
12302d375d release v3.15.0 2022-08-26 20:57:20 +08:00
Le Tan
490634b85a update translations 2022-08-26 20:54:12 +08:00
Le Tan
cc0689d946 NotebookSelector: support dynamic icons for notebooks 2022-08-26 20:45:18 +08:00
Le Tan
fe4b6ca72e refine themes 2022-08-25 21:26:40 +08:00
Le Tan
791a5da245 support word count 2022-08-25 20:31:01 +08:00
Le Tan
2a91577521 add abck tab icon 2022-08-24 20:16:12 +08:00
Le Tan
08c597513c support edit/read mode 2022-08-19 21:31:53 +08:00
Le Tan
3c64b86297
use Qt 5.15.4 for mac CI (#2219) 2022-08-19 20:12:50 +08:00
Le Tan
a37d03fd02 fix vew-light theme 2022-08-19 13:48:54 +08:00
两双筷子
12eda471fc
添加 Vue Light 主题 (#2218) 2022-08-18 23:21:29 +08:00
zz of NSFOCUS Security Team
5877366b77
update DockWidgetHelper chinese translation (#2217)
* update DockWidgetHelper chinese translation

* Update src/data/core/translations/vnote_zh_CN.ts

Co-authored-by: henices <henices@163.com>
Co-authored-by: Le Tan <tamlokveer@gmail.com>
2022-08-18 16:15:37 +08:00
Le Tan
9b78d38726
use qt 5.15.5 for windows (#2216) 2022-08-18 13:08:12 +08:00
Le Tan
b78bd5abef refine themes 2022-08-17 18:36:01 +08:00
Le Tan
5865519402 update vtextedit 2022-08-12 17:52:27 +08:00
Le Tan
4f1959501d Add open windows panel 2022-08-11 19:10:28 +08:00
Le Tan
12e18934df fix ci 2022-08-04 21:56:34 +08:00
Le Tan
05e8648d25
try fix win ci (#2202)
* try fix win ci

* add 5.15 for win

* fix

* refine README
2022-08-04 21:03:45 +08:00
Le Tan
e9c8225255 release v3.14.0 2022-08-02 21:11:25 +08:00
Le Tan
14475330da
fix CI (#2197)
* fix CI

* fix win
2022-08-02 05:10:13 +08:00
zz of NSFOCUS Security Team
53e2b3bfa8
Fix export html/pdf problem in Qt 5.15.5 (#2199)
maybe related https://github.com/vnotex/vnote/issues/1942   export PDF cpu 100%

```
Critical:(markdownviewer.js:103) Uncaught TypeError: Failed to delete an indexed property from 'NodeList': Index property deleter is not supported.
[520896:520896:0801/171207.286744:INFO:CONSOLE(103)] "Uncaught TypeError: Failed to delete an indexed property from 'NodeList': Index property deleter is not supported.", source: file:///home/henices/.local/share/VNote/VNote/web/js/prism.js (103)
```
2022-08-01 21:49:09 +08:00
Le Tan
8197012bcb refine icons and pure theme 2022-07-31 10:14:31 +08:00
Le Tan
719c7339cf refine pure theme 2022-07-26 19:46:37 +08:00
Le Tan
21893fdff8 more fixes 2022-07-21 21:46:37 +08:00
Le Tan
9a3c69870c IconUtils: transform to lower case for comparison 2022-07-18 08:59:41 +08:00
Le Tan
30f73cb004 NavigtionMode: fix bug when input method is enabled 2022-07-14 22:11:01 +08:00
chendapao
3025e8e01c
feature/adj_mono_icons_render (#2174)
* feature/adj_mono_icons_render

* adj mono check

* del space

* feature/adj_mono_icons_render

* adj color match

* adj color hex match

* adj color hex match

* simple

* simple

* feature/adj_mono_icons_render

* feature/adj_mono_icons_render

* back QRegExp
2022-07-14 08:51:45 +08:00
Le Tan
e5f7a23157 fix path 2022-07-10 09:32:41 +08:00
chendapao
8c0c056c47
feature/add_viewarea_shortcut_close_other_right (#2173)
* feature/add_viewarea_shortcut_close_other_right

* delete default

* adj multi

* del blank line

* add close all and close left

* adj

* adj

* del unless
2022-07-10 10:06:38 +08:00
Le Tan
17af3b8dc0 SessionConfig: add external media default path 2022-06-25 14:45:49 +08:00
chendapao
82ec6beeb5
fix/add_custom_icons (#2167) 2022-06-24 22:35:37 +08:00
chendapao
1318427bb7
feature/add_custom_icons (#2145)
* first boold

* adj

* base spec amendment

* add monochrome optional fields to the theme

* add monochrome optional fields to the theme

* adj default value
2022-06-21 18:31:25 +08:00
Le Tan
29b2093ef0 release v3.13.1 2022-06-19 16:06:57 +08:00
Le Tan
c08296bc3b UnitedEntry: fix key press event 2022-06-19 14:38:12 +08:00
Le Tan
cd53eedc7f UnitedEntry: bug fix 2022-06-17 22:17:47 +08:00
Le Tan
e0b07b8aba UnitedEntry: fix the popup hiding input method issue on macOS 2022-06-17 21:06:09 +08:00
Le Tan
8678468998 fix shortcuts 2022-06-14 21:28:32 +08:00
Le Tan
d33b539659
fix win ci (#2141) 2022-05-29 20:55:22 +08:00
Le Tan
09776f07cd use qt 5.12.11 on Windows 2022-05-27 17:23:20 +08:00
Le Tan
f762204512 downgrade Qt version to 5.12 2022-05-26 21:43:08 +08:00
chendapao
06b9269b84
fix shortcut copy conflict (#2112) 2022-04-25 16:46:58 +08:00
chendapao
243a03e142
add notebooknodeexplorer shortcut new note folder and toolbar (#2101) 2022-04-16 10:10:08 +08:00
chendapao
dfa4e59737
add notebooknodeexplorer shortcut cut (#2100) 2022-04-16 10:09:15 +08:00
chendapao
cf0146050e
add global shortcut wakeup (#2097)
* add global shortcut wakeup

* del useless

* add ann

* upgrade git mod

* add short text

* update

* Simplify logic and add QKeySequence non-null judgment.

* Simplify logic.

* Simplify logic.
2022-04-16 09:51:13 +08:00
Le Tan
18080d174c add QHotkey 2022-04-11 12:54:10 +08:00
chendapao
34f3bb7a08
add copy paste properties short text (#2096) 2022-04-10 07:09:40 +08:00
chendapao
09789590a2
add notebooknodeexplorer shortcut properties (#2094)
* impl properties

* repeat logic merge to function

* code format

* properties only 1 node

* change function name
2022-04-07 22:47:21 +08:00
chendapao
0cadea231a
add notebooknodeexplorer shortcut copy paste (#2088)
* add notebooknodeexplorer shortcut copy paste

* simplify code and add isActionFromMaster function

* add const

* adj ann

* adj return
2022-04-06 12:45:16 +08:00
Le Tan
bbab5cc223 release v3.13.0 2022-04-03 13:12:37 +08:00
Le Tan
fe3280e02e update translations 2022-04-03 13:09:53 +08:00
Le Tan
a31a7a32a5 MindMap: preparations 2022-04-01 21:28:49 +08:00
Le Tan
b13771e34f fix CI on macOS 2022-04-01 21:28:17 +08:00
Le Tan
cc8ee46efe SettingsDialog: finer grain restart prompt 2022-04-01 21:28:01 +08:00
Le Tan
1ca899d8ab Revert "use Qt 5.15.3"
This reverts commit 5a8eb1e7aa3f9dc224727e4dc157b5ee54d975c1.
2022-03-31 21:22:35 +08:00
Le Tan
8a1bd930eb Fixes
1. PlantUmlWebService override;
2. Shortcut to clear highlights;
3. Save ViewArea session on minimized to system tray;
4. Prompt for restart after Settings
2022-03-31 21:21:15 +08:00
Le Tan
ecce8d13c1 MarkdownEditor: support RichPaste as default 2022-03-31 12:10:22 +08:00
Le Tan
5a8eb1e7aa use Qt 5.15.3 2022-03-30 21:26:08 +08:00
Le Tan
cadbab25bb FileAssociations: add System for system default program 2022-03-30 21:18:30 +08:00
Le Tan
dba9fb30e8 UnitedEntry: support United Entry 2022-03-30 21:18:15 +08:00
Le Tan
2908148c00 $$: no need to add blank line before $$ start 2022-03-10 20:20:20 +08:00
Le Tan
8be34ade30 KateVi: skip Ctrl+X as well as Ctrl+C 2022-03-08 20:12:33 +08:00
Le Tan
52d389a5e7 MarkdownEditor: fix image url encoding 2022-03-07 20:24:09 +08:00
Le Tan
f9767bf7f7 update vtextedit 2022-03-03 13:41:46 +08:00
Le Tan
d25c142bfa NotebookSelector: use ComboBox 2022-03-02 10:57:16 +08:00
Le Tan
bdd935d9c2 use windows-2019 to fix CI on windows 2022-02-26 16:18:08 +08:00
Le Tan
eab367cf6f Qt5.15: hide unused actions in web viewer 2022-02-23 17:02:31 +08:00
Le Tan
486950c1aa Searcher: use async first phase search 2022-02-22 19:49:22 +08:00
Le Tan
0e4442f513 release v3.12.888 2022-01-31 09:25:57 +08:00
Le Tan
401b1934e2 update translations 2022-01-31 09:20:35 +08:00
Le Tan
6ea5995c12 NewNoteDialog: remember default file type 2022-01-31 09:15:13 +08:00
Le Tan
b3a385693c support file associations and open with built-in editors 2022-01-30 19:49:51 +08:00
Le Tan
737f9e51d8
upgrade Qt to 5.15.2 (#2031)
upgrade Qt to 5.15.2
2022-01-27 12:49:06 +08:00
Le Tan
ef7b28b6b3 QuickAccess: support folder 2022-01-26 21:16:38 +08:00
Le Tan
993d522e15 add line ending settings for configs 2022-01-26 19:14:33 +08:00
Le Tan
969db5c3db update libs/vtextedit 2022-01-24 21:22:41 +08:00
Le Tan
8b0210eb5d refine themes 2022-01-24 20:44:06 +08:00
Le Tan
5da6a81d4b fix shortcuts in key sequence with input method 2022-01-21 21:01:31 +08:00
Le Tan
36d4248a32 release v3.12.0 2022-01-19 16:58:02 +08:00
Le Tan
b1dc1eefe6 update translations 2022-01-19 16:47:05 +08:00
Le Tan
2630999acf NotebookExplorer: support separated node explorer 2022-01-18 20:07:26 +08:00
Le Tan
a4a5dea3d7 fixes
* MarkdownViewWindow: add switch for code block line number
* MarkodwnViewWindow: fix Turndown <style> issue
* MarkdownViewWindow: add config for overridding MathJax script
* SortDialog: fix sorting issue of date
* FramelessMainWindow: fix StayOnTop issue
2022-01-10 20:06:45 +08:00
Le Tan
09dba18994 fix QDockWidget 2022-01-08 16:01:05 +08:00
Le Tan
a5671e20e5 Theme: use a FFFFFF background for pure theme 2022-01-08 09:14:04 +08:00
Le Tan
5ba1ba5b97 refine theme VSCode-dark 2022-01-07 21:25:06 +08:00
Le Tan
eff1a81125 MarkdownViewWindow: use web to highlight code block in editor 2022-01-07 20:43:08 +08:00
YiChuJun
727fade948
add dark themes (#2009)
* 新增dark主题

* 新增dark主题
2022-01-05 15:14:51 +08:00
Le Tan
126091c080 release v3.11.0 2021-12-25 09:50:51 +08:00
Le Tan
7a017e30ea refine task 2021-12-23 21:00:01 +08:00
Le Tan
293d04e2c3 fix theme 2021-12-22 20:49:10 +08:00
Le Tan
70c984353c Task: refine task 2021-12-22 20:49:00 +08:00
Nriver
87ed9250ef
add solarized-dark and solarized-light themes (#1978) 2021-12-21 20:26:24 +08:00
YaoXin
ba9a0ba459
CI Increase cache QT (#1975) 2021-12-19 16:16:19 +08:00
Le Tan
f50a834ae7 Settings: refine searching 2021-12-10 20:34:07 +08:00
Le Tan
301dace730 add FakeAccessibleInterface to fix crash of Youdao Dict 2021-12-09 21:12:31 +08:00
chendapao
b369612070
setting tree match complete (#1932) 2021-12-09 18:40:51 +08:00
tootal
911392deab
Feature Task System (#1947)
* add task system code

* enable ci build

* Revert "enable ci build"

This reverts commit 8c457a22e44e64c7d87804fc3c76ee778c1c3b6f.
2021-12-09 18:40:14 +08:00
Le Tan
fa238b3e22 MainWindow: decide DPI on the screen where vnote starts 2021-12-06 21:04:13 +08:00
Le Tan
956842f102 support equation begin in MathJax 2021-12-06 21:03:54 +08:00
Le Tan
04a93de5a5 add --disable-gpu as known cmd option 2021-11-26 20:48:27 +08:00
Le Tan
04451257d2 MarkdownEditor: align highlight syntax with read mode 2021-11-25 21:09:18 +08:00
Le Tan
2d4d4609da MarkdownEditor: fix
1. Fix issue that duplicated images would not be processed when copied;
2. Add suffix `*.nasm` to Intel ASM syntax.
2021-11-22 20:40:48 +08:00
Le Tan
ff7cf0f24e export: fix wkhtmltopdf table-of-contents in Chinese 2021-11-19 21:56:28 +08:00
Le Tan
54576543e9 fix update_version.py 2021-11-19 07:59:21 +08:00
Le Tan
14c54ab275 release v3.10.1 2021-11-17 20:51:43 +08:00
Le Tan
ecf1f8dbbe support print 2021-11-17 20:50:26 +08:00
Le Tan
6884e1ff6a MarkdownViewWindow: fix view mode 2021-11-16 21:12:20 +08:00
Le Tan
258adf10da fix tab stop width 2021-11-15 21:13:14 +08:00
Le Tan
3a4334ffd2 release v3.10.0 2021-11-13 17:35:34 +08:00
Le Tan
4d41421fb8 support input method on macOS in tag popup 2021-11-13 17:24:56 +08:00
Le Tan
e2fda18dbd MarkdownViewWindow: fix EditPreview 2021-11-12 07:53:30 +08:00
Le Tan
6b1f00880e MarkdownEditor: support EditPreview mode 2021-11-10 20:52:24 +08:00
Le Tan
86df5c39a2 TextEditor: add config for highlighting tab and trailing space 2021-11-08 09:28:18 +08:00
Le Tan
47a49b7bb2 release v3.9.0 2021-11-06 21:08:47 +08:00
Le Tan
0b58669e39 MarkdownEditor: support context-sensitive context menu for images and links 2021-11-06 11:43:10 +08:00
Le Tan
9fca1cad12 update vtextedit 2021-11-04 21:34:15 +08:00
Le Tan
077cd6562e add debugger to Markdown web viewer by F12 2021-11-04 21:17:59 +08:00
Le Tan
d7bfb956ec support user.css for Markdown editor read mode style 2021-11-03 20:43:11 +08:00
Le Tan
dc0a9b1a7d MarkdownEditor: add option for image align center 2021-11-03 07:45:06 +08:00
Le Tan
0b624eeefd refine Quick Access 2021-10-31 10:06:55 +08:00
Le Tan
8de8b0dda8 support search tag in SearchPanel 2021-10-30 08:14:51 +08:00
Le Tan
964dfbb085 remove recycle bin node 2021-10-28 19:48:28 +08:00
Le Tan
c362facdd7 release v3.8.1 2021-10-25 10:08:47 +08:00
Le Tan
2b5076584d fix FramelessMainWindow 2021-10-24 21:50:27 +08:00
Le Tan
79993814a8 release v3.8.0 2021-10-24 15:51:47 +08:00
Le Tan
1802b00525 refine tags dialog 2021-10-24 15:46:53 +08:00
Le Tan
5848b5e737 update translations 2021-10-23 21:53:06 +08:00
Le Tan
313d362ed3 try fix mac deploy 2021-10-23 18:52:34 +08:00
Le Tan
9e9a6bd584 do not support deleting notebook from VNote directly 2021-10-23 13:58:24 +08:00
Le Tan
810438b5e5 FramelessMainWindowLinux 2021-10-23 13:31:03 +08:00
Le Tan
5bc48be5d0 introduce FramelessMainWindow 2021-10-20 10:35:26 +08:00
Le Tan
0a2bdc7033 support tags 2021-10-15 15:26:37 +08:00
Le Tan
3b03fd2189 fix styles 2021-09-26 14:43:55 +08:00
Le Tan
b8dd91e353 MainWindow: make Outline dock fixed at the right side by default 2021-09-26 14:43:55 +08:00
Le Tan
6689e8c84c add sqlite database 2021-09-26 14:43:55 +08:00
Le Tan
bb1598dde2 small fixes 2021-09-26 14:43:54 +08:00
Le Tan
2740983308
fix duplication of QtWebEngineProcess of macOS deploy (#1888) 2021-09-26 12:07:21 +08:00
BeyondXinXin
2436adc257
* Remove the top blank in frameless window mode (#1887) 2021-09-25 18:04:20 +08:00
BeyondXinXin
e4355eeb48
* Sets the default search to the currently selected text (#1886)
* * Sets the default search to the currently selected text

* * Specification code
2021-09-25 11:25:01 +08:00
Le Tan
606dcef16f GiteeImageHost: encode spaces in returned download_url 2021-09-04 12:50:51 +08:00
Le Tan
dc0c0ca849 Notebook: support scan and import external files 2021-09-04 12:22:33 +08:00
Le Tan
8973f40020 MainWindow: support Navigation mode for dock widgets 2021-09-02 20:15:54 +08:00
Le Tan
d8635e957c MainWindow: support tooltip for tab bar of dock widgets 2021-08-30 20:59:50 +08:00
BeyondXinXin
e4edee269b
github ImageHost: Modify delete function (#1862) 2021-08-30 07:59:36 +08:00
Le Tan
8391014b38 refine README 2021-08-29 11:50:58 +08:00
Le Tan
54a71ae977 add switch for per-notebook history 2021-08-29 10:33:01 +08:00
Le Tan
5c2a14e6a7 release v3.7.0 2021-08-28 11:33:49 +08:00
Le Tan
2bb475a0fd update releases 2021-08-28 11:27:08 +08:00
Le Tan
0d8bb7eebd Editor: support line ending 2021-08-28 11:03:47 +08:00
Le Tan
ed8cd503b5 Search: highlight matched items in opened files 2021-08-26 20:33:49 +08:00
Le Tan
8326d3c702 Export: support custom export 2021-08-23 20:50:52 +08:00
Le Tan
c9be7a7a7f Exporter: make it modeless 2021-08-21 20:10:29 +08:00
Le Tan
fa7dd8c541 add shortcuts for CloseOtherTabs and CloseTabsToTheRight 2021-08-21 17:01:58 +08:00
Le Tan
0f1be2883a add check for updates 2021-08-21 13:06:56 +08:00
Le Tan
bcec79fe17 MainWindow: use icon only in docks' tab bar 2021-08-20 20:05:30 +08:00
Le Tan
e017c0f475 Exporter: support AllInOne in PDF format 2021-08-19 20:32:52 +08:00
Le Tan
6109737b9d Fixes
1. OutlineViewer: support section number;
2. Allow to close the file before opening with external program;
3. Skip end marker within a block marker;
2021-08-17 20:58:55 +08:00
Le Tan
7cc31a5d6e sort notes by name case-insensitively 2021-08-16 16:45:08 +08:00
Le Tan
f4aabc1f2d refine shortcuts 2021-08-15 10:52:39 +08:00
Le Tan
280144f4eb macOS: handle file open event requested by Finder 2021-08-15 10:10:05 +08:00
Le Tan
a9005bef23 PlantUml/Graphviz: support relative path 2021-08-15 09:44:30 +08:00
Le Tan
0530422a9b release v3.6.0 2021-08-14 07:46:33 +08:00
Le Tan
aaee9d00e4 update translations 2021-08-14 07:44:43 +08:00
Le Tan
721e821ca5 Vi: add config page 2021-08-13 21:59:17 +08:00
Le Tan
e9799990f0 MarkdownEditor: add graphviz as the language of Graphviz 2021-08-12 22:04:43 +08:00
Le Tan
a0594dcc2b Searcher: catch exception when loading node 2021-08-12 21:49:06 +08:00
Le Tan
0cf0da06f8 Snippet: add ww as the week number with leading zero 2021-08-12 21:26:24 +08:00
Le Tan
c03884c429 ImageHost: add Gitee host 2021-08-12 21:15:56 +08:00
Le Tan
f1d931c276 support Image Host 2021-08-11 21:46:27 +08:00
Le Tan
30a9d0ecc7 fix styles 2021-07-30 08:02:53 +08:00
Le Tan
0784fd43f3 fix history loading issue of notebook 2021-07-29 21:03:31 +08:00
Le Tan
4defcc7aea release v3.5.1 2021-07-28 21:19:05 +08:00
Le Tan
500eba29fa update translations 2021-07-28 21:19:05 +08:00
Le Tan
9cf015a676 LocationList: fix the recently introduced regression when highlighting segments of text 2021-07-28 20:53:47 +08:00
Le Tan
5ba425ae95 refine readme 2021-07-25 16:26:27 +08:00
Le Tan
516aaa95ca LocationList: make header sections resizable 2021-07-25 12:03:16 +08:00
Le Tan
a453d69296 release v3.5.0 2021-07-25 11:28:59 +08:00
Le Tan
ceeeea6ef9 update translations 2021-07-25 09:25:30 +08:00
Le Tan
87932751b4 SelectDialog: support shortcuts 2021-07-25 09:10:48 +08:00
Le Tan
7fc7481cfb disable input method in QuickSelector 2021-07-24 15:31:11 +08:00
Le Tan
f92e1a9791 MarkdownEditor: support disabling in-place preview temporarily 2021-07-24 12:55:11 +08:00
Le Tan
cf988e6fa6 History: support history 2021-07-24 11:13:20 +08:00
Le Tan
ef69ee435f LocationList: highlight text segments 2021-07-21 20:54:58 +08:00
Le Tan
edfdd68c36 Vi: support align and indent commands 2021-07-18 10:39:44 +08:00
Le Tan
91527aed58 add config for inplace preview sources 2021-07-17 14:48:29 +08:00
Le Tan
3d7cd68707 add welcome page 2021-07-16 20:10:14 +08:00
Le Tan
2e9c727248 ViewArea: support ViewWindow movement across ViewSplits by Ctrl+G,Shift+H/J/K/L 2021-07-15 20:02:16 +08:00
Le Tan
361bbc50b8 ViewArea: add Ctrl+G, H/J/K/L to navigate through ViewSplits 2021-07-14 19:36:39 +08:00
Le Tan
c13d1803ce VTextEdit: fix zoom editor font 2021-07-10 15:38:46 +08:00
Le Tan
6b10a5f63d NotebookNodeExplorer: fix reload issue not loading children of node item 2021-07-10 15:01:20 +08:00
Le Tan
21edc0f20d refine README 2021-07-10 08:57:18 +08:00
Le Tan
35920bffe9 theme: use smaller padding in treeview and listview 2021-07-09 22:06:49 +08:00
Le Tan
bdf922443d
release v3.4.0 (#1809) 2021-07-09 20:54:44 +08:00
Le Tan
19b5163d0b LineEdit: translate Ctrl+[ to Esc 2021-07-08 22:05:36 +08:00
Le Tan
4e7cac6aef remove ' and " from auto-bracket 2021-07-08 21:48:20 +08:00
Le Tan
58e8ea5ee8 improve Snippet support 2021-07-08 21:31:13 +08:00
Le Tan
d1d8fabb60 suport snippet 2021-07-05 21:51:50 +08:00
Le Tan
ebd65b26be fix ParseAsMarkdownAndPaste corner cases (without https protocol) 2021-06-25 08:11:43 +08:00
Le Tan
30e3b5721e bug fix
1. InsertImageDialog crashes when file does not exist;
2. Use &nbsp; for leading spaces of <p> element in Turndown;
2021-06-24 21:36:47 +08:00
Le Tan
36dd070d05 check if node exists on activated 2021-06-22 21:15:23 +08:00
Le Tan
af85dc5aed support note template 2021-06-21 21:01:40 +08:00
Le Tan
88a3ee183f
release v3.3.0 (#1794) 2021-06-19 14:49:22 +08:00
Le Tan
c50f76c40a delay to preview after code/math blocks update to avoid blink 2021-06-19 12:24:41 +08:00
Le Tan
4348112b04 update Chinese translations 2021-06-19 11:46:12 +08:00
Le Tan
ff79533fa0 support external programs 2021-06-19 10:12:50 +08:00
Le Tan
b04b23d04b support auto list 2021-06-18 20:45:54 +08:00
Le Tan
7001976252 support auto indent 2021-06-12 12:43:56 +08:00
Le Tan
ed4e3c3d74 release v3.2.0 2021-06-05 18:50:28 +08:00
Le Tan
7c768c446b support auto bracket and overridding font family 2021-06-04 20:34:57 +08:00
Le Tan
f80fe2629a refine FindAndReplace widget activation logics 2021-06-03 20:30:05 +08:00
Le Tan
1f3b00ee44 add shortcuts for tab navigation in ViewSplit 2021-06-02 22:04:30 +08:00
Le Tan
79abddd802
support local PlantUml and Graphviz (#1776) 2021-05-29 09:24:55 +08:00
Le Tan
1d4e2b14b6
release 3.1.0 (#1767) 2021-05-21 21:18:31 +08:00
Le Tan
9ada45ea4b allow to keep docks when expanding content area 2021-05-18 20:13:20 +08:00
Le Tan
b9ac16d165
Quick Access and Flash Page (#1763)
* flash page

* Quick Access
2021-05-17 20:39:03 +08:00
Le Tan
14a3270184 NotebookExplorer session 2021-05-16 09:45:16 +08:00
Le Tan
1843ca5bfd
ViewArea session (#1762) 2021-05-15 20:49:29 +08:00
Le Tan
6cd666552d refine read mode css styles 2021-05-12 20:07:42 +08:00
Le Tan
58a7745b0e MarkdownEditor: guess image suffix when fetching images to local 2021-05-12 20:07:23 +08:00
Le Tan
f56fe42c6c MainWindow: fix layout restore issue 2021-05-11 20:42:26 +08:00
Hiroshi Miura
cd0abc5323
Add Japanese translation (#1756)
* Add Japanese translation

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Add more japanese message catalog

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-10 17:47:16 +08:00
Le Tan
d3c1163632 release v3.0.1 2021-05-09 11:23:38 +08:00
Le Tan
6dbc688773
support spell check (#1754) 2021-05-09 10:38:42 +08:00
Le Tan
8955afae66 small fixes about panel
1. Focus to the input when activating the Search panel;
2. Expand content area won't activate all the panels.
2021-05-07 07:36:29 +08:00
Le Tan
c8f2ba00ed add extra config Ctrl+Alt+F for full-text search 2021-04-20 07:29:49 +08:00
chendapao
1d908b8147
update submodule (#1738) 2021-04-18 09:48:13 +08:00
Le Tan
fb15ed871b fix crash issues 2021-04-16 20:26:57 +08:00
Le Tan
59e8163f27
release v3.0.0-beta.11 (#1734) 2021-04-15 21:03:59 +08:00
Le Tan
a40c2174a9 refine layout of SearchPanel 2021-04-15 20:07:24 +08:00
Le Tan
5c78eac179 jump to given line when activating a location list item 2021-04-14 21:13:21 +08:00
Le Tan
0e41597798 refine ViewWindow and FileOpenParameters 2021-04-14 20:25:51 +08:00
Le Tan
fe827e74f0
support full-text search (#1733) 2021-04-13 20:53:08 +08:00
Le Tan
372f092919 release v3.0.0-beta.10 2021-03-19 20:35:54 +08:00
Le Tan
c442892b59 add ExpandAll to node explorer 2021-03-18 20:26:26 +08:00
Le Tan
9c9983411f support exporting current note besides current buffer 2021-03-18 20:19:53 +08:00
Le Tan
a2d180ea12 update Mermaid.js to 8.9.1 2021-03-17 22:19:21 +08:00
Le Tan
c506b3e1e7 add command line parser
Support open files via command line.
2021-03-17 22:04:29 +08:00
Le Tan
2bad915583 add exclude patterns for external nodes
implement reloadNodes() to reload all the notebook.
2021-03-16 20:08:59 +08:00
Le Tan
df33ee6770 small fixes
1. Show Full Screen tips;
2. Show Rich Paste and Paste To Markdown tips;
2021-03-15 20:20:17 +08:00
Le Tan
24131ffa77
release v3.0.0-beta.9 (#1719) 2021-03-14 10:07:07 +08:00
Le Tan
9895207dd4
support external nodes (#1718) 2021-03-14 09:37:06 +08:00
Le Tan
aa00164dff support manual sort 2021-03-01 20:21:08 +08:00
Le Tan
319da24989 fix crash when exporting external file 2021-02-28 09:34:54 +08:00
Le Tan
1b8eb77eab release v3.0.0-beta.8 2021-02-26 20:40:27 +08:00
Le Tan
877001587b small fixes 2021-02-26 20:26:43 +08:00
Le Tan
c7c6d41eff add button in note explorer to toggle recycle bin node 2021-02-25 21:01:08 +08:00
Le Tan
f51a6510aa
remove libnss3.so and libnssutil3.so from AppImage (#1702) 2021-02-25 20:18:08 +08:00
Le Tan
551b7d45f4 fix Qt's bug 2021-02-25 20:14:31 +08:00
Le Tan
6b53c13492 update Chinese translations 2021-02-24 21:12:07 +08:00
Le Tan
517d977266
NotebookExplorer: support view order (#1700) 2021-02-24 20:46:05 +08:00
Le Tan
d8371a9b45
fix compilation error (#1697) 2021-02-23 21:19:33 +08:00
Le Tan
41bb9c0676
release v3.0.0-beta.7 (#1696) 2021-02-23 20:37:03 +08:00
Le Tan
04a57f4f8d support export 2021-02-23 20:26:15 +08:00
Le Tan
7595b03639
refactor Node interface (#1681) 2021-02-01 20:42:39 +08:00
Le Tan
508610d304 small fix 2021-01-13 21:46:47 +08:00
Le Tan
9d76d1f06b support opening link to folder in read mode
If it is a folder node, then locate to it. Otherwise, open it in the
file browser of OS.
2021-01-13 21:46:25 +08:00
Le Tan
9e20f1b0a6 support section number base level [1,3] in read mode 2021-01-12 20:34:45 +08:00
Le Tan
a43bd84570 release v3.0.0-beta.6 2021-01-11 20:54:32 +08:00
Le Tan
b4818e617f refine default new note name 2021-01-11 04:42:14 -08:00
Le Tan
00b8995fc8 bug fix
* Properties on folder node causes crash;
* Workspace crash on renaming node;
* New note name conflicts;
2021-01-11 04:42:14 -08:00
Le Tan
bb1e23a2dd add theme pure 2021-01-11 04:42:14 -08:00
Le Tan
e9e24d5e0f
release v3.0.0-beta.5 (#1650) 2021-01-10 14:14:58 +08:00
Le Tan
a3a1a307fd update Chinese translations 2021-01-10 13:46:46 +08:00
Le Tan
f2bfcd25d1 Small fix
* Add *.rmd to Markdown suffix
* Turn on system title bar by default
* Enable AutoBreak by default
* Fix title on new note
2021-01-10 12:27:17 +08:00
Le Tan
75dc7c6f28
Smart Table and Mark (#1649)
* support smart table and mark
2021-01-10 11:52:08 +08:00
Le Tan
6503b433e1
Dev (#1644)
* add file type combobox in NewNoteDialog

* add SectionNumberStyle
2021-01-07 20:41:45 +08:00
Le Tan
9dd83a6f2f
small fix (#1641) 2021-01-05 07:01:19 +08:00
Le Tan
db341b5574
release v3.0.0-beta.4 (#1639)
* refine readme

* release v3.0.0-beta.4
2021-01-02 11:27:04 +08:00
Le Tan
774930c950
fix combobox style on macOS (#1638)
* fix combobox style on macOS

* fix SingleInstanceGuard on *nix

* fix style on macos

* fix demo
2021-01-02 09:55:46 +08:00
Le Tan
7692f9f82a WebViewer: support link jump 2021-01-02 09:53:56 +08:00
Le Tan
aaa8fe85e8 update translations 2021-01-01 04:22:33 -08:00
Le Tan
3b046ab0ee set default theme to moonlight 2021-01-01 04:22:33 -08:00
Le Tan
220fba09a9 use socket for single instance guard 2021-01-01 04:22:33 -08:00
Le Tan
8a1558f4da handle autosave temporary failure 2021-01-01 04:22:33 -08:00
Le Tan
d376d1125e small fix 2021-01-01 04:22:33 -08:00
Le Tan
bc11a8d0af refine moonlight theme 2020-12-31 21:09:25 +08:00
Le Tan
759c562eb8
add theme moonlight (#1636) 2020-12-31 19:53:28 +08:00
Le Tan
88df448177 refine native theme 2020-12-27 10:48:28 +08:00
Le Tan
2600d12fc2 make the . after section number optional 2020-12-26 15:23:32 +08:00
Le Tan
40a3df305b add theme page 2020-12-26 15:05:30 +08:00
Le Tan
4636771081 support section number in edit mode 2020-12-24 04:38:12 -08:00
Le Tan
1f7acf2bc5 Settings: expose zoom delta and zoom factor configs 2020-12-24 04:38:12 -08:00
Le Tan
69170a88fc
Update README.md 2020-12-24 20:24:10 +08:00
Le Tan
a0481f2e5b MarkdownViewer: expose more configs 2020-12-22 04:40:32 -08:00
Le Tan
99207f570e OutlineViewer: do not register Navigation Mode by default 2020-12-22 04:40:32 -08:00
Le Tan
334a3ae0a5 detect gold linker 2020-12-22 04:40:32 -08:00
Le Tan
d40248bb06 add shortcuts for split and workspace 2020-12-22 04:40:32 -08:00
Le Tan
0735764a34 remove heading sequence in header ID 2020-12-22 04:40:32 -08:00
Le Tan
09bb1566b1 fix typo 2020-12-22 07:57:54 +08:00
Le Tan
03806337e7 release v3.0.0-beta.3 2020-12-21 21:51:05 +08:00
Le Tan
6dce8e65a7
add Chinese translations (#1615)
* add Chinese translations

* remove widgets_zh_CN.ts and update qt_zh_CN.ts

* refine
2020-12-21 21:12:19 +08:00
Le Tan
06ee73dcd5
fix restart on Linux (#1617) 2020-12-21 20:48:30 +08:00
Le Tan
c2e10f5783
try to fix restart (#1613)
* consider AppImage and macOS bundle

* a
2020-12-20 15:47:01 +08:00
Le Tan
d51e486a84 add read and edit action in view window 2020-12-20 11:25:53 +08:00
Le Tan
3cc882829a
fix PR #1601 (#1610)
* fix PR #1601

* use mono icon on macOS
2020-12-19 20:26:43 +08:00
jachin
cb14461f58
minimize to system tray (#1601) 2020-12-19 16:18:25 +08:00
Le Tan
44a11ce5bb
fix compilation error (#1609) 2020-12-19 15:35:25 +08:00
Le Tan
6aa0e98993 small fix 2020-12-19 12:59:17 +08:00
Le Tan
dd935b5f90
add custom Info.plist (#1608) 2020-12-19 11:17:01 +08:00
Le Tan
e454ea6e61 MarkdownEditor: fix bug in finding current heading logics 2020-12-19 08:59:37 +08:00
Le Tan
2369f6c4c8 support smart input method in vi mode 2020-12-17 21:51:11 +08:00
Le Tan
66554819a6 show hover link 2020-12-17 21:50:07 +08:00
Le Tan
5d9103b933 small refinement
* Use ViewWindow's status widget to show message;
* Add markdown guide;
* Add shortcut for StayOnTop;
2020-12-17 21:49:40 +08:00
Le Tan
4496c441fe
fix compilation error (#1600) 2020-12-16 22:29:28 +08:00
Le Tan
f3b3fb4acd Update issue templates 2020-12-16 19:08:35 +08:00
Le Tan
e55434965b fix markdown-it-texmath 2020-12-15 22:44:23 +08:00
Le Tan
bb3f03fb17 toc support 2020-12-15 22:43:46 +08:00
Le Tan
1a63c7cf6d fix compilation on macOS 2020-12-14 21:55:09 +08:00
Le Tan
868636deb9 release v3.0.0-beta.2 2020-12-14 21:37:08 +08:00
Le Tan
f68c3c2722 refine toolbar 2020-12-14 21:33:39 +08:00
Le Tan
db3139e97d small fix
- Outline viewer;
- Import legacy notebook;
2020-12-14 21:32:38 +08:00
Le Tan
c95e850bb1
refine macOS and release v3.0.0-beta.1 (#1594)
* refine macos

* release v3.0.0-beta.1
2020-12-13 20:28:42 +08:00
Le Tan
847e3d621d
support find and replace (#1593)
TODO: we may need to transform the `QRegularExpression` usage to the `RegExp` in JS.
2020-12-13 12:34:43 +08:00
Le Tan
3d7406ff24
try CI on macOS (#1584)
Finally done!
2020-12-12 12:33:08 +08:00
Le Tan
0b5a77dc3d remove copy_files 2020-12-07 21:02:23 +08:00
Le Tan
24182ab12c update README 2020-12-07 08:13:32 +08:00
Le Tan
f2a734f20c fix extra rcc in win 2020-12-07 07:32:20 +08:00
Le Tan
aced51baff NotebookExplorer: use root node if it is recycle bin node on new file 2020-12-06 10:28:09 +08:00
Le Tan
52de2eee6c rename CI win 2020-12-05 22:24:53 +08:00
Le Tan
6858544197 add CI status badge to README 2020-12-05 22:19:11 +08:00
Le Tan
86a730853a try again 2020-12-05 21:52:48 +08:00
Le Tan
ba205d3648
update latest continuous build tag (#1583) 2020-12-05 21:24:10 +08:00
Le Tan
13af4b2ed1
CI on Linux and Win (#1582) 2020-12-05 19:25:12 +08:00
Le Tan
d4e0763705
Update ci-win.yml 2020-12-01 22:13:37 +08:00
Le Tan
78d58b1cff
Fix win workflow (#1580)
* copy OpenSSL

* use openssul.utils
2020-12-01 21:39:44 +08:00
Le Tan
766e91dae4 add aboutQt 2020-12-01 18:46:46 +08:00
Le Tan
5d15232260 refine ci-win 2020-11-30 08:07:13 +08:00
Le Tan
fb9962d013 add coc_update.sh for linux 2020-11-29 22:29:59 +08:00
Le Tan
9a5e8693f4 add CI for Win 2020-11-29 22:21:23 +08:00
Le Tan
f8dd55aead use c++14 2020-11-29 16:14:19 +08:00
Le Tan
315d543399 refine README 2020-11-29 10:42:40 +08:00
Le Tan
82cfa67e31 change to VNote 2020-11-29 10:12:54 +08:00
Le Tan
52702a32e9 hard days for VNoteX project
Never say "refactor" again!!!
2020-11-28 23:10:43 +08:00
Le Tan
05d89745c1 Initial commit 2020-11-28 22:58:55 +08:00
Le Tan
44e33b540e say goodbye to VNote 2.0 2020-11-28 22:53:24 +08:00
Le Tan
de753706d1 release v2.10 2020-09-05 10:52:38 +08:00
Le Tan
6084ce23ed fix vsync 2020-09-05 10:03:32 +08:00
Le Tan
36e335bd72 VSync: add support for linux/mac 2020-09-04 20:25:55 +08:00
Le Tan
d3e1e560c4 fix vSync 2020-08-31 21:17:50 +08:00
刘涛
1fb6e777a3
增加同步上传与更新git功能 (#1482)
* 增加git同步功能

* windows下增加图标

* Git操作改为异步

* 优化同步功能

* 更新完成后重新加载当前笔记本

* 上传前关闭所有已打开笔记

* Revert "更新完成后重新加载当前笔记本"

This reverts commit 67bf9836b83203093dd71f8df99b903bcaa0adb1.

* optimize code

* revert  VDirectoryTree.h

* format code

Co-authored-by: musmus9405 <542719479@qq.com>
2020-08-29 11:53:04 +08:00
Le Tan
fafd78af94 change Baidu netdisk to Tianyi netdisk 2020-07-31 09:21:00 +08:00
tootal
8a549ea323
move cursor to end when create new note with title (#1408)
* disable qtquickcompiler

* move cursor to end when create new note with title
2020-06-06 11:08:36 +08:00
hlyang1992
8f62f9902d
Fixes #1333: Fix formula automatic numbering is invalid (#1398)
* Fix formula automatic numbering is invalid

* resetting automatic equation numbering in preview
2020-05-30 07:09:11 +08:00
Le Tan
fa1d63b5a2 fix Baidu Netdisk download link 2020-05-20 08:42:24 +08:00
せいうはん
2217f82d32
Remove the java icon on macOS dock. (#1370) 2020-05-17 18:49:21 +08:00
Le Tan
3b34d9f832 editor: bug fix for preview 2020-05-08 07:50:52 +08:00
tootal
66ece0b9a6
add QTQUICK_COMPILER_SKIPPED_RESOURCES (#1350)
Reference: https://doc.qt.io/qt-5/qtwebengine-deploying.html#javascript-
files-in-qt-resource-files
2020-05-07 07:44:14 +08:00
Le Tan
becda2e494 add Telegram group info 2020-05-02 10:08:57 +08:00
Le Tan
67fd713820 release v2.9.1 2020-04-12 15:58:24 +08:00
Le Tan
49e7ca0fa0 turn on -m by default on macOS 2020-04-11 10:26:14 +08:00
Thomas Koppelaar
42d7ae0f9a
Update dependencies list in README (#1269)
Changed 'Unknown' to 'MIT License' in README.md
2020-03-28 08:26:19 +08:00
Le Tan
90513a1f30 release v2.9 2020-03-27 18:40:55 +08:00
Le Tan
c59e6f3307 fix TravisCI qtci hang on macOS 2020-03-26 18:55:39 +08:00
Le Tan
9835e8bbb2 fix single instance guard on macOS 2020-03-25 18:40:10 +08:00
Le Tan
8c8640f4db Revert Travis fix
This reverts commit fd5ff336b4920be8b5c890e169f8b06b43a53a9e.
This reverts commit 7e4bd6b6aa5fb594f1802ec624674cfa45d4c7bb.
This reverts commit 3495a059a19b22e7c1f55a6f526df8633ed0d9bc.
2020-03-03 18:02:36 +08:00
Le Tan
fd5ff336b4 try fix TravisCI again 2020-03-01 10:53:59 +08:00
Le Tan
7e4bd6b6aa try fix Travis build 2020-03-01 10:25:59 +08:00
Le Tan
3495a059a1 mute while installing Qt on macOS 2020-03-01 10:14:12 +08:00
Le Tan
7d3732c58f fix MathJax v3 support
1. Support MathJax inside a fenced code block;
2. Support scale factor in preview;
2020-03-01 09:37:55 +08:00
Bibliobibulus
5df695c1ea
Support MathJaX v3 (#1221)
* Support MathJaX v3

* Update configuration of MathJaX

* Update config to export HTML

* Reset numbering

* Add scale option

* Fix typo
2020-03-01 09:24:43 +08:00
gydeng
615826323a
support vim e command in vmdtab and vvim (#1218) 2020-02-23 10:27:59 +08:00
Hiroshi Miura
8e75c40c86 CMake: change minimum version requirement and add comments (#1172)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-01-22 07:42:01 +08:00
Hiroshi Miura
a7450bc32d WIP: Introduce GitHub actions test with CMake (#1167)
* CPack: Improve packaging script

- Packaging uses linuxdeploy.
- Drop template files and include it inside CMake script.
- Support better packaging on Windows and MSVC2017.
- Add comments about supported CMake minimum versions.
- Improve Mac OSX packaging script.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Introduce Github Actions workflow to test cmake buid

- Multi-platform build test
- Split jobs against each platforms
- Add build type for windows
- Fix macdeployfixqt path
2020-01-20 18:26:20 +08:00
Hiroshi Miura
cb41c64aeb CPack: Improve packaging script (#1173)
- Packaging uses linuxdeploy.
- Drop template files and include it inside CMake script.
- Support better packaging on Windows and MSVC2017.
- Add comments about supported CMake minimum versions.
- Improve Mac OSX packaging script.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-01-20 18:23:01 +08:00
Hiroshi Miura
35080bd175 Document folder structure to encourage translation in various languages (#1170)
* Restructuring docs resource folder

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Correct variable name according to coding rule

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-01-15 22:34:50 +08:00
Hiroshi Miura
da2d41309a cmake: Update version (#1164)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-01-13 22:18:15 +08:00
Hiroshi Miura
6167a91090 Simplify CMake scripts (#1162)
- Simplify CMakeLists to help maintainer lazy to
  update when source files addition and removing.
- relocate cmake include files on top

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-01-12 09:39:06 +08:00
Le Tan
cd0f2b1869
Update README_ja.md 2020-01-09 07:37:12 +08:00
Le Tan
1d3b8f70b2
Update README_zh.md 2020-01-09 07:36:49 +08:00
Le Tan
f0b54bc52a
Update README.md 2020-01-09 07:34:05 +08:00
Le Tan
8a0dc85296 release v2.8.2 2019-12-20 19:45:05 +08:00
Le Tan
be229bed63 upgrade mermaid.js 2019-12-17 21:32:01 +08:00
Le Tan
1f154c08c5 try to fix crash on macOS 2019-12-17 07:43:49 +08:00
Le Tan
b46afb551c release v2.8.1 2019-12-14 12:49:22 +08:00
Le Tan
61541c47e1 refine Chinese 2019-12-14 12:42:16 +08:00
Le Tan
f06e2b168c add config to enable code block copy button in settings dialog 2019-12-14 11:51:51 +08:00
Le Tan
28d62d2400 add command line option -m to allow multiple instances (temporarilly) 2019-12-14 10:50:02 +08:00
Le Tan
babcaac97f fix compiler warning 2019-12-10 20:54:03 +08:00
lyn
2b6493c4e5 [ADDED] MacOS下点击x按钮不退出程序 (#1102)
Stay in the tray after closing main window on macOS.
2019-12-10 20:46:22 +08:00
Le Tan
a2841c399b fix PlantUML online preview 2019-12-10 20:41:49 +08:00
haipengno1
6ff3d37790 fix: render fails when using PlantUML online services (#1097) 2019-12-04 18:43:27 +08:00
Le Tan
ae141da578 remove useless things 2019-11-29 20:05:47 +08:00
Le Tan
add2e47f91 release v2.8 2019-11-29 20:02:57 +08:00
Le Tan
073431cb20 refine Chinese translations 2019-11-28 20:32:52 +08:00
Le Tan
8660668a94 refine image hosting 2019-11-27 21:27:17 +08:00
Le Tan
b97b908e0b support sorting notebooks 2019-11-25 20:30:16 +08:00
sclaire-1
eeb1d59e36 Edit README.md (#1075)
A couple grammar fixes
2019-11-19 21:32:35 +08:00
Le Tan
dba0f27aae refine default styles about word-break 2019-11-19 21:29:08 +08:00
冯文华
fbdc5a5406 editor: add supports for Tencent and gitee image hosting (#1059)
* 将图床单独提取出来成为一个类

* Split the image hosting code into two classes

* change null to parent

* delect empty line,add p_,rename file and so on

* 增加腾讯图床

* add keep image scale and do not replace link

* adjust image hosting name space

* Increase edit box length

* fix some bug and add gitee image hosting

* Specification code
2019-11-16 14:01:32 +08:00
Le Tan
55c1174ae1 add coc_update.cmd 2019-11-16 09:09:48 +08:00
冯文华
a85c39aa26 Image hosting code refactoring (#1032)
* 将图床单独提取出来成为一个类

* Split the image hosting code into two classes

* change null to parent

* delect empty line,add p_,rename file and so on
2019-11-08 22:17:53 +08:00
冯文华
c828ef00c4 editor: add supports for GitHub and WeChat image hosting (#1007)
* 增加了github imagebed的配置窗口

* 已经完成批量上传

* 基本上可以使用

* 基本上可以使用

* 加入进度条

* 就差开始的认证过程

* 差不多就这样了

* 修改中文的readme

* 修改了一下readme

* 找到不能传gif的问题所在

* 修改gif不能上传的bug

* 增加图床使用说明限制

* 增加一些注释

* 将进度条delete调

* 增加大文件上传错误提示

* 修复cancel的问题

* 已知问题: 上传多张图片时, 较大的图片的进度条不一定能出来

* 将进度条弹出来的时候修改成1s后

* 加入wechat设置, 改成QTabWidget

* wechat设置成功

* 成功获取了token

* 先保存一下, 文件上传有bug,替换好像也有bug

* 解决了boundary的引号导致图片不能上传的问题

* 注释掉一些输出

* 加入ip不在白名单的提示

* 增加图片大小大于1M的提示

* 将ip地址设置进剪切板, 并显示在弹框上

* 添加markdown转微信的url设置

* 增加自动打开openwrite的链接, 修复文件大小应为1024*1024

* 改成clear

* 将类型校验放到开始的地方

* 加入openwrite默认为空的判断

* Delete github-imagebed.md

* Apply suggestions from code review

Co-Authored-By: Le Tan <tamlokveer@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Le Tan <tamlokveer@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Le Tan <tamlokveer@gmail.com>

* 根据要求修改了一下

* changed indentation and deleted empty line

* add some tr()

* Delete .DS_Store

* delete some comment and use CamelCase

* resolved sth
2019-11-04 09:59:55 +08:00
Haoshen Zhong
fccf6863d7 Update README_zh.md (#987) 2019-10-15 18:12:58 +08:00
Le Tan
f61e2b9596 add v_next to config 2019-09-23 19:16:51 +08:00
Henry Zhu
1ab16db175 added theme v_next (#978) 2019-09-23 19:16:08 +08:00
Le Tan
782ee5995d release v2.7.2 2019-08-01 19:32:08 +08:00
Le Tan
4c3b0c96c7 use qt 5.9 on macOS 2019-07-06 09:47:25 +08:00
Le Tan
9037257e7c call java directly in win 2019-07-01 20:22:49 +08:00
Le Tan
c152c46384 release v2.7.1 2019-06-25 20:20:39 +08:00
洛水·锦依卫
13b1dd786e v_simple: change font size of titles in edit mode (#871) 2019-06-24 21:45:36 +08:00
Le Tan
af30757742 use 5.12.0 on macOS 2019-06-24 20:24:04 +08:00
Le Tan
151481cfca add config [web]/enable_code_block_copy_button 2019-06-24 20:23:50 +08:00
Le Tan
39795c3daa fix PlantUML command 2019-06-22 20:05:33 +08:00
Le Tan
6e22229eb9 release v2.7 2019-06-22 08:55:04 +08:00
Le Tan
687ea79cb7 refine Chinese translations 2019-06-22 08:48:19 +08:00
Le Tan
476ce365d7 DirectoryTree: support adding sibling folder 2019-06-22 08:31:50 +08:00
LuoshuiTianyi
f1b5c5428d add theme v_simple 2019-06-21 08:03:07 +08:00
Le Tan
1046d177f2 editor: fix leading space on macOS 2019-06-20 20:31:08 +08:00
Le Tan
6e3ab1d0bb macOS: use qt 5.12.1 instead of 5.12.3
web security issue in 5.12.3
2019-06-19 19:56:55 +08:00
Le Tan
50fbbdb7c2 fix typo 2019-06-16 10:44:18 +08:00
Hiroshi Miura
c9de59cf27 Update Japanese doc translation (#851)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-06-16 10:41:19 +08:00
Le Tan
58643ab7f2 add notices for fresh windows users 2019-06-16 10:39:39 +08:00
Le Tan
d9b92c89c2 PlantUML: use shell to launch java 2019-06-16 09:43:51 +08:00
Le Tan
3b1d9e9cbf remove redundant ending new line when copying code block in read mode 2019-06-15 10:13:58 +08:00
Le Tan
ada7400306 marked: fix code block line number 2019-06-14 19:42:27 +08:00
Le Tan
09df438f2e Editor: bug fix for smart table caused by QString.arg() 2019-06-10 20:45:33 +08:00
Le Tan
a9fbabb1e9 use 5.12.3 on macOS for Travis CI 2019-06-10 20:32:03 +08:00
Yunjie Chen
e78f375e81 markdown: add copy button to code blocks to copy source text 2019-06-08 12:25:10 +08:00
0xflotus
a2d296e525 fixed small error (#826) 2019-06-08 08:29:26 +08:00
Le Tan
e0ba7210f3 MdTab: fix bug which will open two tabs for the same file 2019-06-06 20:00:11 +08:00
Le Tan
357604a38d fix qrand 2019-06-04 21:36:34 +08:00
Le Tan
13d0c60e59 add config table_format_interval for smart table 2019-06-04 20:38:10 +08:00
Le Tan
84edcbd26e update Chinese translations 2019-05-31 20:35:25 +08:00
Le Tan
ae3f764c36 release v2.6 2019-05-31 20:10:16 +08:00
Le Tan
72748bb5c0 add hints about auto-save 2019-05-31 19:47:44 +08:00
Le Tan
b02b9d711b version-specific user track 2019-05-21 20:57:36 +08:00
Le Tan
8d780bd589
Update .travis_linux.sh 2019-05-11 14:54:13 +08:00
Le Tan
aeedb09fac release v2.5 2019-05-11 14:24:24 +08:00
Le Tan
fe14402224 update Chinese translations 2019-05-11 14:18:46 +08:00
Le Tan
56715bc9a5 do not show welcome page repeatedly 2019-05-09 19:10:12 +08:00
Le Tan
1cd809ed8f remove credict info in export template 2019-04-29 18:38:09 +08:00
Le Tan
3c05e9b27b refine user track logics 2019-04-27 11:45:31 +08:00
Le Tan
14617a4172 support left alignment for RTL text in edit mode
Vim mode does not support it for now.
2019-04-26 19:43:56 +08:00
Le Tan
b3555cffba FileList: fix context menu and do not open new file in unkown type 2019-04-26 19:43:44 +08:00
Le Tan
de1e6ed3fa Revert "change default MathJax CDN"
This reverts commit 802a38b86c61f470efe9767d494142817cd0141b.

It seems that jsdeliver is not safe enough.
2019-04-18 20:34:26 +08:00
Le Tan
802a38b86c change default MathJax CDN 2019-04-18 20:10:12 +08:00
Le Tan
b122632ad4 refine default configs 2019-04-09 20:16:31 +08:00
Le Tan
311ed253f5 release v2.4 2019-04-05 10:47:24 +08:00
Le Tan
edb37c05e2 update Chinese translations 2019-04-05 10:34:27 +08:00
Le Tan
b33564726c prompt for restart after changing theme 2019-04-05 10:30:52 +08:00
Le Tan
18a8927efb update peg-highlighter 2019-04-04 20:30:54 +08:00
Le Tan
b7fa135956 MdTab: fix focus issue when toggling edit mode in a note without outline 2019-04-03 21:53:18 +08:00
Le Tan
93d2001519 support N to view current note's information in Captain mode 2019-04-03 21:53:04 +08:00
Le Tan
db68df4352 add how to enable Vim mode in welcome page 2019-04-03 21:52:51 +08:00
Le Tan
8871f56368 add config global/sync_note_list_to_current_tab to auto locate to current tab in note list 2019-03-28 19:01:33 +08:00
Le Tan
78a6602ad4 Return to select on macOS 2019-03-25 19:40:03 +08:00
Le Tan
03e9982980 Revert "XCode 10.1 and Qt 5.12.1 on macOS CI"
This reverts commit 7beebd8c0ad1fb2cd4c3f872b2df0d1523301445.
2019-03-21 09:12:14 +08:00
Le Tan
4890749b5d Revert "Qt 5.12 and VS2017 on Windows for CI"
This reverts commit ae70c6e28e058b8c112339bca2e2fd0feea4720a.
2019-03-21 09:11:59 +08:00
Le Tan
79e1a71a74 try packaging snap but fail 2019-03-20 17:24:48 +08:00
Le Tan
b73a024142
Create deepin_os_match2019 2019-03-16 21:06:34 +08:00
Hiroshi Miura
a8ab30bb8b CMake: Update packaging script (#663)
* cmake: update osx packaging script

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Fix debian package dependencies and more

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-03-11 12:06:46 +08:00
Le Tan
7beebd8c0a XCode 10.1 and Qt 5.12.1 on macOS CI 2019-03-09 17:12:56 +08:00
Le Tan
ae70c6e28e Qt 5.12 and VS2017 on Windows for CI 2019-03-09 15:30:37 +08:00
Le Tan
dd01b2c307 compile qt5ct 2019-03-07 21:45:44 +08:00
Le Tan
e534eec083 bundle qt5ct in Linux for a native look 2019-03-06 17:12:10 +08:00
Le Tan
bda9bf51c1 fix QWebEngineView's navigation request issue in Qt 5.12 2019-03-06 15:14:11 +08:00
Le Tan
470a40c80b fix macOS Travis CI 2019-03-05 19:45:00 +08:00
Le Tan
fcfc1ca976 release v2.3 2019-03-04 20:54:44 +08:00
Le Tan
7cd2a4fc2a update Chinese translations 2019-03-04 20:54:44 +08:00
Hiroshi Miura
b0bdccaa51 CMake build system for VNote (#648)
* Introduce cmake scripts

- CMake scripts
- Add gitignore related to cmake
- run code checker: clang-tidy, clazy, and IWYU

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Add cpp for header only class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* cmake: Add packaging feature

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* cmake: add VS2017 config

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* cmake: update Qt5 default path

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* cmake: improve cpack script

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* cmake: cosmetic change

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* cmake: fix cpack appimage builder error

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* cmake: Support Qt IFW installer builder

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* changelog: amend about cmake build system

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-03-02 19:37:28 +08:00
Hiroshi Miura
968d911d2c Update japanese translation (#641)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-02-23 18:23:17 +08:00
Hiroshi Miura
2c4aa07b2a Improve Issue template (#629)
Latest version in issue is bad practice.
2019-02-23 18:22:53 +08:00
Hiroshi Miura
d78e892d5c Include missing header files (#607)
- Explicitly include headers which is automaticaly
  QMake handle.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-02-13 19:47:38 +08:00
Le Tan
585bfacf5d use github.io for user track 2019-01-26 10:33:53 +08:00
Le Tan
231a639304 refine Chinese translations 2019-01-25 18:12:40 +08:00
Le Tan
5fff26a8b6 add user track logics 2019-01-25 09:24:09 +08:00
Hiroshi Miura
1675b944c4 fix wrong lang code (#574)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-01-16 20:24:50 +08:00
Le Tan
750f80c3ca NavigationPanel: refine stretch factor in split mode 2019-01-16 19:55:35 +08:00
Le Tan
e06ce87710 add config enable_smart_table to control whether format tables automatically 2019-01-15 20:41:22 +08:00
Le Tan
8319a7a029 update Linux Travis CI to Qt 5.9.7 2019-01-13 11:00:37 +08:00
Le Tan
63379cdfab fix 2019-01-13 10:58:48 +08:00
Hiroshi Miura
3c9c121d91 VSearchEngine: avoid virtual func in detor (#570)
Clang-tidy checker warns followings.

Call to virtual function during destruction
[clang-analyzer-optin.cplusplus.VirtualCall]
  stop();
  clear();
note: This destructor of an object of type '~VSearchEngine'
has not returned when the virtual method was called

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-01-13 10:55:20 +08:00
Le Tan
e8b2530ca3 refine translations 2019-01-13 10:54:26 +08:00
Hiroshi Miura
09befccd1e Add Japanese translations (#569)
* Add Japanese trnaslations

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Update READMEs

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* add  README_ja

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-01-13 09:49:06 +08:00
Le Tan
f4fb889361 Merge remote-tracking branch 'origin/master' into dev 2019-01-03 20:05:01 +08:00
Le Tan
6777829a1d editor: fix selection-color by style sheet 2019-01-03 20:02:55 +08:00
Le Tan
b9d1164d8d editor: fix selection-color by style sheet 2019-01-02 20:27:39 +08:00
Le Tan
e3b9d060f3 Editor: escape spaces while inserting link 2018-12-20 18:50:11 +08:00
Le Tan
37c415f732 Editor: fix smart table cell crossing lines 2018-12-19 20:04:47 +08:00
Le Tan
dd12a6cdf3 change default openGL option 2018-12-15 12:54:44 +08:00
Le Tan
7d397d567e release v2.2 2018-12-15 10:06:12 +08:00
Le Tan
92c349077b update Chinese translations 2018-12-15 09:48:47 +08:00
Le Tan
1a8820eb02 change default OpenGL and startup page type 2018-12-10 21:56:57 +08:00
Le Tan
9ab410f8e0 Revert "MainWindow: try fix again"
This reverts commit cfb938365d4a0754a9fbcac1f3fec31f1c59fad7.
2018-12-06 21:49:30 +08:00
Le Tan
cfb938365d MainWindow: try fix again 2018-12-06 20:43:12 +08:00
Le Tan
8024b55a75 MainWindow: fix layout again 2018-12-06 20:12:15 +08:00
Le Tan
ae6849adec MainWindow: fix layout restore 2018-12-06 19:28:18 +08:00
Le Tan
c7f35b4ffa try to fix central widget's no-resizing after hiding dock widget in AppImage 2018-12-05 21:55:46 +08:00
Le Tan
64960cc3c5 editor: support prepend_dot_in_relative_path config 2018-12-03 19:51:04 +08:00
Le Tan
369ccb34e8 update Chinese translations 2018-12-01 12:34:19 +08:00
Le Tan
12d5bb27ef markdown: support WaveDrom diagram in language wavedrom code block
In place preview is not supported.
2018-11-30 21:01:31 +08:00
Le Tan
25e79b66b1 update VToolBox's margin 2018-11-29 21:43:09 +08:00
Le Tan
61713915b5 Editor: add Insert As Relative Image Link option 2018-11-29 21:27:09 +08:00
Le Tan
a7ba7e9d58 Editor: remember last used browse path when inserting image 2018-11-29 21:27:00 +08:00
Le Tan
7928874936 fix tab stop width temporarily 2018-11-29 21:26:42 +08:00
Le Tan
05a42bd2bb Table: use the length of header row as the length of the table 2018-11-29 21:26:19 +08:00
Le Tan
8d95553e82 fix margin of VToolBox 2018-11-28 20:28:28 +08:00
Le Tan
9e6fc4ff2e FileList: fix shortcut to open file via default program 2018-11-28 19:52:01 +08:00
Le Tan
70374607bb Add insert table toolbar button 2018-11-28 19:31:43 +08:00
Le Tan
70caa4d932 editor: auto format table 2018-11-28 19:31:26 +08:00
Le Tan
bcb6adef30 refine welcome 2018-11-25 12:21:32 +08:00
Le Tan
324d8ab7a5 update README 2018-11-25 12:05:50 +08:00
Le Tan
48ca6509d3 update README 2018-11-25 11:50:12 +08:00
Le Tan
b3c3693ffc update README 2018-11-25 11:45:37 +08:00
Le Tan
f9e9735d5f Preview: fix glitchy PlantUML preview when no background is specified 2018-11-25 11:20:31 +08:00
Le Tan
313a8647a8 PegParser: support TABLE style 2018-11-23 19:46:33 +08:00
Le Tan
ee2d4947be PegMarkdownHighlight: update for GFM table 2018-11-23 19:46:23 +08:00
Le Tan
72dcb181cc NavigationMode: add m_isSecondKey member 2018-11-22 20:31:56 +08:00
Le Tan
28eb48cc2e PegParser: support ~~~ as fenced code block 2018-11-22 20:31:47 +08:00
Le Tan
026f3a6535 clean src.pro 2018-11-21 20:12:29 +08:00
Le Tan
2e2f67ced4 TagPanel: clear text after pressing return in the completion list 2018-11-21 20:12:21 +08:00
Le Tan
231f318259 PegParser: update pegmarkdownhighlight to fix strike 2018-11-20 20:13:56 +08:00
Le Tan
7955246a51 web: add anchor to the title 2018-11-20 20:13:49 +08:00
Le Tan
31ceeec252 VTextDocumentLayout: add debug info for the crash 2018-11-19 19:48:31 +08:00
Le Tan
5b996654cf DirectoryTree: warn if user does not drop on a folder item 2018-11-12 20:12:30 +08:00
Le Tan
b6b73c3f82 editor: guess the image title from image path when inserting an image 2018-11-12 20:12:07 +08:00
Le Tan
0ef38171e9 web: minor fix 2018-11-10 20:01:24 +08:00
Le Tan
2637fd90ec markdown-it: support alert text via markdown-it-container plugin
::: alert-info
This is an info text.
:::
2018-11-09 20:37:44 +08:00
Le Tan
1951b30b11 OpenGL: add option in settings on Windows to specify OpenGL implementation 2018-11-07 20:31:53 +08:00
Le Tan
c606069c1c MainWindow: save state after toggling split out 2018-11-07 20:31:46 +08:00
Le Tan
c640118dfa TextDocumentLayout: bug fix for block count change
Example text that will make VNote crash:

```
ab123  aaa
```

Then select the space before `aaa` and press `Enter`.
2018-11-07 20:31:21 +08:00
Le Tan
64d2aab76a TagExplorer: support spliting file list out 2018-11-03 20:45:49 +08:00
Le Tan
73b1db7a52 NotebookPanel: support spliting file list out 2018-11-03 20:03:12 +08:00
Le Tan
a21a1e723a Editor: support specifying font via settings to override style 2018-11-02 19:54:23 +08:00
Le Tan
ee6059ff7c translate path from native separtor to / 2018-11-02 19:54:14 +08:00
Le Tan
6455e9ca19 style: fix image caption style to avoid mess up after export
Use span instead of div to wrap the image caption.
2018-11-01 21:22:23 +08:00
Le Tan
61925a9c30 style: force to left-aligned tab bar 2018-11-01 21:22:03 +08:00
Le Tan
6a470ba2f4 PegParser: update PegMarkdownHighlight for MathJax
1. Support $ in $$..$$;
2. Support raw display formula \begin{}...\end{}
2018-11-01 19:55:31 +08:00
Le Tan
439f0013c9 style: use another font as Verdana do not work well with pinyin 2018-10-31 22:12:01 +08:00
Le Tan
4ae4960358 markdown-it: MathJax support $.$ in \text{} within $$...$$ 2018-10-31 22:11:40 +08:00
Le Tan
bdf4e10c6e markdown-it: support \begin...\end for MathJax 2018-10-30 20:47:57 +08:00
Le Tan
aeb2263be3 Editor: support auto scrolling cursor line into center 2018-10-30 20:47:41 +08:00
Le Tan
f3ff862cfb MathJax: support euqation number
http://docs.mathjax.org/en/latest/tex.html#automatic-equation-numbering
2018-10-30 20:47:28 +08:00
Bilal
a246b7abab intrenal -> internal typo fix (#469) 2018-10-29 08:51:53 +08:00
Le Tan
7a03e38a2c release v2.1 2018-10-27 16:55:28 +08:00
Le Tan
fe2a06e7f4 refine docs 2018-10-27 16:52:45 +08:00
Le Tan
fd3f526dcb refine Chinese translations 2018-10-27 16:39:59 +08:00
Le Tan
bd16ae27c0 do not enable HighDpiScaling from QT 2018-10-27 10:03:34 +08:00
Le Tan
553b2b08a3 TabIndicator: left aligned column number 2018-10-26 20:03:00 +08:00
Le Tan
47eae737f7 refine README 2018-10-25 21:10:21 +08:00
Le Tan
3aaea23545 fix combo box style on macOS 2018-10-25 21:03:41 +08:00
Le Tan
493ba08bd0 TabIndicator: refine style 2018-10-25 21:03:41 +08:00
Le Tan
1b39cf4af5 fix icon 2018-10-25 21:03:41 +08:00
Le Tan
09ae24395d marked: upgrade of the Marked break the language keyword of code block
Change from "lang" to "language".
2018-10-25 21:03:41 +08:00
Le Tan
2a7a4f864e WebView: do not set background color to transparent
Setting background color of a web engine page to transparent will force
it to render using grayscale antialiasing.
2018-10-25 21:03:41 +08:00
akkuman
9b9f2cdea3 Updated README.md (#464)
* Update README_zh.md

* Updated README.md
2018-10-25 21:02:42 +08:00
Le Tan
26ec4eb42b try fix the blur issue of toolbar icon on macOS 2018-10-23 20:45:45 +08:00
Le Tan
29c1c346a4 MdTab: handle non-exist file 2018-10-22 13:20:13 +08:00
Geoffrey Cheung
8d42ffea0f Update src/utils/vmetawordmanager.cpp (#462)
* Update src/utils/vmetawordmanager.cpp

add week number(%w%)

* Update src/utils/vmetawordmanager.cpp

Co-Authored-By: geoffreycheungr <geoffreycheung@126.com>

* Update src/utils/vmetawordmanager.cpp

Co-Authored-By: geoffreycheungr <geoffreycheung@126.com>

* Update src/utils/vmetawordmanager.cpp

Co-Authored-By: geoffreycheungr <geoffreycheung@126.com>
2018-10-22 08:22:52 +08:00
Le Tan
88d915c43c update welcome docs 2018-10-21 21:57:33 +08:00
Le Tan
e46bffa1b1 add welcome page 2018-10-18 19:55:01 +08:00
Le Tan
3b2154f45e Preview: fix image scaling for downloaded preview images 2018-10-18 19:54:47 +08:00
Le Tan
a12f01e617 TextDocumentLayout: add debug info to investigate the crash 2018-10-17 20:51:27 +08:00
Le Tan
f7ba98f3bb update Marked to 0.5.1 2018-10-17 20:43:08 +08:00
Le Tan
4cced65863 export: add icon, title and footer to exported HTML 2018-10-17 20:02:10 +08:00
Le Tan
c0af5aeb71 Turndown: delete redundant spaces after list item 2018-10-17 20:02:01 +08:00
Le Tan
203544632e MdEditor: turn equation from zhihu.com to MathJax when fetching images 2018-10-17 20:01:51 +08:00
Le Tan
3196ef8512 add restart action in file menu 2018-10-17 20:01:42 +08:00
Le Tan
0eab02de9b Turndown: remove \n in table cell
When pasting table from OneNote, there may be redundant \n that will
break the table.
2018-10-17 20:01:28 +08:00
Le Tan
627664bb0e refine notebook panel 2018-10-17 20:01:18 +08:00
Le Tan
81fde672f9 PegParser: update for display formula number to bcb0d729e4d4db5c27ce7bb7c69577120d6a5fc0 2018-10-17 19:59:34 +08:00
Le Tan
8184f3a1af Mathjax: support equation number in read mode 2018-10-17 19:57:14 +08:00
Le Tan
2b5b460451 pmh_parser: update to 9f5cebec152d6611d28f08152e07f81a76ff419f for HRULE 2018-10-15 19:53:58 +08:00
Le Tan
8dbcf139d8 PegParser: fix Unicode characters above 65535
QString() will use two characters to save one Unicode chartacter if its
code point is above 65535, which causes the parse result shift.
2018-10-15 19:39:28 +08:00
Le Tan
29079ade72 vim: handle keys when CapsLock is on 2018-10-15 19:39:17 +08:00
Le Tan
ec15475c87 Turndown: remove title and alt text if they contains invalid characters
It is useful especially for OneNoe.
2018-10-15 19:39:01 +08:00
Le Tan
1b95b636e7 image related fixes
- Support previewing cross-line image link;
- Do not consider image title when generating image name and use current
time at the front to make it easy to sort.
2018-10-14 11:59:25 +08:00
Le Tan
94fd430c06 style: add style for QSlider 2018-10-13 12:33:19 +08:00
Le Tan
f85f2cc3a3 web: skip scroll check 2018-10-12 20:20:43 +08:00
Le Tan
ba75c94f40 FileList: support drag&drop to copy/move files 2018-10-12 20:20:24 +08:00
Le Tan
d1e7926630 Export: export attachments with attachment folder path 2018-10-12 20:20:04 +08:00
Le Tan
43fcdd502a Editor: support Ctrl+Shift+V to paste as plain text 2018-10-12 20:19:32 +08:00
Le Tan
6d1830ad86 fix local image path with query parameters 2018-10-12 20:19:31 +08:00
Le Tan
b27da44c7a MdEditor: fix suffix of url with query parameters 2018-10-12 20:19:31 +08:00
Le Tan
33350e6bdf MdEditor: support Attach And Insert Link action 2018-10-12 20:19:30 +08:00
Le Tan
3779dd1b81 MdEditor: add action to insert link to attachment 2018-10-12 20:19:30 +08:00
JianYueLin
a1f1618824 fix src/vmdeditoperations.cpp error (#443)
* fix insertImageFromPath function param error : can't convert QString to QString &

* fix src/vmdeditoperations.cpp error
2018-10-09 23:21:20 +08:00
Le Tan
0484656c1f AttachmentList: support copying file path of attachment 2018-10-08 20:41:22 +08:00
Le Tan
e27907e5b4 Turndown: cover table from Microsoft Excel 2018-10-08 20:40:59 +08:00
Le Tan
dc9c9f6bbd MdEditor: close the temporary file explicitly after writing 2018-10-08 20:40:45 +08:00
Le Tan
61909c2c5d MdEditOperations: check source image before insert from path 2018-10-06 15:04:18 +08:00
Silver Bullet
af39cf5232 vnote is outdate. use vnote-bin from AUR. (#436)
Use `vnote-bin` instead of `vnote` from AUR.
2018-10-06 14:26:28 +08:00
Le Tan
9923feea14 InsertImageDialog: support scaling image 2018-09-30 23:01:11 +08:00
Le Tan
5cc8d6c8f1 MdEditor: support downloading images to local when Parse&Paste 2018-09-30 23:00:58 +08:00
Le Tan
a67584f8bb VEditArea: only check outside change of files in active tabs 2018-09-29 18:38:32 +08:00
Le Tan
751082c820 Downloader: enable auto following re-directed request 2018-09-29 18:38:24 +08:00
Le Tan
574aa4e70a KeyboardLayout: support specifying keyboard layout mappings
Captain mode now supports different layout mappings.
2018-09-29 18:37:50 +08:00
Le Tan
d014842bbf Editor: refine completion in reverse case
Remove duplicates after reversing the list.
2018-09-29 18:37:12 +08:00
Le Tan
d27d20c4ea update to qt5.9.6 in Linux 2018-09-26 19:24:36 +08:00
Le Tan
f7589983b5 Editor: fix completion 2018-09-26 19:24:25 +08:00
Le Tan
bc711e755c VTextDocumentLayout: bug fix in relayout() 2018-09-26 19:24:18 +08:00
Le Tan
12b819250d update issue template 2018-09-26 19:24:07 +08:00
Le Tan
02fc5f20f3 UniversalEntry/Searcher: Ctrl+B to expand/collapse all items 2018-09-26 19:23:56 +08:00
Le Tan
3902f7f080 refine shortcuts doc 2018-09-26 19:23:42 +08:00
Le Tan
dc659b6c7a Outline: update outline panel manually when tree is empty 2018-09-24 12:40:26 +08:00
Le Tan
803a0b66df Navigation: fix navigation visible items of list/tree widgets
isHidden() will be false even the item is not visible in current viewport.
2018-09-24 11:41:33 +08:00
Le Tan
b025327c85 fake commit to trigger build 2018-09-22 13:27:36 +08:00
Le Tan
6551b0b685 release v2.0 2018-09-22 12:48:35 +08:00
Le Tan
b72f24545e refine Chinese translations 2018-09-22 10:44:38 +08:00
Le Tan
a4d6f042ef update changes.md 2018-09-21 19:41:23 +08:00
Le Tan
9b83d50116 fix
- Selection style in mdhl does not work on macOS. Choose another Vim
visual line background.
- Disable multiple keyboard layout support on macOS.
- Make close_before_external_editor work when opening with default
program.
2018-09-21 19:41:07 +08:00
Le Tan
77dd8d0f32 Export: support outline panel in exported HTML file 2018-09-20 19:22:53 +08:00
akkuman
03ff391948 Add outline template for export html (#404)
Draft for outline implementation in exported html file
2018-09-18 19:33:14 +08:00
Le Tan
55b835a97c Exporter: add PDF-Like option for custom export 2018-09-18 19:27:51 +08:00
Le Tan
68dc2425a9 Editor: support highlighting tabs 2018-09-18 19:27:42 +08:00
Le Tan
f9820cf709 VTextEdit: bug fix 2018-09-18 19:27:33 +08:00
Le Tan
14ab49165e Vim: double-click to enter Visual mode 2018-09-18 19:27:23 +08:00
Le Tan
837fb47d4d style: use smaller font size for headings 2018-09-18 19:26:54 +08:00
Le Tan
30a3a6e74a MdEditor: support inserting file as relative link 2018-09-14 19:48:17 +08:00
Le Tan
b052fa0f05 Editor: fix find hanging bug 2018-09-13 19:59:58 +08:00
Le Tan
74032f4a08 PlantUML: unify online PlantUML process 2018-09-13 19:59:47 +08:00
Le Tan
a7bdcf4d54 Turndown: support parsing table without head 2018-09-13 19:56:18 +08:00
Le Tan
d66fd7c1c5 InplacePreview: support online PlantUML in-place preview 2018-09-12 20:36:00 +08:00
Le Tan
3b2852aa67 LivePreview: smart live preview for online PlantUML 2018-09-12 20:35:52 +08:00
Le Tan
62c0f218df MdTab: focus bug fix and find-in-page in expanded preview mode 2018-09-12 20:35:43 +08:00
Le Tan
4d223d0397 MdEditor: insert link or content when dropping file in editor 2018-09-12 20:35:15 +08:00
Le Tan
a055d6e935 Editor: highlight matches of full-text search result in page 2018-09-12 20:34:43 +08:00
Le Tan
647807a918 Editor: refine find logics 2018-09-10 20:26:39 +08:00
Le Tan
f3e4f370dd MdEditor: do not set link when copying image
Outlook will treat it as attachment if the clipboard contains both URL
and image data.
2018-09-10 20:26:29 +08:00
Le Tan
ca01e26333 Editor: refine find in page 2018-09-08 15:21:09 +08:00
Le Tan
33c3a5a301 StyleParser: bug fix for code block styles 2018-09-07 20:56:14 +08:00
Le Tan
8f1fbcef61 update issue template 2018-09-06 21:19:22 +08:00
Le Tan
d66b4752d4 MdTab: do not scroll editor when it is under the right header while entering edit mode 2018-09-06 21:12:17 +08:00
Le Tan
377c00c25d MagicWord: add %att% as the relative path of the attachment folder 2018-09-06 21:12:06 +08:00
Le Tan
c4c7f99ca7 suport Quick Access by Ctrl+Alt+I 2018-09-06 21:11:55 +08:00
Le Tan
3d188fa648 add config insert_new_note_in_front 2018-09-06 21:08:46 +08:00
Le Tan
32991051a9 MdEditor: bug fix in zoom 2018-09-05 20:23:42 +08:00
Le Tan
060c02297b LivePreview: support bidirectional smart live preview 2018-09-05 20:16:05 +08:00
Le Tan
2338002b1f LivePreview: support component/state/object diagram 2018-09-05 20:15:48 +08:00
Le Tan
774eec32d7 LivePreview: support UseCase diagram 2018-09-03 20:13:32 +08:00
Le Tan
ffa413fa26 Captain: fix captain mode in diffrent keyboard layout 2018-09-02 15:21:25 +08:00
Le Tan
af912619a0 vim: bug fix for mapping Caps as Ctrl in KDE 2018-09-01 19:23:52 +08:00
Le Tan
5d0b45715d ClipboardUtils: loop on Linux 2018-09-01 18:59:02 +08:00
Le Tan
22489137ae MathJaxPreview: fix preview while using local mathjax 2018-09-01 11:06:33 +08:00
Le Tan
b49d5a968f MdEditor: add shortcut hint to Toggle Live Preview 2018-08-31 20:25:06 +08:00
Le Tan
68dd95591d vim: add x for exemption key 2018-08-31 20:22:42 +08:00
Le Tan
72bb72477e support copy file path in context menu 2018-08-31 20:08:57 +08:00
Le Tan
b139e77173 fix bugs when copying/cutting folders across notebooks
- Maintain tags of the destination notebook;
- Fix the notebook of the source directory;
2018-08-31 20:08:45 +08:00
Le Tan
a96c23fff1 Editor: fix hang bug in QTextEdit's find() 2018-08-31 20:08:33 +08:00
Le Tan
3f5ccf6b6e Completion: bug fix when cursor is at the end of a word 2018-08-30 20:15:56 +08:00
Le Tan
74ec3884d0 LivePreview: search for multiple tokens and select the best match 2018-08-30 19:53:20 +08:00
Le Tan
2bf36319d1 LivePreview: smart live preview for sequence diagram 2018-08-30 19:53:06 +08:00
Le Tan
bf51b7b117 LivePreview: denote smart live preview 2018-08-29 20:47:07 +08:00
Le Tan
052757b2e8 update issue template 2018-08-29 20:36:35 +08:00
Le Tan
faa1ba0fb2 update issue template 2018-08-28 21:04:39 +08:00
Le Tan
126600dbb1 LivePreview: refine smart live preview
- Support class diagram.
- Support activity diagram.
2018-08-28 20:43:51 +08:00
Le Tan
28d5954bc3 MdEditor: fix turndown to parse HTML 2018-08-28 20:43:36 +08:00
Le Tan
7c7b9e8a3d MdEditor: insert image from network via tempoary file 2018-08-26 15:01:22 +08:00
Le Tan
cda48a612a LivePreview: smart live preview 2018-08-26 14:12:02 +08:00
Le Tan
13fb03bd11 update peg-markdown-highlight 2018-08-24 20:14:51 +08:00
Le Tan
185f6d0dcb fix image title constraint 2018-08-24 20:14:38 +08:00
Le Tan
45d4b28003 Editor: fix trailing space highlight 2018-08-24 20:14:17 +08:00
Le Tan
33c1229fb5 MdTab: remove the duplication check when current header change 2018-08-24 20:14:04 +08:00
Le Tan
b0cd013988 FileList: show status tip about fie info 2018-08-24 20:13:52 +08:00
Le Tan
94828a65ad Vim: support specifying leader key via [editor]/vim_leader_key 2018-08-24 20:13:35 +08:00
Le Tan
cbe83afb91 MdEditor: refine context menu 2018-08-24 20:13:09 +08:00
Le Tan
472167b7d0 release v1.22 2018-08-23 20:28:28 +08:00
Le Tan
6fb6ce3f50 refine Chinese translations 2018-08-23 20:25:58 +08:00
Le Tan
3c423061f6 LivePreview: update live preview when using old cache 2018-08-22 20:08:58 +08:00
Le Tan
4ef6925bf7 Searcher: add name of parent directory to the result 2018-08-22 20:08:48 +08:00
Le Tan
5d4b450fab UniversalEntry: add parent directory name before item name in the result 2018-08-22 20:08:32 +08:00
Le Tan
4b0152c606 VSearch: fix tag search
"abc def" to search file with tag "abc" and "def".
2018-08-22 20:08:10 +08:00
Le Tan
e1091e0d80 PegMarkdownHighlighter: dynamic fast parse timer interval 2018-08-22 20:01:50 +08:00
Le Tan
d4daf32f20 MdEditor: support copying diagram in puml and graphviz 2018-08-22 20:01:31 +08:00
Le Tan
1fe975b1ad PegMarkdownHighlighter: recognize code block among new blocks 2018-08-20 19:45:56 +08:00
Le Tan
c2bb490378 MdEditor: copy backgorund when copying in-place preview 2018-08-20 19:10:48 +08:00
Le Tan
bcb307aa4b refine README 2018-08-19 12:30:52 +08:00
Le Tan
1ce8c05da9 MdEditor: support copy in-place preview 2018-08-19 12:06:50 +08:00
Le Tan
f98c2f5382 MdEditor: aware of links and images in edit mode 2018-08-18 18:47:29 +08:00
Le Tan
dc1f1c4535 MdEditor: support pasting HTML as converted Markdown text via Turndown 2018-08-17 22:42:21 +08:00
Le Tan
b9da920bb4 Preview: fill background 2018-08-15 21:07:22 +08:00
Le Tan
0508e8f34d Completion: consider word separator 2018-08-15 19:55:52 +08:00
Le Tan
9a173168ff Editor: fix trailing space highlight 2018-08-15 19:55:35 +08:00
Le Tan
35f66ba88e Preview: scale SVG via QSvgRenderer 2018-08-15 19:55:20 +08:00
Le Tan
33f4631f91 EditWindow: support middle click to close a tab 2018-08-15 19:55:02 +08:00
Le Tan
a53fdf27b6 EditWindow: bug fix of tag status update 2018-08-14 20:08:56 +08:00
Le Tan
6793855164 PegMarkdownHighlighter: tune performance 2018-08-14 20:08:27 +08:00
Le Tan
eaa8d55f66 theme: refine v_native styles 2018-08-13 20:14:33 +08:00
Le Tan
968e74e1ca PreviewManager: refactor layout logics
- Bug fix: use cached image name in preview helpers;
- Only relayout necessary blocks;
2018-08-13 20:14:18 +08:00
Le Tan
be5e34cc85 Log: add debug info to log in release build 2018-08-13 20:14:03 +08:00
Le Tan
5b7c4943e3 MdEditOperations: bug fix 2018-08-11 12:49:50 +08:00
Le Tan
83f63d0328 fix compilation error 2018-08-10 22:49:13 +08:00
Le Tan
2e2bf31239 fix compilation error 2018-08-10 22:31:23 +08:00
Le Tan
83baa74a27 release v1.21 2018-08-10 21:06:46 +08:00
Le Tan
aa539b3e16 refine Chinese translations 2018-08-10 20:54:49 +08:00
Le Tan
b94a9489d2 PegMarkdownHighlighter: fix the timer issue 2018-08-10 20:46:15 +08:00
Le Tan
4db6c1cc7b move Vim option from menu to settings 2018-08-10 20:46:03 +08:00
Le Tan
4fbe2d87b7 MdEditOperations: support auto block quote 2018-08-09 20:00:42 +08:00
Le Tan
da36e1a91f refine Chinese translations 2018-08-08 21:41:25 +08:00
Le Tan
dbad57675d theme: refine style 2018-08-08 21:01:49 +08:00
Le Tan
e2eb4efb45 MdEidtOperations: support * as list bullet in auto list 2018-08-08 20:40:45 +08:00
Le Tan
8055f17d1f Preview: add hint for live preview 2018-08-08 20:40:33 +08:00
Le Tan
56bcc9be54 PegMarkdownHighlighter: use cached result to highlight before fast parse 2018-08-08 20:39:59 +08:00
Le Tan
29c0701e6b Captain: exit captain mode before closeEvent() to avoid crash 2018-08-07 20:59:58 +08:00
Le Tan
77954a7d64 VTextDocumentLayout: hold layout info in block data 2018-08-07 20:59:46 +08:00
Le Tan
efd3740198 add hint for re-opening tabs 2018-08-07 20:59:33 +08:00
Le Tan
2298338094 VNotebook: refine logics of building notebook from existing file structures 2018-08-05 22:41:42 +08:00
Xinjun Ma
09c610e3a9 recursive import external folders (#332)
* recursive import external folders

* rollback translation

* fix when path does not exist

* add blank line
2018-08-05 18:15:26 +08:00
Le Tan
19bd159aba MainWindow: bug fix for GUI mess up of toolbars
After toggling between read and edit mode multiple times, the toolbar's
buttons may be grey but clickable in edit mode. Add a timer to update
them soon after the change.
2018-08-05 11:02:08 +08:00
Le Tan
e5ff101085 fix compilation error 2018-08-04 19:19:43 +08:00
Le Tan
10a1e9c1a8 Editor: support completion 2018-08-03 19:13:33 +08:00
Le Tan
284cba698f PegMarkdownHighlight: refine fast parse 2018-07-31 20:41:49 +08:00
Le Tan
bfac189cb7 PegMarkdownHighlighter: cache result for performance 2018-07-30 21:55:07 +08:00
Le Tan
24a20e60e9 Editor: improve trailing space highlight performance 2018-07-29 16:18:50 +08:00
Le Tan
8679ffa051 PegMarkdownHighlighter: improve performance 2018-07-29 10:17:59 +08:00
Le Tan
9b49de3ab5 MdEditOperations: Ctrl+U to delete till the space of block 2018-07-27 21:05:07 +08:00
Le Tan
2e7b2e1e5d TagPanel: add two configs to control the behavior
- max_tag_label_length
- max_num_of_tag_labels
2018-07-27 21:04:50 +08:00
Le Tan
47503fddfe TagExplorer: use RegularExpression instead of WholeWordOnly when searching for a tag
"\bc#\b" won't match a word. We use "^c#$" instead.
2018-07-25 21:54:36 +08:00
Le Tan
0ae6b1a810 theme: refine styles for MARK 2018-07-25 21:19:20 +08:00
Le Tan
5c7bc6d537 peg-markdown-highlight: update for pmh_MARK 2018-07-25 20:53:44 +08:00
Le Tan
6ab85e1c1c Outline: focus to edit area after item clicked or activated in Navigation mode 2018-07-25 07:25:56 +08:00
Le Tan
72fb0f18c6 flowchart.js: update to 1.11.3 2018-07-25 06:47:16 +08:00
Le Tan
ba0660de28 MdEditor: fix zoomPage() bug after setting style sheet 2018-07-25 06:39:31 +08:00
Le Tan
2b01a4ccd0 theme: refine styles 2018-07-24 21:04:32 +08:00
Le Tan
87169832be peg-markdown-highlight: update to fix pmh_NOTE 2018-07-24 21:04:17 +08:00
Le Tan
b4554e1be8 MainWindow: remember expanded state 2018-07-24 21:03:31 +08:00
Le Tan
dace19119f release v1.20 2018-07-23 19:58:01 +08:00
Le Tan
794d77433f theme: refine styles 2018-07-23 19:55:15 +08:00
Le Tan
2c3672d2b8 refine Changes.md 2018-07-22 15:22:17 +08:00
Le Tan
918513bb7d refine Chinese translations 2018-07-20 21:05:11 +08:00
Le Tan
2356316d9b translations: fix typo of Qt translations 2018-07-20 20:26:23 +08:00
Le Tan
76554b63f4 PegHighlighter: bug fix for single format blocks 2018-07-20 20:07:07 +08:00
Le Tan
25ec41c3f0 WebView: fix context menu in preview mode 2018-07-20 20:06:55 +08:00
Le Tan
41bf2d9cec MdTab: fix reload() logic to re-load images 2018-07-20 20:06:46 +08:00
Le Tan
17b1a606d5 PegHighlighter: fix index-out-of-scope issue when parsing results
When user inserts many empty lines at once, the increated block number
may exceed the range of the parser result.
2018-07-20 20:06:36 +08:00
Le Tan
46738c7f6e theme: refine styles 2018-07-20 20:06:25 +08:00
Le Tan
83f1909e84 fix compiler warnings 2018-07-20 07:15:11 +08:00
Le Tan
21e5aac024 VTextEdit: force to update() to show cursor while dragging text
This is a work-around.
2018-07-19 20:53:09 +08:00
Le Tan
42fbdace55 VNoteFile: update config file after save() to update the modified time 2018-07-19 20:52:45 +08:00
Le Tan
6f1a0c6980 docs: add superscript and subscript description 2018-07-19 20:52:26 +08:00
Le Tan
dec308cbde editor: fix the style sheet issue 2018-07-19 20:52:07 +08:00
Le Tan
976f7ff403 theme: refine styles 2018-07-18 20:05:59 +08:00
Le Tan
1c7e91d26d Explorer: add Up button to go up to parent directory 2018-07-18 20:05:45 +08:00
Le Tan
2ae742cc07 UniversalEntry: U to search the content of notes in Explorer root directory 2018-07-18 20:05:27 +08:00
Le Tan
5f65dc95c5 VSearch: support searching Explorer directory 2018-07-18 20:04:57 +08:00
Le Tan
98f2238dd1 style: do not override background-color in VMdEditor 2018-07-17 20:43:56 +08:00
Le Tan
4d953542f2 VTextDocumentLayout: draw block background for HRULE 2018-07-17 20:43:43 +08:00
Le Tan
48db50fd5e PegHighlighter: refine fast parse
- Fast parse block range: look upward till the indentation is 0;
- Rehighlight all the fast-parsed blocks explicitly;
- Do not reset block user state by default;
- Pre highlight single format blocks to avoid jitter of line height;
2018-07-17 20:43:28 +08:00
Le Tan
59efed94f3 config: add [global]/image_name_prefix for inserted images 2018-07-15 20:06:05 +08:00
Le Tan
40424b7931 docs: update markdown_guide 2018-07-14 13:16:20 +08:00
Le Tan
abee597812 PegHighlighter: support fast parse 2018-07-14 12:45:15 +08:00
Le Tan
0e724635b3 MdEditor: fix the font style issue
Font family may be constrained by QWidget style in qss file.
2018-07-14 07:00:45 +08:00
Le Tan
3e29a647ab MdTab: fix the synchronization between read and edit mode
Mute web view in edit mode.
2018-07-13 21:54:26 +08:00
Le Tan
926e053d37 PegHighlighter: brush code block indentation 2018-07-13 20:32:34 +08:00
Le Tan
f5bbc1ccd7 PegHighlighter: support math 2018-07-13 20:32:22 +08:00
Le Tan
d06dcc36f5 markdown-it-texmath: add constraint to the end of the block equation 2018-07-13 20:32:10 +08:00
Le Tan
d2e054994b peg-markdown-highlight: update to 7385865a6c1eff676f9e3624e0f88c2834bb6d8a 2018-07-13 20:31:34 +08:00
Le Tan
bb308a06d1 PegMarkdownHighlighter: multi-threads highlighter support 2018-07-12 20:19:23 +08:00
Le Tan
fbfc6c1dd6 highlighter: support Fenced Code Block 2018-07-12 20:19:07 +08:00
Le Tan
a20d306aab peg-markdown-highlight: update to c3fd99c8fe6a7041b3c01f607b602aba1aa36416
For fenced code block support.
2018-07-12 20:18:24 +08:00
Le Tan
a305b6872e highlighter: support Front Matter for YAML meta data 2018-07-09 20:19:49 +08:00
Le Tan
5b681dd64c peg-markdown-highlight: update to 03b1cae7646acc3586910679b0b4872d6f4b5884
Support FRONTMATTER.
2018-07-09 20:18:43 +08:00
Le Tan
d9c8051fa3 editor: Ctrl+; to insert inline code, Ctrl+J/K to scroll page 2018-07-07 17:57:00 +08:00
Le Tan
7ef3d49c0c theme: refine visited link style and fonts 2018-07-05 21:05:10 +08:00
Le Tan
35be1516ed markdown-it: use markdown-it-texmath to get rid of escape of MathJax 2018-07-05 20:41:16 +08:00
Le Tan
027c8abd17 Explorer: support Vim navigation 2018-07-04 19:56:19 +08:00
Le Tan
d67ef089b6 Explorer: support drag&drop a directory to VNote to open it in Explorer 2018-07-04 19:49:21 +08:00
Le Tan
5ebc7b8243 Outline: support increase/decrease the expanded level
Add config [global]/outline_expanded_level (6 by default).
2018-07-04 19:07:43 +08:00
Le Tan
4f4652dc3a fix build warning 2018-07-03 21:56:42 +08:00
Le Tan
b6ecc2eae1 release v1.19 2018-07-03 20:56:28 +08:00
Le Tan
351df3740d refine Chinese translations 2018-07-03 20:50:50 +08:00
Le Tan
bc932fa913 CaptainMode: Y to focus to edit area 2018-07-03 20:27:35 +08:00
Le Tan
927bb54502 TagIndicator/TagExplorer: support Navigation mode 2018-07-03 19:38:36 +08:00
Le Tan
7305706294 export: escape ' by %27 in data URI 2018-07-03 19:35:17 +08:00
Le Tan
b88694bf3a TagExplorer: search tag case-sensitive and whole-word-only 2018-06-30 22:54:24 +08:00
Le Tan
b10078efa3 WebView: double-click to view diagrams
Mermaid is not supported since its use of external stylesheet.
2018-06-30 22:17:33 +08:00
Le Tan
b2690a42e7 bug-fix: exclude all whitespaces except space in file name 2018-06-30 22:17:20 +08:00
Le Tan
62f4471b46 export: escape '#' in data URI body as "%23" 2018-06-30 22:17:07 +08:00
Le Tan
4df0d03baa WebView: click an image to view/zoom it 2018-06-30 22:16:51 +08:00
Le Tan
15151742c9 HGMarkdownHighlighter: use font family of inline code for MathJax 2018-06-30 22:16:33 +08:00
Le Tan
2123e3abff ConfigManager: remove check logics of obsolete config file 2018-06-30 22:16:19 +08:00
Le Tan
155199ed49 markdown-it: add margin for number emoji 2018-06-30 22:16:07 +08:00
Le Tan
fad6003660 export: fix rendering issue of non-ASCII chars in Graphviz
We use SVG format for Graphviz when exporting to PDF to avoid specifying
proper font.
2018-06-30 22:15:55 +08:00
Le Tan
13c2d143bb TagExplorer: add explorer for tags 2018-06-16 09:01:34 +08:00
Le Tan
f94169053e UniversalEntry: support searching tags
- z: search tags of notes in all notebooks;
- c: search tags of notes in current notebook;
- v: search tags of notes in current folder;
2018-06-16 09:01:15 +08:00
Le Tan
ffd653ef55 support tags of notes
- Adding/Removing tags of notes;
- Auto-completion of tags;
2018-06-16 09:00:59 +08:00
Le Tan
3bd80387fa SettingsDialog: add test buttons for PlantUML and Graphviz 2018-06-16 09:00:36 +08:00
Le Tan
a5e64696ea web: fix finishLogics() bug
Treat MathJax as an async job.
2018-06-16 09:00:14 +08:00
Le Tan
a0b032ddfc theme: refine styles 2018-06-16 08:59:53 +08:00
Le Tan
4267875e1c release v1.18 2018-06-09 09:49:26 +08:00
Le Tan
8d600632b4 update MathJax CDN 2018-06-09 09:21:11 +08:00
Le Tan
988e8f2336 refine Chinese translations 2018-06-09 08:55:31 +08:00
Le Tan
ec8b7d8032 theme: scale QMenu 2018-06-08 23:38:04 +08:00
Le Tan
b0a10d4169 TabIndicator: fix the width of WordCountInfoPanel with scale factor 2018-06-08 23:20:34 +08:00
Le Tan
dceec24021 Utils: fix onlyHasImgInHtml() to consider <span> and <div> 2018-06-08 20:02:42 +08:00
Le Tan
a6e7d9fcac theme: refine QGroupBox styles 2018-06-08 20:02:00 +08:00
Le Tan
4549919e68 Editor: refine image-insert dialog 2018-06-08 20:01:37 +08:00
Le Tan
e59a23cda6 MainWindow: support hiding tool bar
ToolBar: Ctrl+E Shift+#
2018-06-08 20:01:19 +08:00
Le Tan
ecbed00467 EditArea: support maximize split or distribute splits evenly
MaximizeSplit: Ctrl+E Shift+|
DistributeSplits: Ctrl+E =
2018-06-08 20:00:59 +08:00
Le Tan
feea50d888 FileList: bug fix when importing the same note file in the same folder 2018-06-08 20:00:20 +08:00
Le Tan
88d719bb28 WebView: disable context menu in preview mode 2018-06-08 20:00:01 +08:00
Le Tan
6afc84fd04 theme: refine styles 2018-06-08 19:59:41 +08:00
Le Tan
85187fd53b theme: refine styles 2018-06-06 23:10:51 +08:00
Le Tan
04cf252c25 theme: add a dark theme v_detorte 2018-06-06 21:53:52 +08:00
Le Tan
f9c994b91c VTreeWidget: setCurrentItem with ClearAndSelect 2018-06-06 21:53:34 +08:00
Le Tan
a1bef71215 theme: refine v_moonlight 2018-06-06 21:53:19 +08:00
Le Tan
93b26f41e4 preview: support force background for previewed images
- Add [editor]/preview-image-background config in MDHL;
- Will fill background first before drawing an image if specified;
2018-06-06 21:53:02 +08:00
Le Tan
d59a1010c5 highlighter: bug fix about HTML comments inside a fenced code block 2018-06-04 20:50:59 +08:00
Le Tan
a2670903cf explorer: bug-fix about clicking items when no root entries 2018-06-04 20:50:50 +08:00
Le Tan
a5ada5310a release v1.17 2018-06-01 20:31:54 +08:00
Le Tan
58a0a16991 refine changes.md 2018-06-01 20:23:55 +08:00
Le Tan
3aacbb868f refine Chinese translations 2018-06-01 20:11:13 +08:00
Le Tan
8d3a7874d0 editor: support custom zoom delta 2018-06-01 19:37:45 +08:00
Le Tan
7f8075f0ca bug-fix: fix Command+-/= to zoom out/in in read mode on macOS 2018-06-01 17:46:42 +08:00
Le Tan
af8cd0d73b refine Info act 2018-06-01 16:58:50 +08:00
Le Tan
6212bb48bc UniversalEntry
1. Use VListWidget in VListFolderUE;
2. Add j to list history;
2018-06-01 16:26:00 +08:00
Le Tan
f9badfbb55 bug-fix: fix stay-on-top on Linux 2018-05-29 21:03:27 +08:00
Le Tan
4066ffb4f4 bug-fix: fix VExplorer 2018-05-29 20:10:05 +08:00
Le Tan
8ed4264097 theme: refine QTabBar style 2018-05-29 19:53:32 +08:00
Le Tan
a5271d409d support stay-on-top 2018-05-29 19:53:14 +08:00
Le Tan
b63e5def85 UniversalEntry: fix input method issue on macOS 2018-05-29 19:52:54 +08:00
Le Tan
c302cd3bfc AttachmentList: support Info action to rename an attachment
This will fix the input method issue on macOS.
2018-05-29 19:52:37 +08:00
Le Tan
69ebcd53e6 explorer: warn if directory does not exist 2018-05-28 20:36:28 +08:00
Le Tan
b433939ca8 bug-fix: escape HTML meta characters in title 2018-05-28 20:35:59 +08:00
Le Tan
4de97522a1 bug-fix: VTextEdit::visibleBlockRange() may get wrong range before updating document size after preview 2018-05-28 20:35:38 +08:00
Le Tan
d3a5642d06 fix paste image issue
- Will detect whether there is only <img> in html;
- Detect local file when handling text;
2018-05-27 12:12:24 +08:00
Le Tan
2ff9c607dd explorer: support exploring system's files 2018-05-26 13:26:59 +08:00
Le Tan
a98757643f VFileList: support specifying different view orders 2018-05-23 20:09:27 +08:00
Le Tan
89677c8261 notebook: support relative path (to app's directory) 2018-05-23 20:09:14 +08:00
Le Tan
3c8ac8094d VMetaWordManager: lazy initialization 2018-05-23 20:08:58 +08:00
Le Tan
b076e87509 EditWindow: lazy initialization of actions 2018-05-23 20:08:45 +08:00
Le Tan
f130c3dd98 bug-fix: enter press on an unknown file in file list should not close current tab 2018-05-23 20:08:29 +08:00
Le Tan
9718d1f727 AttachmentList: lazy initialization 2018-05-23 20:08:17 +08:00
Le Tan
43509d7022 SnippetList: lazy initialization 2018-05-23 20:08:05 +08:00
Le Tan
eae345d920 cart: lazy initialization 2018-05-23 20:07:53 +08:00
Le Tan
d92453ef82 FileList/DirectoryTree: lazy initialization for QAction 2018-05-23 20:07:41 +08:00
Le Tan
e048734414 editor: refine heading sequence 2018-05-19 10:20:00 +08:00
Xianzhong Wang
5eb8c4d224 [function] Support to remove header sequence when disable it (#243)
* [function] Support to remove header sequence when disable it

spec:
In edit mode:
- when click icon to enable auto sequence, add sequence immediately
- when click icon to disable auto sequence, remove already added sequence

In preview/read mode:
- auto sequence icon should be unchecked and disabled

For readonly file, always disable the auto sequence icon.

* [bugfix] Do not let auto sequence ruin the undo history

All the header sequence auto-update should be treated as one edit action.
So that user can undo auto-update by pressing undo twice.
(One undo for the auto-update change, and one for the original header change)

* Refactor and reformat according to PR feedback
2018-05-19 09:56:14 +08:00
Le Tan
d8cc69955d refine icons 2018-05-18 21:43:37 +08:00
Le Tan
07f1689e11 History: lazy initialization 2018-05-18 20:59:32 +08:00
Le Tan
18ee02d920 IconUtils: add cache to avoid redundant I/O 2018-05-18 20:58:10 +08:00
Le Tan
52546e4664 theme: refine sytle of tab bar 2018-05-18 20:57:50 +08:00
Le Tan
c6cc69e176 refine QDockWidget title icon 2018-05-17 22:10:21 +08:00
Le Tan
f6436bfabf support history navigation 2018-05-17 21:32:38 +08:00
Le Tan
4284d20dea preview: add cache for code block in-place preview 2018-05-15 21:24:08 +08:00
Le Tan
f2afe4b4e2 preview: add cache for mathjax in-place preview 2018-05-15 20:12:12 +08:00
Le Tan
d0c38add94 preview: refine scaling in-place preview of diagrams 2018-05-15 20:12:00 +08:00
Le Tan
d681fdebd9 theme: refine height of QTabBar 2018-05-14 22:35:21 +08:00
Le Tan
14070ab67a preview: scaled in-place preview of diagrams 2018-05-14 22:24:30 +08:00
Le Tan
423cc76ee5 use smooth transformation for previewed images 2018-05-14 21:42:25 +08:00
Le Tan
b5fde4cda9 MainWindow: refine layout 2018-05-14 21:30:12 +08:00
Le Tan
925833d590 export: support copying exported file's content 2018-05-14 20:42:17 +08:00
Le Tan
b355872c5f export: support %4 for code block css style url 2018-05-14 20:42:02 +08:00
Le Tan
8f24d38bf8 export: remove <title> in embedded SVGs
Pandoc will take it as the title of the document by mistake.
2018-05-14 20:41:44 +08:00
Le Tan
f3302d25e8 MainWindow: add navigation box at the left 2018-05-14 20:41:30 +08:00
Le Tan
f8717465c3 refine QFormLayout policy for VSearcher on macOS 2018-05-14 20:39:49 +08:00
Le Tan
4174055574 fix linux CI
Use Qt5.9.3.
2018-05-12 10:51:07 +08:00
Le Tan
a71b715428 release v1.16 2018-05-11 18:26:59 +08:00
Le Tan
ae6bd79069 update linux ci to Qt 5.9.4 2018-05-11 15:26:46 +08:00
Le Tan
1403324c9b refine Chinese translations 2018-05-11 15:21:51 +08:00
Le Tan
9ca9e56e82 update README 2018-05-11 15:06:37 +08:00
Le Tan
6752a91ef4 markdown-it: display metadata as code block 2018-05-11 14:39:51 +08:00
Le Tan
3eb3db874e markdown-it: support emoji 2018-05-11 14:39:51 +08:00
Le Tan
f2c26d8353 VFileList: do not close current tab when opening Unknown file in single click 2018-05-11 14:39:51 +08:00
Le Tan
4e744f30f9 highlighter: no need to check if a header is valid
It is fixed in the upstream pmh_parser.
2018-05-11 14:39:51 +08:00
Le Tan
274a5a1aec add openGL version hint 2018-05-11 14:39:51 +08:00
Le Tan
e47900f7ec fix compilation warning of pmh_parser on Windows 2018-05-11 14:39:51 +08:00
Erk-
cfaddebe62 Added a archliux version that uses the latests release. (#233) 2018-05-10 20:03:19 +08:00
Le Tan
39a8bae529 add plantuml_cmd config for custom command 2018-05-07 08:51:24 +08:00
Le Tan
966d9fb7d7 scale in-place image preview according to scale factor 2018-05-06 22:04:56 +08:00
Le Tan
dba154b2c3 support specifying image size in preview 2018-05-06 21:40:00 +08:00
Le Tan
84437bcd97 update peg-highlight 2018-05-06 16:03:12 +08:00
Le Tan
a2e5d48c65 update pmh_parser for heading space 2018-05-06 11:56:08 +08:00
Le Tan
e2dd062a24 style: support STRIKE and NOTES
- Add "strikeout" support in mdhl file;
2018-05-05 14:18:30 +08:00
Le Tan
6558fa85b7 markdown-it: support specifying image size via markdown-it-imsize plugin
Only supported in read mode.
2018-05-05 12:34:17 +08:00
Le Tan
ccaaeeef87 bug-fix: VMdTab does not scroll to the correct header in edit mode
This is introduced after replacing QStackedLayout with QSplitter.
2018-05-04 20:37:57 +08:00
Le Tan
bab0140c9f use QWebEnginePage::linkHovered instead 2018-05-04 20:37:40 +08:00
Le Tan
3cd96794d1 disable web view before setHtml() to keep focus unchanged 2018-05-04 20:37:23 +08:00
Le Tan
660e2ba86a theme: refine selection color 2018-05-04 20:37:03 +08:00
Le Tan
5613b864c2 use 20px for default tool bar icon size 2018-05-04 20:36:09 +08:00
Le Tan
b463340101 PlantUML: add [web]/plantuml_args to pass extra arguments to PlantUML 2018-05-04 20:35:49 +08:00
Le Tan
0faf79b45b VSettingsDialog: add MathJax configuration and tool bar icon size configuration 2018-05-02 20:02:18 +08:00
Le Tan
de678b5d6d vim: Ctrl+C to enter Normal mode if vim_exemption_keys does not contain c 2018-05-02 20:02:06 +08:00
Le Tan
450f6f7c18 refine README 2018-05-01 14:23:27 +08:00
Le Tan
c1a46033c8 release v1.15 2018-04-29 08:52:49 +08:00
Le Tan
a1cc456f53 refine Markdown guide for Graphviz 2018-04-29 08:50:00 +08:00
Le Tan
b477e50a88 refine Chinese translations 2018-04-29 08:18:08 +08:00
Igetin
1355997b4d fix typo (#216)
Rename Custom to Customize.
2018-04-29 07:50:34 +08:00
Le Tan
d917c942d9 speed up start 2018-04-28 22:20:03 +08:00
Le Tan
d683afa271 refine markdown editor 2018-04-28 21:37:44 +08:00
Le Tan
5dbdcb8cba bug-fix: try to fix the crash in CodeBlockPreviewInfo::updateInplacePreview() 2018-04-28 21:37:26 +08:00
Le Tan
9b114832f1 change panel view when locating to a folder or notebook 2018-04-28 21:36:58 +08:00
Le Tan
bc85c0d199 add wechat pay to README 2018-04-27 21:42:45 +08:00
Le Tan
9c80a9dcae auto judge 0 width/height splitter after changing panel view 2018-04-27 20:36:10 +08:00
Le Tan
960426579b show hovered link in status line in read mode 2018-04-27 20:35:58 +08:00
Le Tan
adacaef1c7 bug-fix: can not jump to the correct header when first enter edit mode 2018-04-27 20:35:45 +08:00
Le Tan
89375680b4 avoid checking openSSL info in release mode without -d option 2018-04-27 20:35:30 +08:00
Le Tan
2dbb114b47 fix image issue
1. Do not judge the image format from the file suffix;
2. Enable file: scheme in Markdown-it;
2018-04-27 20:35:17 +08:00
Le Tan
4afefbe964 markdown-it: aware of YAML format metadata in notes 2018-04-24 07:53:09 +08:00
Le Tan
99cf497ddc preview: bug fix with no-update issue 2018-04-24 07:52:43 +08:00
Le Tan
16399ded29 UniversalEntry: Ctrl+I to expand/collapse current item
Ctrl+Y is reserved in QLineEdit.
2018-04-24 07:52:22 +08:00
Le Tan
cba8b1c047 embed images in exported html 2018-04-24 07:51:57 +08:00
Le Tan
26ecf08f4a fix compilation warning 2018-04-20 23:04:33 +08:00
Le Tan
1d0621cac3 refine README 2018-04-20 19:55:54 +08:00
Le Tan
a4ab2ae671 restore current edit tab and cursor position info at startup 2018-04-20 19:55:42 +08:00
Le Tan
6fe82d3db0 highlighter fix 2018-04-20 19:55:28 +08:00
Le Tan
67e40cbe87 fix MathJax highlight with inline code, HTML comment, link, bold, and italic elements 2018-04-19 20:49:23 +08:00
Le Tan
80e65faca2 small fix 2018-04-19 20:31:43 +08:00
Le Tan
beee7a3cb8 fix macOS 2018-04-18 22:33:25 +08:00
Le Tan
91483fd8fc fix macOS travis CI 2018-04-18 22:11:41 +08:00
Le Tan
108ff1543c make discard action the default one when DiscardAndExit 2018-04-18 20:55:28 +08:00
Le Tan
aa5960f974 preview non-codeblock MathJax 2018-04-18 20:55:14 +08:00
Le Tan
9566e6f5d2 highlight: highlight MathJax formula in editor 2018-04-13 19:51:01 +08:00
Le Tan
05e4159530 bug-fix: fix leading spaces issue of VCodeBlockHighlightHelper
For example, a token " abc" in text "def\n abc", the leading space may
be consumed by the former "\n".
2018-04-12 19:32:04 +08:00
Le Tan
2c527201b8 do not highlight verbatim code blocks 2018-04-12 19:31:35 +08:00
Le Tan
10e2bba7f6 support Mermaid and Flowchart.js preview
Mermaid preview is disabled for some issues.
2018-04-12 19:31:13 +08:00
Le Tan
8239abec2a support code block MathJax preview 2018-04-11 19:53:33 +08:00
Le Tan
c72398e887 update shortcuts doc 2018-04-10 21:53:31 +08:00
Le Tan
55fcdd8884 Revert "shortcuts: translate Ctrl to Meta on macOS in default config"
This reverts commit 5cd114e549792bf837f18bd8b73df4e4f79e97ea.
2018-04-10 21:22:38 +08:00
Le Tan
cfcc7e5494 support in place preview and live preview of code blocks 2018-04-10 20:58:07 +08:00
Le Tan
0b9cc6e5b3 theme: constrain the mermaid style sheets in mermaid scope
It interferes Graphviz.
2018-04-10 20:58:07 +08:00
Le Tan
c6b7561864 VMdTab: live preview 2018-04-10 20:58:07 +08:00
Le Tan
051088be31 VMdTab: use splitter instead of tab layout to hold editor and web view
Prepare for live preview.
2018-04-10 20:58:07 +08:00
Le Tan
2206102945 support Graphviz 2018-04-10 20:58:07 +08:00
Le Tan
11e111ed7b markdown-it: turn off typographer 2018-04-10 20:58:07 +08:00
Le Tan
8e81742b90 refine the naming convertion of the package 2018-04-10 20:58:01 +08:00
Le Tan
7de6428605 fix linuxdeployqt to exclude libnss3 and libnssutil3 2018-04-08 20:01:54 +08:00
Le Tan
052691258c fix macos CI 2018-04-07 23:35:16 +08:00
Le Tan
401fa09250 refine README 2018-04-05 10:31:40 +08:00
Le Tan
027363400c fix appimage 2018-04-05 09:33:16 +08:00
Le Tan
ee322fc132 fix AppImage 2018-04-05 08:21:22 +08:00
Le Tan
9850d9a2a2 support PlantUML 2018-04-04 20:30:36 +08:00
Le Tan
a6087d98a6 add tool bar button for Universal Entry 2018-04-04 20:30:20 +08:00
Kinka Huang
390ce23353 Update README.md (#186) 2018-04-04 18:30:12 +08:00
Le Tan
6ba5b570b9 release v1.14 2018-04-03 20:03:17 +08:00
Le Tan
5dfea13e61 refine Chinese translations 2018-04-03 19:56:54 +08:00
Le Tan
eb734f591e import: do not copy files when import if they locate in current folder 2018-04-03 19:38:59 +08:00
Le Tan
5cd114e549 shortcuts: translate Ctrl to Meta on macOS in default config 2018-04-03 19:38:43 +08:00
Le Tan
86b9a2e93f notebook: prompt for new root folder path when it is missing 2018-04-03 19:38:29 +08:00
Le Tan
373d839497 UniversalEntry: refinement 2018-04-03 19:38:12 +08:00
Le Tan
3bcc7991cb refine Chinese translations 2018-04-02 21:33:50 +08:00
Le Tan
26a7f40f36 VMdTab: discard backup file directly when it is identical 2018-04-02 20:38:13 +08:00
Le Tan
aad9395fad README: refine 2018-04-02 20:37:54 +08:00
Le Tan
87c85ce686 theme: remove v_material theme for its lack of maintenance 2018-04-02 20:37:41 +08:00
Le Tan
f733ce45db Settings: add item to config single click's behavior in notes list 2018-04-02 20:37:24 +08:00
Le Tan
af3d380683 UniversalEntry: add m for ListFolderUE
- Ctrl+M: to list current item folder or the folder containing current
item using ListFolderUE.
2018-04-02 20:37:04 +08:00
Le Tan
ed5809bf1b UniversalEntry: refine styles 2018-04-02 20:36:46 +08:00
Le Tan
764c0acfe5 UniversalEntry: add ? to show help information 2018-04-01 14:25:21 +08:00
Le Tan
0749ce178e UniversalEntry: Ctrl+S to sort items 2018-04-01 12:33:02 +08:00
Le Tan
31dbdbfe4d UniversalEntry: put notebooks and folders before notes in the result 2018-04-01 10:23:32 +08:00
Le Tan
e844bf5e40 UniversalEntry: add more shortcuts
- Ctrl+R to go to parent item in tree widget;
- Ctrl+T to expand or collapse an tree item;
2018-04-01 10:12:43 +08:00
Le Tan
7de9eab039 UniversalEntry: add y to list and search outline of current note 2018-03-30 22:23:37 +08:00
Le Tan
9289a634b5 UniversalEntry: add more entries
- e: search name of the folders/notes in current notebook;
- d: search content of the notes in current notebook;
- r: search name of the folders/notes in current folder;
- f: search content of the notes in current folder;
- t: list and search name of opened notes in buffer;
- g: search content of opened notes in buffer;
- b: search outline of opened notes in buffer;
- h: search path of the folders/notes in all the notebooks;
- n: search path of the folders/notes in current notebook
2018-03-30 22:23:22 +08:00
Le Tan
2bfa5f9f52 VSearchEngine: use batch mode to update results 2018-03-29 21:57:06 +08:00
Le Tan
a2c2d57570 UniversalEntry: add z to search content of note in all notebooks 2018-03-29 19:48:03 +08:00
Le Tan
b46a8f4f39 UniversalEntry: add q to list all notebooks and a to search name of folder/note 2018-03-29 19:47:47 +08:00
Le Tan
4727d0aa98 refine interfaces 2018-03-28 19:36:35 +08:00
Le Tan
b09320e666 VEditArea: refine Navigation Mode 2018-03-28 19:36:18 +08:00
Le Tan
d421a8577c support Universal Entry
`Ctrl+G` to call out the Universal Entry.
2018-03-28 19:35:38 +08:00
Le Tan
29977cff87 refine README 2018-03-23 08:30:09 +08:00
Le Tan
fd6f0270c9 refine README 2018-03-23 08:17:32 +08:00
Le Tan
6efe3d67ec fix travis.ci 2018-03-21 21:55:42 +08:00
Le Tan
71e744b1b5 fix travis.ci 2018-03-21 21:52:11 +08:00
Le Tan
dba6bb1e68 release v1.13 2018-03-21 21:04:08 +08:00
Le Tan
507568ae2c refine Chinese translations 2018-03-21 21:01:39 +08:00
Le Tan
b8a8ed974b refine changes.md 2018-03-21 19:35:12 +08:00
Le Tan
28d359c4bb search: add search Object Path
1. For internal file and folder, search the relative path;
2. For orphan file, search the complete path;
2018-03-21 19:34:59 +08:00
Le Tan
a6c07a6dda theme: change line-height to 1.5 in css 2018-03-21 19:33:33 +08:00
Le Tan
78b239545b export: force wrap and word-break for line number of code block 2018-03-21 19:31:52 +08:00
Le Tan
49e2c74122 theme: support $ for scaled number 2018-03-20 21:54:57 +08:00
Le Tan
0bf7284728 theme: refine v_pure 2018-03-20 20:52:23 +08:00
Le Tan
ff4a2d0b91 markdown-it: add options for subscript and superscript 2018-03-19 20:05:26 +08:00
Le Tan
b3f874577c theme: refine v_pure and v_moonlight 2018-03-19 20:05:10 +08:00
Le Tan
84df970e22 theme: replace v_white with v_native
Change v_white to a more native theme.
2018-03-18 17:12:08 +08:00
Le Tan
e38ec22263 editor: add PasteAsBlockQuote menu action 2018-03-16 22:37:30 +08:00
Le Tan
de7ea32104 flowchart: support both flow and flowchart as the language 2018-03-16 21:38:45 +08:00
Le Tan
dfbb692b15 flowchart/mermaid: remove the surrounding pre 2018-03-16 21:38:25 +08:00
Le Tan
47b4cc88aa support sorting items by clicking the column header 2018-03-16 21:37:56 +08:00
Le Tan
407658bead cart: support sorting by drag&drop or dialog 2018-03-16 21:37:31 +08:00
Le Tan
eb4d2a7ba3 search: add context menu to search result tree 2018-03-15 22:00:30 +08:00
Le Tan
7c9da2a37c search: support && and || logical operator
- Space-separated keywords are combined as AND;
- && and || for AND and OR;
- Do not support using both && and ||;
- When multiple keywords are specified, will not show all the matched lines.
2018-03-15 22:00:14 +08:00
Le Tan
a2ee5413a1 support search
- Ctrl+E C to toggle the search dock;
2018-03-13 20:45:44 +08:00
Le Tan
d404360fee bug-fix: could not quit VNote in KDE 2018-03-09 22:47:00 +08:00
Le Tan
469f4b43cc find&replace: support \n for back reference in replace text 2018-03-07 21:04:34 +08:00
Le Tan
d3f9ec48eb export: support custom export 2018-03-07 21:04:19 +08:00
Le Tan
9710659a00 support word count 2018-03-06 19:33:40 +08:00
Le Tan
113a1455de style: add explicit margins to <p>
Or the copied HTML will contain the margin info of <p>.
2018-03-06 19:33:27 +08:00
Le Tan
69c14394ac refine image insert selection logics 2018-03-06 19:33:13 +08:00
Le Tan
ccd3c55cad refine VSelectDialog with QListWidget 2018-03-06 19:33:00 +08:00
Le Tan
1b1c530392 change CDN of MathJax 2018-03-04 20:34:35 +08:00
Le Tan
9cc193178b export: add TOC function to built-in PDF export 2018-03-04 20:19:27 +08:00
Le Tan
fb73fdad77 export: bug fix 2018-03-04 11:33:44 +08:00
Le Tan
8e06c24fc1 export: call tool process asynchronously 2018-03-03 12:29:55 +08:00
Le Tan
635ac0a10b export: fix wkhtmltopdf
- MathJax works fine;
- Mermaid does not work;
- Flowchart.js works fine;
2018-03-03 09:14:21 +08:00
Le Tan
ada0b40d80 mathjax: change <pre> to <p> after rendering 2018-03-02 22:37:14 +08:00
Le Tan
a331eee186 export: support exporting notes all in one PDF 2018-03-02 22:37:02 +08:00
Le Tan
2bb2910fec add enable_flash_anchor config
It controls whether we need to flash the heading when we scroll to it in
read mode.
2018-03-02 22:36:51 +08:00
Le Tan
ba13ac7dc3 set <a> to break-all 2018-03-02 22:36:37 +08:00
Le Tan
53c36b5a70 export: remember subfolder settings 2018-03-02 22:36:26 +08:00
Le Tan
22104ebde3 support transparent render background
It is useful for export.
2018-03-02 22:36:11 +08:00
Le Tan
935bb4d3b4 export: support exporting PDF via wkhtmltopdf tool 2018-03-01 20:59:57 +08:00
Le Tan
3bee0365e9 support SavePage action in reading mode 2018-03-01 20:19:38 +08:00
Le Tan
bccc0b28db export: support MHTML format 2018-03-01 20:19:20 +08:00
Le Tan
28765bf4bb add issue template 2018-02-28 20:59:27 +08:00
Le Tan
9c3da47cb1 release v1.12 2018-02-26 21:11:57 +08:00
Le Tan
a3124f6890 refine Chinese translations 2018-02-26 21:07:58 +08:00
Le Tan
fa7fb7581b refine changes.md 2018-02-26 19:30:54 +08:00
Le Tan
ed44ec4ee8 bug-fix: use second accuracy to detect file change outside 2018-02-26 19:30:44 +08:00
Le Tan
da5218452f handle HTML <img> in clipboard 2018-02-26 19:30:33 +08:00
Le Tan
2d3567e460 refine interface with shortcut hints 2018-02-26 19:30:20 +08:00
Le Tan
fe7c446e5f export: handle HTML resources 2018-02-26 19:30:06 +08:00
Le Tan
b7e6301136 export: add option EmbedCssStyle for HTML 2018-02-25 14:37:13 +08:00
Le Tan
7069f7268b palette: add mermaid css file config 2018-02-25 11:04:11 +08:00
Le Tan
1fe7567d79 export: support HTML format 2018-02-25 10:01:18 +08:00
Le Tan
60635fe5e7 export: support custom background, style 2018-02-23 19:54:07 +08:00
Le Tan
ad81e655a5 refine menu 2018-02-23 19:53:59 +08:00
Le Tan
4a4e4ed377 add copy target Evernote 2018-02-23 19:53:44 +08:00
Le Tan
956a8ab1d0 bug-fix: fix word-wrap bug in code block line number when exporting PDF 2018-02-22 19:44:15 +08:00
Le Tan
76ff1ff756 update block when changing cursor block mode 2018-02-22 19:44:03 +08:00
Le Tan
faff0cd8f6 bug-fix: fix code block highlight issues
add ignore_illegals parameter to hljs.highlight().
2018-02-22 19:43:49 +08:00
Le Tan
3ce7ef28c1 bug-fix: make path before exporting PDF 2018-02-16 13:35:24 +08:00
Le Tan
6d24f7e92b bug-fix: remove unnecessary NULL check before delete 2018-02-13 22:18:38 +08:00
Le Tan
8ff520d0fd refactor export 2018-02-13 22:10:48 +08:00
Le Tan
bc9dd643fc support reset layout 2018-02-06 20:37:38 +08:00
Le Tan
4bcb60e903 add config enable_auto_save which is false by default 2018-02-05 22:26:38 +08:00
Le Tan
bf70c23110 combine EditNote and SaveExitNote 2018-02-04 16:50:46 +08:00
Le Tan
117b5471fd bug-fix: merge the code block base format when highlighting code block in edit mode 2018-02-04 13:02:55 +08:00
Le Tan
a32fb015e1 add symlink vnote to VNote in Unix 2018-02-04 10:14:54 +08:00
Le Tan
2aa852fd1b refine README 2018-02-03 18:45:36 +08:00
Le Tan
33c6e37d43 setCurrentItem() in QTreeWidget has different behaviors with that of QListWidget 2018-02-03 18:37:25 +08:00
Le Tan
8158d22bb4 convert VOutline to VTreeWidget to support simple search 2018-02-03 16:37:09 +08:00
Le Tan
878a272777 add VTreeWidget with simple search and convert VDirectoryTree to it 2018-02-03 16:33:00 +08:00
Le Tan
0125251716 Merge branch 'list-search' into dev
Add simple search for list widget.
2018-02-03 12:11:25 +08:00
Le Tan
0f6e9e1905 refactor VListWidget 2018-02-03 12:09:57 +08:00
Le Tan
abe40cc74f clean up code styles 2018-01-30 19:28:52 +08:00
Le Tan
8013753315 fix typo 2018-01-29 22:10:26 +08:00
Le Tan
17b5ac5f66 bug-fix: sort comparator should be irreflexive 2018-01-29 19:31:53 +08:00
Xianzhong Wang
74cb54e02b [function] support advanced search in file list (#121)
spec:
when focus in file list,
1. type any character or digit will trigger the advanced search mode
2. type Esc to exit the search mode
3. type Enter or mouse select will also exit the search mode
2018-01-29 06:03:44 +08:00
Le Tan
77c664b773 add PayPal info 2018-01-27 20:18:14 +08:00
Le Tan
8f9b03b396 update README 2018-01-27 19:21:08 +08:00
Le Tan
a009126d77 fix compile warning in macOS 2018-01-27 19:05:51 +08:00
Le Tan
44a85b6578 add donation info in README 2018-01-27 19:02:24 +08:00
Le Tan
f02b942513 add descriptions of diagram and math formula in markdown guide 2018-01-27 00:07:54 +08:00
Le Tan
4267ea54c8 do not print debug log in release mode
Add -d argument to print debug log in release mode.
2018-01-26 23:08:18 +08:00
Le Tan
30c69fc148 single click in file list to open file in current tab 2018-01-26 08:48:06 +08:00
Le Tan
97721f3e92 bug-fix: use en locale for help docs if user's locale is missing 2018-01-25 21:13:21 +08:00
Le Tan
ec0b98f050 add Menu Bar toolbar button to toggle menu bar 2018-01-22 22:23:46 +08:00
Le Tan
ebf4173b88 add FullScreen toolbar button
Add shortcut FullScreen (F11) in vnote.ini.
2018-01-22 20:29:40 +08:00
Le Tan
b510dc976b bug-fix for Captain mode 2018-01-22 20:29:26 +08:00
Le Tan
14d0f1700c add Close All Tabs context menu 2018-01-22 20:29:14 +08:00
Le Tan
b45f1d9518 fix font-family issue in WeChat Public Account editor
It could not recognize &quot; in font-family.
2018-01-22 20:29:00 +08:00
Le Tan
7ac97dbcc4 fix Copy All As logics 2018-01-21 20:44:42 +08:00
Le Tan
07cefdcaec support print 2018-01-21 16:16:51 +08:00
Le Tan
cdf3eb537b add base URL in setHtml() to enable it access local files 2018-01-21 15:32:27 +08:00
Le Tan
d630ff7bf2 keep focus in VFileList once click an item 2018-01-21 14:51:36 +08:00
Le Tan
06cac36412 support Vim command mode in read mode 2018-01-21 14:27:49 +08:00
Le Tan
5d672e7fc6 refine README 2018-01-21 11:17:18 +08:00
Le Tan
333be910cc enalbe Vim cmd line for searching in read mode 2018-01-19 21:56:21 +08:00
Le Tan
b927a525e2 decouple VVimIndicator and VVimCmdLineEdit 2018-01-19 19:29:34 +08:00
Le Tan
eb25aec5b5 ESC to exit edit mode with Vim disabled 2018-01-18 19:50:40 +08:00
Le Tan
28e4818c26 move custom web zoom factor to Read/Edit setting tab 2018-01-18 19:50:25 +08:00
Le Tan
97021fa7bc change default notebooks location to user's document folder 2018-01-17 20:13:43 +08:00
Le Tan
217eafd91b HGMarkdownHighlighter: merge formats when highlighting a block 2018-01-17 20:13:28 +08:00
Le Tan
b1f7760ea2 HGMarkdownHighlighter: use cached header info to highlight headers fast 2018-01-16 21:05:35 +08:00
Le Tan
0b885e1639 output built-in themes on startup 2018-01-16 21:05:35 +08:00
Le Tan
45526cc0a8 bug-fix
- Caculate font height every time on painting line number area;
- Support specifying multiple fonts in font-family in qss;
- Add margin for "li ol" in CSS;
2018-01-16 21:05:35 +08:00
Le Tan
8dfcda0e51 add Cart to collect notes for further processing 2018-01-16 21:05:35 +08:00
Le Tan
beeb546ab5 refine README 2018-01-16 21:04:47 +08:00
Erk-
9f2d3d1a1a Added installation on arch linux. (#103) 2018-01-16 06:57:33 -06:00
James Milne
d97a2c51ab #96, mention homebrew cask install for macOS (#101) 2018-01-16 06:53:12 -06:00
Le Tan
4202b99055 update qq group picture 2018-01-12 20:20:52 +08:00
Le Tan
b795f5f76e refine README 2018-01-12 20:14:16 +08:00
Le Tan
a20ff08bb8 small fixes 2018-01-12 19:55:54 +08:00
Le Tan
632a007808 support copy as Web Editor 2018-01-10 21:24:31 +08:00
Le Tan
cd8f148946 add shortcut Ctrl+Alt+S for creating subfolder 2018-01-10 20:16:32 +08:00
Le Tan
14df9e6e90 refine copy HTML logics 2018-01-10 10:39:45 +08:00
Le Tan
9dad67739a refine styles 2018-01-08 19:58:19 +08:00
Le Tan
b9e8bc0eb4 enable MathJax in fenced code block 2018-01-07 19:14:29 +08:00
Le Tan
c9b1801a5a delete Jekyll config file 2018-01-06 17:40:19 +08:00
Le Tan
1d2183d44e VMdEditor: support zoom in/out 2018-01-05 21:27:09 +08:00
Le Tan
324d7cd444 VWebView: add css_color_mapping in palette file for copying HTMl
If the mapping is specified, we will replace the foreground color with
the mapping when the content is copied.
2018-01-05 19:36:40 +08:00
Le Tan
2bdad19253 vim-mode: fix % behovior in d/c command 2018-01-04 21:15:13 +08:00
Le Tan
044b3d3c29 add VLineEdit which supports Ctrl+H/W/U shortcuts 2018-01-04 20:16:12 +08:00
Le Tan
b19b1d8079 minor-fix
- Support repeat in title jump in read mode;
- Trim input in VInsertLinkDialog;
- Rename VLineEdit to VMetaWordLineEdit;
2018-01-04 19:54:32 +08:00
Le Tan
7e1a254073 disable subscript and supscript in Markdown-it since the conflict with MathJax 2018-01-04 19:54:20 +08:00
Le Tan
2f1971476d VMdEditor: support copy selected text as HTML 2018-01-04 13:27:42 +08:00
Le Tan
ce48c80cd0 release v1.11.1 2018-01-02 21:15:35 +08:00
Le Tan
63b3975f14 refine Chinese translations 2018-01-02 21:07:59 +08:00
Le Tan
bfd25f0033 refine styles 2018-01-02 20:42:35 +08:00
Le Tan
c5afe0bef0 disable cursor line block if cursor line highlight is disabled 2018-01-02 20:42:22 +08:00
Le Tan
3f3a0e8513 VMdTab: do not change the cursor if it is below the right title when entering the read mode 2018-01-02 20:42:08 +08:00
Le Tan
6ba12f7932 bug-fix: add code block indentation in VTextBlockData to get a correct highlight
- Won't treat all the text to the end as code block once we add a new
line within a code block;
- Fix color column by adding the code block indentation bias.
2018-01-01 16:08:26 +08:00
Le Tan
968b674a50 docs: add table syntax in Markdown guide 2018-01-01 15:18:37 +08:00
Le Tan
9e5f3abb4b bug-fix: add some margin for jumping title 2018-01-01 12:22:38 +08:00
Le Tan
fffae253c5 VWebView: remove html in clipobard after copy image
When pasting in WeChat public account, if there is html with image data
in the clipboard, it could not recognize the image data.
2018-01-01 11:46:35 +08:00
Le Tan
dbba8edad6 update icons 2017-12-30 22:32:17 +08:00
Le Tan
e3eb4213f7 update icons 2017-12-30 21:54:33 +08:00
Le Tan
c4d72183b5 VWebView: add Copy All without Background action 2017-12-29 18:25:19 +08:00
Le Tan
db73ab6dfd VWebView: fix img src after copied
Add config web/fix_img_src_when_copied to control the behavior.
2017-12-29 18:25:04 +08:00
Le Tan
63825a27d0 add qt_zh_CN for Chinese translations 2017-12-29 18:24:49 +08:00
Le Tan
7986ebe475 VWebView: alter copied Html in VWebView to paste correctly in OneNote 2017-12-28 22:19:39 +08:00
Le Tan
00d7f5e013 bug-fix: loop to setMimeData to clipboard in Windows 2017-12-28 19:26:43 +08:00
Le Tan
bbfc12ab18 add Chinese translations for QWebEngineView and QDialogButtonBox 2017-12-28 19:26:31 +08:00
Le Tan
3432c02e83 fix build issue 2017-12-27 21:40:58 +08:00
Le Tan
1b6132db85 fix translations for QTextEdit and QPlainTextEdit 2017-12-27 20:36:18 +08:00
Le Tan
d193cd28a5 refine context menu of VWebView
- Hide unused actions.
2017-12-27 20:36:03 +08:00
Le Tan
58b57c2a86 refine VOpenedListMenu 2017-12-26 19:27:10 +08:00
Le Tan
2798ab8ea0 support reseting VNote in settings
Notebooks information will not be reset.
2017-12-26 19:26:52 +08:00
Le Tan
6ca70895ac update icon 2017-12-26 08:38:25 +08:00
Le Tan
cb8a1df337 support shortcuts for external programs
1. External editor format: name=program %0,<shortcut>
2. Add "OpenViaDefaultProgram" shortcut to call system's default program
to open current note. "F12" by default.
2017-12-25 19:44:12 +08:00
Le Tan
7b8c522a53 themes: fix QTabBar's padding 2017-12-25 19:43:52 +08:00
Le Tan
b0c5961552 support foreground for selected/searched word in MDHL 2017-12-25 19:43:40 +08:00
Le Tan
be1827b0c4 change predefined_colors to custom_colors 2017-12-25 19:43:28 +08:00
Le Tan
488fe2cc65 themes: fix typo 2017-12-23 13:06:08 +08:00
Le Tan
e6db71217a add config close_before_external_editor
Do not close the note when opening it with external editors if this is true.
2017-12-22 22:09:38 +08:00
Le Tan
b12f738edc remove VAvatar and use a tool bar button instead 2017-12-22 19:33:54 +08:00
Le Tan
c0c4b8602a add VTipsDialog to display hints about some actions 2017-12-22 19:33:42 +08:00
Le Tan
03122a24db bug-fix: fix images when cutting files
1. De-duplicate the images occur multiple times in the note;
2. Refresh the read mode and edit mode preview after the directory path
change;
3. Update init images and inserted images after the directory path
change;
2017-12-21 21:02:56 +08:00
Le Tan
7fd5ec26e5 bug-fix: restore header from edit mode after web side logic is ready 2017-12-21 21:02:56 +08:00
Le Tan
c5a17b210b v_moonlight: refine 2017-12-21 21:02:56 +08:00
Le Tan
d46917d6a9 vim-mode: fix movement with block cursor 2017-12-21 21:02:56 +08:00
Le Tan
f6cf98c827 do not highlight code blocks without lang specified by default 2017-12-21 21:02:56 +08:00
Le Tan
2373a0326e vim-mode: amend cursor position after mouse release 2017-12-21 21:02:56 +08:00
Grover Chou
0976d65923 Add install introduction for openSUSE (#79)
Add instruction for openSUSE. Thanks to GroverChouT!
2017-12-20 17:27:28 -06:00
Le Tan
cf3cd67734 fix macOS travisCI build 2017-12-17 14:06:20 +08:00
Le Tan
bd16451942 release v1.11 2017-12-17 13:13:59 +08:00
Le Tan
d309766513 refine README 2017-12-17 13:09:23 +08:00
Le Tan
6808fac920 themes: refine 2017-12-17 11:05:38 +08:00
Le Tan
cbaa856903 refine Chinese translations 2017-12-17 10:48:04 +08:00
Le Tan
4b32fca9b5 themes: add v_moonlight theme for dark mode 2017-12-16 20:18:51 +08:00
Le Tan
1a866fb0e0 themes: remove v_material temporarily
It is not ready now.
2017-12-15 20:15:03 +08:00
Le Tan
0947687ba7 v_pure: style QProgressBar 2017-12-15 20:06:39 +08:00
Le Tan
24f6204fe3 themes: fix treeview style 2017-12-15 20:06:27 +08:00
Le Tan
81190cd803 attachment_list: fix input method issue of VButtonWithWidget's popup widget 2017-12-15 20:06:15 +08:00
Le Tan
1a62ca15e7 attachment_list: fix editor style 2017-12-15 20:06:02 +08:00
Le Tan
a2849ed577 themes: fix padding of QLineEdit in QListView 2017-12-14 22:32:14 +08:00
NocLin
618221b6a5 update theme 2017-12-14 22:16:23 +08:00
NocLin
c0c22530f2 add theme v_material 2017-12-14 22:16:23 +08:00
NocLin
6bdc6b8133 add .gitignore 2017-12-14 22:13:44 +08:00
Le Tan
ccad4af10c themes: support opacity of navigation labels 2017-12-14 21:28:00 +08:00
Le Tan
2c1e8e33fe vim-mode: support g0 (start of visual line) 2017-12-14 21:14:45 +08:00
Le Tan
70eb04ebd2 vim-mode: fix w/W/e/E/b/B/ge/gE movement with block cursor 2017-12-14 18:22:40 +08:00
Le Tan
559f5090bf theme: refine master background 2017-12-13 13:08:37 +08:00
Le Tan
aeb3dc8df6 themes: style the scrollbar in CSS 2017-12-12 21:04:51 +08:00
Le Tan
ae16b547e6 themes: refine danger button style 2017-12-12 21:04:37 +08:00
Le Tan
8d6fc6cb4f VInsertImageDialog: fetch image from clipboard
Support `Ctrl+'` to insert image.
2017-12-12 09:46:59 +08:00
Le Tan
1dcd65e7dd themes: bug fix 2017-12-11 20:48:18 +08:00
Le Tan
7b4117c737 theme: theme palette file could specify mdhl and css files 2017-12-10 21:46:30 +08:00
Le Tan
2bf2e7faaf themes: support menu checkbox and radiobutton 2017-12-10 10:55:52 +08:00
Le Tan
37c692b090 bug-fix: may download NULL image 2017-12-09 17:55:43 +08:00
Le Tan
9f9cc553dd VUtils: set default button as special button 2017-12-09 17:48:36 +08:00
Le Tan
2933e0f44c v_white theme: fix QFindReplaceDialog's title style in Gnome 2017-12-09 16:39:51 +08:00
Le Tan
5ca9ea6b92 remove focus rectangle on Mac 2017-12-09 16:15:01 +08:00
Le Tan
1410c16280 add v_pure theme 2017-12-09 12:59:39 +08:00
Le Tan
0d4a62626e VPalette: support referencing definition in the same group 2017-12-08 19:31:33 +08:00
Le Tan
49811cabc0 VTextDocumentLayout: support cursor line block background 2017-12-08 19:31:19 +08:00
Le Tan
27be40a454 v_white theme: support checkbox and radiobutton style 2017-12-08 19:31:05 +08:00
Le Tan
ce1c042337 refine v_white theme 2017-12-07 22:03:34 +08:00
Le Tan
f428ba19f7 bug-fix: do not save state of main splitter in compact mode 2017-12-07 20:41:40 +08:00
Le Tan
8e48b43cda v_white theme: support scrollbar style 2017-12-07 20:34:53 +08:00
Le Tan
7611d7a350 refine v_white theme 2017-12-06 22:13:40 +08:00
Le Tan
bda61a994c support overriding icon color in theme 2017-12-06 20:35:01 +08:00
Le Tan
ae48d18688 fix v_white theme 2017-12-05 22:06:55 +08:00
Le Tan
d14f4697b4 replace palette in clss VNote with VPalette 2017-12-05 19:45:04 +08:00
Le Tan
19323496d1 vim-mode: bug fix 2017-12-04 20:48:16 +08:00
Le Tan
5e323cd9ab fix VCaptain to change avatar's border color on mode change 2017-12-04 20:39:14 +08:00
Le Tan
24349f4cc7 fix VOpenedListMenu with new theme 2017-12-04 20:37:36 +08:00
Le Tan
23cae5a68c show editor first before beginEdit() 2017-12-04 20:37:17 +08:00
Le Tan
d49433f91d bug-fix: fix heading toolbar button 2017-12-04 20:37:02 +08:00
Le Tan
9f0963eace refine default theme 2017-12-03 19:21:41 +08:00
Le Tan
7f230312df vim-mode: bug fix in block cursor mode 2017-12-03 16:21:00 +08:00
Le Tan
262c6acfd9 support themes 2017-12-03 16:14:13 +08:00
Le Tan
6fea8bf7dc vim-mode: fix cursor position after changing from Insert to Normal mode 2017-12-02 21:31:54 +08:00
Le Tan
cfbda92f67 vim-mode: amend the cursor position after executing a command 2017-12-02 21:27:20 +08:00
Le Tan
f429ffe3e5 vim-mode: support Visual mode with block cursor 2017-12-02 14:35:51 +08:00
Le Tan
00f3665c1c VTextDocumentLayout: fix hitTest() in cursor block mode 2017-12-01 23:24:40 +08:00
Le Tan
0d6ed84228 bug-fix: vim mode cursor width 2017-12-01 23:24:21 +08:00
Le Tan
87af770612 vim-mode: support cursor block
Support cursor block in Normal and Insert mode.

TODO: need more fine-grain tuning of the behaviors.
2017-11-30 22:09:16 +08:00
Le Tan
b2a435297d VTextEdit: support block cursor 2017-11-30 21:25:43 +08:00
Le Tan
72946d0e15 Markdown Highlighter: more speed 2017-11-30 21:25:28 +08:00
Le Tan
4ec340a403 refactor preview logics
Use block user data to store preview info.
2017-11-29 21:45:20 +08:00
Le Tan
c7cb95d18b Markdown Highlighter: speed up at first parse 2017-11-29 21:45:06 +08:00
Le Tan
d2ee3e66d6 VTextEdit: support previewing inline images 2017-11-29 21:44:01 +08:00
Le Tan
3e7fa998ee bug-fix: retry to set clipboard after failure on Windows
On Windows, set data to clipboard may fail due to operating system's
design. We will repeatedly retry untin succeed.
2017-11-25 09:20:29 +08:00
Le Tan
d3ff787153 vim-mode: support = to auto indent selected blocks as previous block 2017-11-24 20:18:59 +08:00
Le Tan
fcbd591b69 bug-fix: no more than 6 numbersigns in headings in edit mode 2017-11-24 20:12:37 +08:00
Le Tan
94260b3df8 VSnippet: support auto indent 2017-11-24 19:57:23 +08:00
Le Tan
d79ad54822 refine header regular expression
Allow only spaces after #s.
2017-11-24 19:57:11 +08:00
Le Tan
d943e58f13 bug-fix: headings
- Missing headings with special characters;
- Display only the starting block of headers across multiple blocks;
- HGMarkdownHighlighter:
    - Skip headers without spaces after #s;
    - Fix last-block-header issue;
2017-11-24 19:56:58 +08:00
Le Tan
cb6338ecf6 add heading tool button 2017-11-24 19:56:41 +08:00
Le Tan
1f0ee88770 refactor edit operations
- Ctrl+B/I/K/D/M: Revert if content between the markers is empty.
- Ctrl+7: delete title mark.
2017-11-24 19:56:25 +08:00
Le Tan
ce48cdafd6 change compact mode to the default mode 2017-11-21 22:02:37 +08:00
Le Tan
d739fa5de8 refactor log file
- Append to existing log file when the file size does not exceed the limit;
- Put log file beside the vnote.ini configuration file;
2017-11-21 21:55:07 +08:00
Le Tan
6c83f9bd04 refactor VCaptain to enable Captain mode with Input Method 2017-11-21 20:15:58 +08:00
Le Tan
8d568e6e23 support Flash Page
Ctrl+Alt+L to edit Flash Page. Config flash_page gives the path of the
flash page.
2017-11-21 08:38:34 +08:00
Le Tan
c2973d9e23 vim-mode: add vim_exemption_keys config for Ctrl+C/V
Add vim_exemption_keys config to control the behaviors of Ctrl+C and
Ctrl+V in Vim mode.
2017-11-20 19:29:46 +08:00
Le Tan
32aa68dc78 support custom external editors
Define [external_editors] section for custom external editors.
2017-11-20 19:29:31 +08:00
Le Tan
8ab8b3d83a bug-fix
- Set proper defalut focus of VInsertLinkDialog;
- Fix bug in snippet when selection mark is empty;
- Focus editor after double-click applying a snippet;
2017-11-20 19:29:14 +08:00
Le Tan
4ffd6a5ef4 fix appveyor: use 5.9 instead of 5.9.1 2017-11-19 15:28:14 +08:00
Le Tan
941672a07c release v1.10 2017-11-19 14:55:31 +08:00
Le Tan
7e18374b93 fix build warnings 2017-11-19 14:55:31 +08:00
Le Tan
6e43002a8e refine Chinese translations 2017-11-19 14:31:08 +08:00
Le Tan
e6ce66ec7d support backup file
Add configs:

- backup_directory
- backup_extension
- enable_backup_file
2017-11-17 19:49:14 +08:00
Le Tan
141b404240 support file change check 2017-11-16 11:34:13 +08:00
Le Tan
0a97b2480d snippet: support Ctrl+E S to insert snippets 2017-11-14 21:40:39 +08:00
Le Tan
9b730c2889 VToolBox: support Navigation mode 2017-11-12 13:59:23 +08:00
Le Tan
f032dede34 replace QToolBox with VToolBox 2017-11-12 13:15:12 +08:00
Le Tan
6ac33d2bd0 support snippets
Shortcuts are not supported yet.
2017-11-11 08:09:22 +08:00
Le Tan
7131b483f3 refine default css style 2017-11-07 20:18:18 +08:00
Le Tan
1e15b37a83 vim-mode: support Ctrl+O in Insert mode
- Support Ctrl+O in Insert mode to enter Normal mode temporarily;
- Use Ctrl+K instead of Ctrl+O to insert inline code;
2017-11-07 19:52:36 +08:00
Le Tan
93ba677116 magic-word: support overriding magic words
- Add %dt%, %note%, and %no%;
- Support overriding magic words with simple literal value;
2017-11-07 19:51:39 +08:00
Le Tan
78a86cddc0 support note template
VNote will scan files in the template folder in the config folder as
template.

Template supports magic word.
2017-11-06 21:47:38 +08:00
Le Tan
2186716655 disable rich text in VTextEdit 2017-11-04 08:18:19 +08:00
Le Tan
83119e860c add WeChat public account in README 2017-11-04 08:11:01 +08:00
Le Tan
fe0bc465b0 add openssl version check 2017-11-03 23:00:08 +08:00
Le Tan
945d29f576 vim-mode: fix left/right/up/down key in macOS 2017-11-03 22:28:52 +08:00
Le Tan
48981e09ab bug-fix: fix compilation error in macOS 2017-11-03 22:14:47 +08:00
Le Tan
490a87bb53 bug-fix: fix horizontal scrollbar in wrong case 2017-11-03 20:28:05 +08:00
Le Tan
c59974744e draw a thin line to link preview image and its block
Add config preview-image-line-foreground in MDHL for the line color.
2017-11-03 19:49:58 +08:00
Le Tan
9de40e4d78 replace VPlainTextEdit with VTextEdit 2017-11-03 19:49:42 +08:00
Le Tan
cb4d32e95f bug-fix: shortcuts for ActivateNextTab and ActivatePreviousTab 2017-10-26 21:08:24 +08:00
Le Tan
404b5329a1 replace VEdit and VMdEdit with VEditor and VMdEditor 2017-10-26 19:36:12 +08:00
Le Tan
5abcb1a8d9 add VPlainTextEdit with custom layout
- Support block images;
- Support line number;
- Do NOT support line distance height due to constraint of QPlainTextEdit.
2017-10-24 20:00:24 +08:00
Le Tan
a265aed035 bug-fix: insert code block inline if it is at the end of a space block 2017-10-23 21:49:53 +08:00
Le Tan
73ee02d3b2 support editing read-only files 2017-10-22 21:26:39 +08:00
Le Tan
ae19191917 support Ctrl+Shift+T to recover last closed files
Add config LastClosedFile in [shortcuts] of vnote.ini.
2017-10-22 14:23:53 +08:00
Le Tan
f01131caff refine Chinese translations 2017-10-22 12:32:15 +08:00
Le Tan
d7224380d1 Merge remote-tracking branch 'origin/dev' 2017-10-22 11:31:19 +08:00
Le Tan
1028c9a4ad bug-fix: prompt for new notebook after mainwindow is shown 2017-10-22 11:21:36 +08:00
Le Tan
be5f7d2b6b bug-fix: fix auto heading sequence regular expression 2017-10-20 19:45:57 +08:00
Le Tan
83071e8501 bug-fix: fix auto heading sequence regular expression 2017-10-20 19:45:41 +08:00
Le Tan
a5e7fc18ab bug-fix: skip system file when saving opened files before close 2017-10-20 19:45:26 +08:00
Le Tan
30dfc24a28 support Insert Code Block tool bar button
Ctrl+M to insert a code block.
2017-10-19 22:21:25 +08:00
Le Tan
e66b70b6ff support Insert Link tool bar button
Support Ctrl+L to insert a link.
2017-10-19 19:42:50 +08:00
Le Tan
da027e9fd9 minor-fix
- Move Insert Image to tool bar;
- Fix Captain mode MagicWrod;
2017-10-19 19:42:31 +08:00
Le Tan
92bc044cac metaword: support Ctrl+E M in editor to evaluate metawords
Add shortcut configuration MagicWord.
2017-10-19 19:41:57 +08:00
Le Tan
dcb6227d3b vim-mode: share registers among all tabs 2017-10-18 19:55:25 +08:00
Le Tan
ad082d3ba0 restore tab order after toggling Compact mode 2017-10-18 19:55:03 +08:00
Le Tan
5aa5864ced bug-fix: update status after edit tab got focus 2017-10-18 19:54:38 +08:00
Le Tan
00feaa13e2 refactor Captain mode
- Configuration [shortcuts] and [captain_mode_shortcuts] for shortcuts
and shortcuts in Captain mode.
2017-10-18 19:54:15 +08:00
Le Tan
34aa9e0083 use empty title by default when inserting new image 2017-10-17 19:49:48 +08:00
Le Tan
ce2a572211 bug-fix: locating to current file should not always change to two panels view 2017-10-17 19:49:18 +08:00
Le Tan
787c61a5af support meta word
- Add VLineEdit as a QLineEdit with meta data support;
- support custom magic words through [magic_words];
- add %help% for all magic words information;
2017-10-17 19:47:57 +08:00
Le Tan
f1f6980921 refactor VNotebookSelector 2017-10-14 15:30:36 +08:00
Le Tan
ea05c268b3 remove obsolete title mark when inserting title mark 2017-10-13 19:40:35 +08:00
Le Tan
d5e3d47c27 bug-fix: style sheet qss 2017-10-13 07:48:31 +08:00
Le Tan
2b299ff9b7 refine heading sequence
1. add toolbar button to enable/disable heading sequence of current
note temporary;
2. Support independent configuration for external files;
3. Change enable_heading_sequence configuration to heading_sequence_type;
2017-10-13 07:23:25 +08:00
Le Tan
183b24915a refactor outline logics 2017-10-13 07:10:04 +08:00
Le Tan
598e8144bb support custom startup pages
- Support continuing where user left off on startup;
    - Support recovering the edit/read mode and the anchor position;
- Support opening user-specified files on startup;
- Add config startup_page_type, startup_pages, and last_opened_files;
2017-10-11 10:44:18 +08:00
Le Tan
fa870f132e update icons
Use icons made by a326703305@qq.com.
2017-10-09 22:08:17 +08:00
Le Tan
893c0b2823 bug-fix: use completeBaseName() when adding sequence to file name
- When adding attachments, if the name conflicts, we add sequence after
the base name. "abc.tar.gz" to "abc_001.tar.gz".
- When handling notes and folders, if the name conflicts, we add
sequence after the complete base name. "abc.5.9.1.md" to
"abc.5.9.1_001.md".
2017-10-09 21:25:30 +08:00
Le Tan
cff6a1e49a bug-fix: do not change mode when clicking an item in VFileList to open an already opened note 2017-10-09 21:25:30 +08:00
Le Tan
11537972f3 add V_FALLTHROUGH for explicit fallthrough 2017-10-09 21:25:30 +08:00
Le Tan
94c5934f2d bug-fix: do not change mode when clicking an item in VFileList to open an already opened note 2017-10-09 19:41:57 +08:00
Le Tan
01acd03a71 move some configs from vnote.ini to session.ini
VNote now will first check vnote.ini from the executable folder.
2017-10-07 16:37:13 +08:00
Le Tan
ace96c7ce2 support compact mode in main window
Add enable_compact_mode config.
2017-10-06 22:45:42 +08:00
Le Tan
2f61ded269 migrate to Qt 5.9.1 2017-10-03 08:53:08 +08:00
Le Tan
b3c8213e1a release v1.9 2017-10-02 10:38:48 +08:00
Le Tan
93a218655d refine Chinese translations 2017-10-01 10:37:17 +08:00
Le Tan
95548a68e0 refine icons 2017-09-30 20:53:41 +08:00
Le Tan
06fc4d5831 support custom code block style of highlightjs
Add two config:
- template_code_block_css
- template_code_block_css_url
2017-09-30 19:01:21 +08:00
Le Tan
3724eb35dd refactor VDirectoryTree
- Refine folder deletion logics;
- Refine folder copy/paste logics;
- Add folder sort logics;
2017-09-30 09:51:40 +08:00
Le Tan
f9080db71c minor-fix: scale images keeping aspect ration when previewing images in dialogs 2017-09-29 19:57:52 +08:00
Le Tan
18ed9b761a VAttachmentList: check missing attachments when showing the list 2017-09-29 19:57:21 +08:00
Le Tan
58e7cdca4b refactor VFileList
- Refine note deletion logics;
- Refine note copy/paste logics;
- Refine note sorting logics;
2017-09-29 19:56:38 +08:00
Le Tan
4668bd581a double click on a tab to close it
Add configuration double_click_close_tab.
2017-09-26 21:30:35 +08:00
Le Tan
ffd0cc8e6e refine DocType
- Use *.html suffix for rich text file;
- For unknown DocType, open it using system's default app;
- Add "Open Via External Program" item in context menu of VFileList;
2017-09-26 19:28:11 +08:00
Le Tan
fb4e818e20 refine attachment list
- Add shortcut Ctrl+E A to show attachment list;
- Add Vim-like navigation shortcut to attachment list;
- Support drag-and-drop to add attachments;
- Add bubble to indicate the number of attachments at the right top corner;
2017-09-26 19:27:47 +08:00
Le Tan
e5cd014762 support recycle bin folder for extern files
1. Add external_recycle_bin_folder config;
2. By default, each external file will use _v_recycle_bin in the same
directory as its recycle bin folder to hold deleted images;
2017-09-26 19:27:11 +08:00
Le Tan
6f1cab39ba update highlight.js with more complete language support 2017-09-25 19:42:58 +08:00
Le Tan
197e064a1a bug-fix: VFile and document() may have different modification state 2017-09-24 14:46:32 +08:00
Le Tan
37058b04df bug-fix: add attachment name check 2017-09-24 14:39:19 +08:00
Le Tan
04fa3654a4 bug-fix: do not cancel auto-indentation if cursor is not at block end 2017-09-24 12:04:35 +08:00
Le Tan
d955dedcb7 add config mathjax_javascript for Mathjax location and configuration 2017-09-24 10:18:55 +08:00
Le Tan
da64b8c12f add config confirm_reload_folder to check whether prompt for uer when reloading folder 2017-09-24 09:46:30 +08:00
Le Tan
d20dc4a0b0 bug-fix: image links in reference format will cause crashes 2017-09-23 14:56:53 +08:00
Le Tan
b04a44f82d vim-mode: bug-fix for s, d, c in visual mode 2017-09-23 10:38:50 +08:00
Le Tan
73ede805d1 bug-fix: respect the open mode even if the file has been opened 2017-09-23 09:42:54 +08:00
Le Tan
01788a5301 support attachments
Support attachments to internal note file.

- Add/Delete/Clear/Sort;
- Support custom attachment folder for each notebook (read-only);
- Support renaming attachment;
2017-09-22 23:30:49 +08:00
Le Tan
a64d01ea86 refactor VFile and VOrphanFile
1. Make VFile a real abstract class;
2. Use VNoteFile for internal note file;
3. Use VOrphanFile for external orphan file;
2017-09-21 19:33:37 +08:00
Le Tan
eb24360aa9 vim-mode: fix Y and D action in Visual mode 2017-09-17 16:39:50 +08:00
Le Tan
26d14f81d5 bug-fix: findFirstVisibleBlock() return invalid block when fails
A huge block as the last block may lead to failure to find first visible
block.
2017-09-16 15:07:31 +08:00
Le Tan
2b78711eb4 confirm when cleaning up unused images
Add config confirm_images_clean_up.
2017-09-16 14:55:42 +08:00
Le Tan
cdcab4884a use HGMarkdownParser to fetch image links from Markdown file 2017-09-16 14:55:42 +08:00
Le Tan
35fa0a46f6 add recycle bin to each notebook 2017-09-16 14:55:42 +08:00
Le Tan
4626673925 support created_time of notebook and folder 2017-09-16 14:55:42 +08:00
Le Tan
5c038e1f76 support Markdown-it option configs 2017-09-16 14:55:42 +08:00
Le Tan
6addbbfedb remove CloseNote tool bar button 2017-09-16 14:55:42 +08:00
Le Tan
156a73ff8c vfilelist: add two context menu items 2017-09-16 14:55:42 +08:00
Le Tan
f178b1c634 support custom base level for heading sequence by heading_sequence_base_level 2017-09-16 14:55:42 +08:00
Le Tan
ae706fb066 add created_time and modified_time to file 2017-09-16 14:55:42 +08:00
Le Tan
7a384b1592 change default style and config tool bar icon size by tool_bar_icon_size 2017-09-16 14:55:42 +08:00
Le Tan
a36b512e94 do not allow changing type of note 2017-09-16 14:55:42 +08:00
Xianzhong Wang
1ae30b645e Fix the serious bug of pressing Y in vim normal mode (#42) 2017-09-16 14:34:27 +08:00
Le Tan
84d1648fe4 bug-fix: move cursor to the end after creating new note
focusWidget() is NULL in Linux.
2017-09-12 21:16:47 +08:00
Le Tan
7fd2273aad support line number in code block in both read and edit mode 2017-09-12 20:28:40 +08:00
Le Tan
e9238c921e support color column in fenced code block by config color_column 2017-09-12 08:46:39 +08:00
Le Tan
2eb6476c3d support auto heading sequence by config enable_heading_sequence 2017-09-11 19:49:30 +08:00
Le Tan
ed4044061f bug-fix: move to the end of document after inserting title when creating a new note 2017-09-11 19:49:00 +08:00
Le Tan
07e8f27776 optimize VImagePreviewer by flags 2017-09-08 21:41:46 +08:00
Le Tan
e55b0af00e bug-fix: QTextDocument.clearUndoRedoStacks() will crash in VImagePreviewer 2017-09-08 21:41:19 +08:00
Le Tan
f050d7d814 support custom mode to open a note by config note_open_mode 2017-09-08 21:40:55 +08:00
Le Tan
d2ef9608fc bug-fix: use platform-specific text of QKeySequence in context menu 2017-09-08 21:40:31 +08:00
Le Tan
d6ca4245d9 minor-fix: VFileList and VNotebookSelector
1. Bug fix: after deleting last folder, the file list won't be cleared;
2. Move cursor one line down after inserting title automatically;
3. Prompt user to create a root folder after creating a notebook;
4. Autocomplete the folder name from the chosen path when creating a
notebook;
5. Add "Open Notebook Location" action in the context menu of
VNotebookSelector;
2017-09-08 21:40:11 +08:00
Le Tan
4ad79e4d92 vim-mode: <leader>w to save note 2017-09-07 20:35:41 +08:00
Le Tan
3daa463a6d refactor VDirInfoDialog and VNewDirDialog 2017-09-07 20:35:01 +08:00
Le Tan
59d0e82e66 refactor retrivePath to fetchPath 2017-09-07 20:33:38 +08:00
Le Tan
803af89dde support inserting note name as title when creating a note 2017-09-07 20:32:29 +08:00
Le Tan
72970cd404 support reloading content of notebook and folder from disk 2017-09-06 19:23:58 +08:00
Le Tan
f33c7f86d3 minor-fix: Vim mode and VImagePreviewer
1. In Vim mode use the `undo()` and `redo()` slots of VMdEdit instead of
QTextDocument;
2. VImagePreviewer will clear the undo/redo stacks if it is empty
before;
3. Remove setLineDistanceHeight();
2017-09-06 19:23:14 +08:00
Le Tan
7a0a2c552b add shortcuts for note and folder management 2017-09-05 20:54:15 +08:00
Le Tan
36a0d1dd7e support custom line distance height by line_distance_height config 2017-09-05 20:54:15 +08:00
Le Tan
9523168fc3 vim-mode: support S, { and }
Thanks to xianzhon@github
2017-09-05 20:54:15 +08:00
Le Tan
bb7e6e196c make markdown highlight interval configurable via markdown_highlight_interval 2017-09-05 20:54:15 +08:00
Le Tan
639d1cb9e9 refactor VCodeBlockHighlightHelper
1. Use QVector instead of QList;
2. Use cache for highlight result;
2017-09-05 20:54:15 +08:00
Le Tan
c3408769b0 refactor VImagePreviewer 2017-09-05 20:54:15 +08:00
Le Tan
8b1d7e9841 bug-fix: Vim mode Paste action
Move cursor to the right position after paste.
2017-08-30 09:11:03 +08:00
Xianzhong Wang
78bb2d5c41 [bugfix] When paste from register, discard selected texts first (#37)
* [bugfix] When paste from register, discard selected texts first

* Additional fix for the paste command to follow vim spec

* Refactor the code for paste command to make it clear
2017-08-29 21:42:32 +08:00
Le Tan
73630448a6 move vconfig to a local variable 2017-08-29 09:40:28 +08:00
Le Tan
e1befc1038 bug-fix: do not free userSettings and defaultSettings in destructor
Freeing userSettings and defaultSettings in the destructor of
VConfigManager will cause crash in macOS.
2017-08-26 21:50:14 +08:00
Le Tan
b47982ab25 macOS: disable minimizing to system tray
In macOS, there is a "Quit" menu item in the Dock context menu. We can't
not distinguish it from the close button in the title bar. For now, we
just disable the ability to being minimized to system tray.
2017-08-26 21:04:36 +08:00
Le Tan
98ef7c2cfa fix fcitx input issue with linux appimage 2017-08-25 21:46:16 +08:00
Le Tan
1594ab203d change default Vim insert and normal background 2017-08-22 22:21:49 +08:00
Le Tan
1e6d5c533f refine README 2017-08-22 22:05:59 +08:00
Le Tan
c177dd89cb refine README 2017-08-22 21:54:41 +08:00
Xianzhong Wang
dc98b5ef00 [fix] show the default filename in 'Export As' dialog (#35) 2017-08-22 20:28:58 +08:00
Le Tan
1d0c80d5b5 use another source of qt5.7 2017-08-22 20:19:15 +08:00
Le Tan
5c6c6ccb36 package as AppImage for Linux 2017-08-22 10:15:01 +08:00
Le Tan
0a7e92483c try debian packaging 2017-08-20 14:16:36 +08:00
Le Tan
6c06e000af hoedown 2017-08-19 21:24:23 +08:00
Le Tan
94b671f505 vim-mode: support J and gJ to join lines 2017-08-18 19:24:15 +08:00
Le Tan
e594a13e96 release v1.8 2017-08-17 20:06:16 +08:00
Le Tan
b64e5c7ffc bug-fix: VVimIndicator causes input method enabled in read mode 2017-08-17 18:31:54 +08:00
Le Tan
0ded620772 use smaller icon size for toolbar 2017-08-14 19:04:34 +08:00
Le Tan
96350d8a2f refine Chinese translations 2017-08-12 12:43:15 +08:00
Le Tan
b5646a2b34 support links to internal notes 2017-08-11 21:53:37 +08:00
Le Tan
2e7590de24 add Markdown guide 2017-08-11 20:02:54 +08:00
Le Tan
d01996288f flash current anchor in read mode when jumping into it 2017-08-09 20:45:09 +08:00
Le Tan
7c2f1a8927 vim-mode: scroll to center after Ctrl+O/I 2017-08-08 20:12:15 +08:00
Le Tan
91d33c3f5c make name of notebook/folder/note case-insensitive 2017-08-08 20:11:44 +08:00
Le Tan
c2fe857e3a open an external file as internal note if it is a note within VNote 2017-08-07 20:04:18 +08:00
Le Tan
dfaa7772df bug-fix: use the default suffix from markdown suffix list 2017-08-07 20:01:24 +08:00
Le Tan
f9f508c193 bug-fix: save state in close event only when main window is visible 2017-08-07 20:00:39 +08:00
Le Tan
d44549a43f bug-fix: spaces after # are needed for titles in edit mode 2017-08-06 15:33:19 +08:00
Le Tan
586f5c0994 support custom doc type suffixes
Add markdown_suffix config.
2017-08-06 15:26:50 +08:00
Le Tan
c2e1f14dfa refine default CSS style 2017-08-03 21:30:22 +08:00
Le Tan
8595d0a14f make all tool buttons always visible 2017-08-01 22:44:49 +08:00
Le Tan
e88a41d4e3 minor-fix 2017-07-27 18:18:07 +08:00
Le Tan
fc48d69fe0 change desktop file to let it be added to GNome context menu 2017-07-25 22:14:39 +08:00
Le Tan
8264ace8f8 single-instance: latter instances will ask the legal instance to show itself 2017-07-25 22:03:02 +08:00
Le Tan
60e65d1781 system-tray: support system tray icon 2017-07-25 21:41:32 +08:00
Le Tan
b2bae39715 README: add screencast for edit experience 2017-07-22 17:20:26 +08:00
Le Tan
b4873feb41 exporter: OK button to close dialog after exported 2017-07-22 12:21:48 +08:00
Le Tan
226263f77c bug-fix: save wrong geometry state in single panel view 2017-07-21 22:09:40 +08:00
Le Tan
365c0ce91f vim-mode: disable input method in Command type in command line edit 2017-07-20 19:20:04 +08:00
Le Tan
8a6ce16db5 support drag and drop into edit area to open external files 2017-07-20 19:19:28 +08:00
Le Tan
d0bcd7a2c6 vim-mode: make cursor block visible after actions 2017-07-19 20:25:28 +08:00
Le Tan
561cc91069 refine Chinese translations 2017-07-18 21:05:04 +08:00
Le Tan
0b9d259de6 support opening external files from context menu in system browser 2017-07-18 14:36:15 +08:00
Le Tan
e33ff1fede add Info action to tab context menu 2017-07-17 10:10:18 +08:00
Le Tan
8a56dc8b87 support editing external files 2017-07-15 12:46:04 +08:00
Le Tan
30c9403a21 release v1.7 2017-07-14 21:40:14 +08:00
Le Tan
ecd3e65a2d refine Chinese translations 2017-07-14 21:22:04 +08:00
Le Tan
fea491d938 web-view: support title navigation shortcuts
Like Vim mode, support following title navigtion shortcuts:

[[, ]], [], ][, [{, ]}.
2017-07-14 19:37:51 +08:00
Le Tan
5ad99ee9b8 bug-fix: * will recursively expand the directory tree causing crash
We build the complete subtree before expanding to avoid crash.
2017-07-14 19:34:29 +08:00
Le Tan
eb71c8eff1 vim-mode: support Ctrl+R to read a register
Support `Ctrl+R` to read a register both in Insert mode and command line.
2017-07-14 10:13:55 +08:00
Le Tan
cd2ac10509 vim-mode: refine command line mode
1. Support `/` and `?` to search. `N` and `Shift+N` to find next/previous
occurence.
2. `Ctrl+N` and `Ctrl+Shift+N` to navigate through the command history.
3. `:nohlsearch` or `<leader><space>` to clear search highlight.
4. `#` and `*` to search current word under cursor.
2017-07-13 18:26:38 +08:00
Le Tan
c53950fe77 refine find/replace logics
Do not select the found target. Use highlight instead.
2017-07-12 13:16:14 +08:00
Le Tan
0d0f6d4e47 refine line number area 2017-07-11 19:47:43 +08:00
Le Tan
ba84489c68 support custom shortcuts 2017-07-11 09:13:32 +08:00
Le Tan
301879c50c edit-tab: init editor at the first time entering edit mode
Do not init the editor if we just open a note in read mode to speed up.
2017-07-10 13:23:07 +08:00
Le Tan
4374f2d8f1 editor: add line number and editor-line-number config 2017-07-07 17:21:15 +08:00
Le Tan
7fe89d816b refine inline functions in VConfigManager 2017-07-07 11:08:45 +08:00
Le Tan
95a46c9d31 create an artifact on appveyor containing only exe for update test 2017-07-06 21:48:47 +08:00
Le Tan
6fd92f915b toolbar: implement strikethrough and add shortcut tips 2017-07-06 20:40:23 +08:00
Le Tan
71bcfe3019 vim-mode
- `Ctrl+Tab` and `Ctrl+Shift+Tab` in Normal mode to alternate tabs;
- Support `:<num>` command for line jump;
- Support `%`;
2017-07-05 19:42:40 +08:00
Le Tan
33146efcd9 bug-fix: copying image/imageURl in read mode fails due to URL encoding on Windows 2017-07-05 11:37:29 +08:00
Le Tan
f9f7a365f8 add toolbar for text editing
Bold, italic, underline, strikethrough, inline code.

Underline and strikethrough are not implemented yet.
2017-07-04 14:07:48 +08:00
Le Tan
b73f30222d refine search_wrap.svg with logo color 2017-07-03 21:44:42 +08:00
Le Tan
c4683dd232 vim-mode: support ~ to reverse case 2017-07-03 21:22:06 +08:00
Le Tan
a87048cac2 bug-fix: compare two paths with case convertion on Windows
On Windows, case difference in file name is ignored.
2017-07-03 19:09:50 +08:00
Le Tan
a802222b06 constrain the length of the inserted image file 2017-07-02 17:52:11 +08:00
Le Tan
c48d646a55 vim-mode: auto disable input method in non-Insert mode
Add config "enable_smart_im_in_vim_mode".
2017-07-02 13:59:07 +08:00
Le Tan
2b2ae17cd1 refine default.mdhl
- Use a less attractive color for image link.
- Use the same color as code block for inline code.
2017-07-02 11:23:57 +08:00
Le Tan
59cf0a9e33 bug-fix: re-connect signals about Vim status after moving split 2017-07-01 17:21:26 +08:00
Le Tan
026e9f7ed5 refine README.md
1. Update README.md;
2. Split into two versions: English and Chinese.
2017-07-01 16:38:01 +08:00
Le Tan
f911c60c79 support flowchart.js
VNote supports flowchart.js in all for renderers.
2017-07-01 10:19:47 +08:00
Le Tan
9278149941 vim-mode: support shorcuts to jump between titles
- `[[`: jump to previous title;
- `]]`: jump to next title;
- `[]`: jump to previous title at the same level;
- `][`: jump to next title at the same level;
- `[{`: jump to previous title at a higher level;
- `]}`: jump to next title at a higher level;
2017-06-30 20:31:46 +08:00
Le Tan
e1acd6e9a2 vim-mode: support r for replacement 2017-06-30 19:17:42 +08:00
Le Tan
6df4dbe12a vim-mode: support more text objects for i and a
Now Vim supports word, WORD, '', "", ``, (), [], <>, {} as text object.
2017-06-29 19:36:50 +08:00
Le Tan
4b1e256308 vim-mode: going back to Normal mode from insert mode will clear auto indent and auto list 2017-06-28 22:04:54 +08:00
Le Tan
eeaeb0b567 enable font-size in editor section in MDHL file 2017-06-28 20:08:01 +08:00
Le Tan
11f06bf617 vim-mode: bug fixes
1. Enable repeat in f/t/F/T movement;
2. Make cw/W behave like ce/E;
2017-06-27 22:03:41 +08:00
Le Tan
bd5e8be1c0 change default background color of cursor line in Vim Insert/Normal mode
It is too hard to find some suitable color for all 4 backgrounds.
2017-06-27 22:03:01 +08:00
Le Tan
bf8bf9cc4f refine context menu of edit tab
1. "Move one split left/right" will create a new split if needed;
2. Add "Close Tab", "Close Other Tabs", and "Close Tabs To The Right" actions.
2017-06-26 22:26:03 +08:00
Le Tan
003ba7a1f2 bug-fix: some minor bug fixes
1. Refine VUpdater to compare versions with different sections, such as
1.2.3 or 1.2;
2. Update shortcuts help;
3. Fix bug with autoindent and autolist.
2017-06-26 18:51:54 +08:00
Le Tan
cf70786448 bug-fix: revert icns file
The new redrawn app icons on macOS seems do not work properly.
2017-06-25 22:58:19 +08:00
Le Tan
96ac582253 bug-fix: set menu role for certain actions
On macOS, OS will try to merge some actions to the application menu by
text matching, which will be broken in Chinese. So we need to set these
actions' role specifically, including: settings, exit, about, about QT.
2017-06-25 22:22:45 +08:00
Le Tan
9f4ac1f260 bug-fix: add Q_OS_MAC for check
Qt 5.7 seems to use Q_OS_MAC instead of Q_OS_MACOS.
2017-06-25 18:36:05 +08:00
Le Tan
a9ad26b035 vim-mode: use MetaModifier rather than ControlModifier in Vim mode on macOS 2017-06-25 14:58:52 +08:00
Le Tan
0369848943 bug-fix: user could not choose an existing empty folder as the root folder 2017-06-25 14:41:56 +08:00
Le Tan
748dc36cac release v1.6 2017-06-24 09:35:18 +08:00
Le Tan
140c731dd5 update shortcuts help 2017-06-24 00:17:23 +08:00
Le Tan
4e1540522c refine Chinese translations 2017-06-23 23:41:55 +08:00
Le Tan
4681d2becf redraw app icons 2017-06-23 22:46:41 +08:00
Le Tan
c6986eeaf6 bug-fix: always constrain the image width when exporting PDF
Otherwise, the exported PDF will have just part of the large image.
2017-06-23 19:52:36 +08:00
Le Tan
927c0f5c27 bug-fix: Ctrl+D/U to scroll down/up half page instead of one page 2017-06-23 19:45:27 +08:00
Le Tan
34afc2731d help-menu: add update check 2017-06-23 18:10:04 +08:00
Le Tan
707814909a refactor logics about adding notebook 2017-06-22 19:07:01 +08:00
Le Tan
2734b8407c vim-mode: support canceling autoindent after o/O 2017-06-21 22:00:11 +08:00
Le Tan
78674efaa0 bug-fix: Ctrl+H does not work to delete one char
The shortcut of Replace action occupies Ctrl+H.
2017-06-21 21:30:49 +08:00
Le Tan
5c17f74641 add indicator in status bar for edit tab 2017-06-21 20:01:33 +08:00
Le Tan
e305024a58 vim-mode: support simple marks(a-z)
Different behaviors from Vim: after deleting the line with a mark set,
VNote could not detect if this mark is set or not. VNote just simply
jumps to the same line.
2017-06-20 23:50:27 +08:00
Le Tan
878264b8fc vim-mode: support location jump with Ctrl+O and Ctrl+I 2017-06-20 19:37:52 +08:00
Le Tan
10a9447b96 vim-mode: support command line mode and leader key
1. We now support limited commands: :w, :q, :wq, :x, :q! ;
2. We now support fixed leader sequence: y, d, p, P ;
3. Support <num>% to goto <num>/100 percent of the document.
2017-06-20 15:23:58 +08:00
Le Tan
5953954786 vim-mode: support undo/redo and zt/zz/zb
Change SaveAndRead from Ctrl+R to Ctrl+T.
2017-06-19 21:44:17 +08:00
Le Tan
d909091f46 vim-mode: add an indicator for Vim status in status bar 2017-06-19 15:56:12 +08:00
Le Tan
ffce4b9611 vim-mode: message for Vim mode 2017-06-18 09:44:11 +08:00
Le Tan
7871965bf8 vim-mode: support f/F/t/T movement
Support `;` and `,` to repeat last find movement.
2017-06-17 14:33:49 +08:00
Le Tan
5047e19b24 vim-mode: support Copy/Paste/Change/Indent/UnIndent/ToLower/ToUpper action 2017-06-17 11:26:51 +08:00
Le Tan
f6a91d04a8 vim-mode: Ctrl+O to support autoindent and autolist 2017-06-15 11:16:04 +08:00
Le Tan
eba2556a3a vim-mode: support DELETE action
Actions related to `d` and `x`.
2017-06-14 17:25:24 +08:00
Le Tan
88fa722868 dragging mouse with Ctrl and left button pressed to scroll in read and edit mode 2017-06-13 16:24:48 +08:00
Le Tan
71ea514bfa vim-mode: support registers 2017-06-13 15:48:03 +08:00
Le Tan
cbf207d9ed vim-mode: support word-related movement
- `w`, `W`, `e`, `E`, `b`, `B`, `ge`, and `gE`.
2017-06-12 20:20:04 +08:00
Le Tan
1c7e4576a4 do not add icon for menu items in menu bar on macOS 2017-06-11 21:48:02 +08:00
Le Tan
b7f2690e96 vim-mode: reset to Normal mode when edit begins 2017-06-11 21:05:33 +08:00
Le Tan
41fef0ed88 do not show icons in menu on macOS
There is something wrong in the icon resource path on macOS. The icons
in menu could not be displayed correctly.
2017-06-11 20:57:05 +08:00
Le Tan
c15908a724 support highlighting current line by whole block in Vim non-Insert mode 2017-06-11 19:58:43 +08:00
Le Tan
a44259e66c bugfix: implement focusChild() of VMdTab and VHtmlTab to fix focus issue 2017-06-11 17:46:34 +08:00
Le Tan
a8c76d6742 support normal Vim mode
1. Support Insert/Normal/Visual/VisualLine modes:
    - `V`, `v`, `I`, `i`, `A`, `a`, `s`, `Esc`, `Ctrl+[`, `o`, `O`;
2. Support movement commands (with Repeat support):
    - `h`, `j`, `k`, `l`, `gj`, `gk`;
    - `gg`, `G`;
    - `^`, `0`, `$`;
    - `Ctrl+U`, `Ctrl+D`, `PageUp`, `PageDown`, `Ctrl+B`;
2017-06-11 16:31:25 +08:00
Le Tan
224a7253ce support subscript, superscript and footnote in markdown-it
Subscript: H~2~O
Superscript: 2^2^=4
Footnote: This is a footnote[^1].\n[^1]: Here is the footnote.
2017-06-04 12:42:57 +08:00
Le Tan
cc1faba5d2 remove Q_COMPILER_INITIALIZER_LISTS flag to eliminate macro-redefinition warnings 2017-06-03 19:53:47 +08:00
Le Tan
443ee772a7 make cursor visible after highlight completed
Highlight may turn originlly visible cursor partially visible. We make
it visible in this case.
2017-06-03 15:55:00 +08:00
Le Tan
4730d67393 bugfix: fix nested fenced code block issue
The opening ``` and closing ``` should have the same indentation.
2017-06-03 13:23:04 +08:00
Le Tan
85c09c296d refine VNote's log file in release mode
1. Add menu item "View Log" to view log file;
2. Add Captain mode shortcut "Ctrl+E ," to flush the log file;
2017-06-03 10:17:44 +08:00
AlbinZhang
77bbf7f907 fix compilation error with MSVC2013 (#15)
MSVC2013 support C99 incompletely, which causes build errors for C codes in peg-highlight module.

1. Move variable declarations at the front of code block;
2. Add compilation flag `Q_COMPILER_INITIALIZER_LISTS`;
2017-06-02 08:58:09 +08:00
Le Tan
5b150a3634 handle HTML comment correctly 2017-06-01 22:05:02 +08:00
Le Tan
97051badf0 refactor TOC logics 2017-06-01 13:21:17 +08:00
Le Tan
3b011cd8de minor fix 2017-05-31 19:42:37 +08:00
Le Tan
306b3cca92 refactor VEditTab
1. Make VEditTab an abstract class.
2. Use VMdTab inheriting from VEditTab for Markdown file.
3. Use VHtmlTab inheriting from VEditTab for Html file.
2017-05-30 21:05:24 +08:00
Le Tan
6a10c7ab3c refactor DocType 2017-05-29 18:56:43 +08:00
Le Tan
0631b1c30e refactor VDirectory and VNotebook 2017-05-29 12:14:57 +08:00
Le Tan
4c63839c4d bugfix: escape special symbols (&) in TOC during generation 2017-05-26 18:19:42 +08:00
Le Tan
7d05f96f94 release v1.5 2017-05-25 22:27:50 +08:00
Le Tan
c54bc9c680 refine Chinese translations 2017-05-25 22:24:58 +08:00
Le Tan
73530355fd support highlighting trailing space 2017-05-25 19:52:10 +08:00
Le Tan
c8ec95eb3d refine English names of notebooks, folders 2017-05-24 22:15:35 +08:00
Le Tan
19b15b55f4 refine README.md and changes.md for new release 2017-05-24 21:26:26 +08:00
Le Tan
9bf3f9394f support custom image folder for both global scope and notebook scope 2017-05-24 19:54:58 +08:00
Le Tan
03c0fdc49d add Open File Location in directory tree and file list 2017-05-23 19:59:05 +08:00
Le Tan
f7f9ed7157 add open file location button in VExporter 2017-05-23 19:44:35 +08:00
Le Tan
f4708e427f bugfix in VFileList and VEditArea
1. Clear selection before setting current item in VFileList;
2. Status change of non-active tabs shoud not be propagated upwards;
2017-05-23 19:26:12 +08:00
Le Tan
5b4984f59a bugfix: wait for images loaded before exporting PDF 2017-05-23 19:22:49 +08:00
Le Tan
1370272424 change default style 2017-05-22 23:37:43 +08:00
Le Tan
c2c70368da restore last active item in directory tree after switching notebook 2017-05-22 22:47:43 +08:00
Le Tan
de4e5fef8e let Shift+Enter to insert two spaces and a new line 2017-05-22 22:46:24 +08:00
Le Tan
58bc995924 always override the default style 2017-05-22 22:39:51 +08:00
Le Tan
78d57415c4 add image caption for those images which are adjacent with <br> 2017-05-22 22:38:30 +08:00
Le Tan
0131569c02 support exporting note as PDF file
TODO: Currently the exported PDF does not have the outline which is
needed to fix via third-party utils.
2017-05-22 22:34:53 +08:00
Le Tan
871c53743f add print action item
Print support of QWebEngineView is incomplete in Qt5.7. Need to figure
out another way to print documents.

Just hide the action Item.
2017-05-20 13:49:24 +08:00
Le Tan
f43f9c4afc add Showdown renderer 2017-05-18 21:40:02 +08:00
Le Tan
5bb692bcc5 support centering the images and insert the alt text as caption
Add config enable_image_caption.
2017-05-17 21:03:42 +08:00
Le Tan
0cc1841827 add default highlightjs style vnote.css 2017-05-17 21:01:40 +08:00
Le Tan
1b59afbdf2 bugfix: add margin to the <hr> in default.css 2017-05-16 18:11:34 +08:00
Le Tan
df40ac2db0 bugfix: fix Marked highlihgt option 2017-05-11 19:54:36 +08:00
Le Tan
a154e568de constrain the width of images in read mode 2017-05-10 19:36:07 +08:00
Le Tan
e5021f4501 refactor local image folder
Treat those images which have relative path and locate in directories
that have the same parent directory as the file as internal images.
VNote will only manage the internal images.
2017-05-10 15:53:33 +08:00
Le Tan
7a4d86eca9 bugfix: VImagePreviewer to preview images with optional title
Do not preview images in code block.
2017-05-09 19:35:51 +08:00
Le Tan
bf55ba01ce bugfix: match Chinese fonts in mdhl 2017-05-08 19:50:39 +08:00
Le Tan
510fef8cc2 copy OpenSSL dlls for Windows build 2017-05-07 20:16:26 +08:00
Le Tan
db9903b906 support log file in release mode 2017-05-07 10:58:01 +08:00
1902 changed files with 463585 additions and 36546 deletions

31
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Windows 10]
- Version [e.g. 3.0.0]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

169
.github/workflows/ci-linux.yml vendored Normal file
View File

@ -0,0 +1,169 @@
name: CI-Linux
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: false
env:
VNOTE_VER: 3.19.2
CMAKE_VER: 3.24.3
jobs:
build-linux:
name: Build On Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
# Checks-out your repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Init Submodules
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install a Fresh CMake
run: |
wget --no-verbose https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh
chmod +x cmake-${CMAKE_VER}-Linux-x86_64.sh
mkdir ${{runner.workspace}}/cmake
sudo ./cmake-${CMAKE_VER}-Linux-x86_64.sh --skip-license --prefix=${{runner.workspace}}/cmake
sudo rm -f /usr/local/bin/cmake /usr/local/bin/cpack
sudo ln -s ${{runner.workspace}}/cmake/bin/cmake /usr/local/bin/cmake
sudo ln -s ${{runner.workspace}}/cmake/bin/cpack /usr/local/bin/cpack
- name: Install linuxdeploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage
- name: Install Dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libfcitx5-qt-dev fcitx-libs-dev extra-cmake-modules libxkbcommon-dev
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y tree
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y fuse libxcb-cursor-dev
python3 -m pip config set global.break-system-packages true
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/Qt
key: ${{ runner.os }}-QtCache-6.8
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.8.3
target: desktop
modules: 'qtwebengine qtwebchannel qtpositioning qtpdf qtimageformats qt5compat qtserialport'
tools: 'tools_opensslv3_src'
cache: 'true'
- name: Compile OpenSSLV3
run: |
cd ${Qt6_DIR}/../../Tools/OpenSSLv3/src
./Configure
make -j2
sudo make install
- name: Create Build Dir
run: mkdir build
working-directory: ${{runner.workspace}}
- name: Compile fcitxqt5
run: |
git clone https://github.com/fcitx/fcitx-qt5
cd fcitx-qt5
mkdir build && cd build
cmake -DENABLE_QT5=OFF -DENABLE_QT6=ON ..
make -j2
sudo make install
working-directory: ${{runner.workspace}}/build
- name: Compile qt6ct
run: |
git clone https://github.com/trialuser02/qt6ct qt6ct.git
cd qt6ct.git
qmake
make -j$(nproc) && sudo make install
working-directory: ${{runner.workspace}}/build
- name: Configure Project
run: |
qmake -v
cmake --version
cmake ${GITHUB_WORKSPACE}
working-directory: ${{runner.workspace}}/build
- name: Build Project
run: |
# Remove the libqsqlmimer.so as libmimerapi.so is not deployed with Qt6
rm ${{runner.workspace}}/Qt/6.*/gcc_64/plugins/sqldrivers/libqsqlmimer.so
cmake --build . --target pack
working-directory: ${{runner.workspace}}/build
- name: Fix Package
run: |
mkdir fixpackage
mv VNote*.AppImage ./fixpackage
pushd fixpackage
# Extract the AppImage
./VNote*.AppImage --appimage-extract
# Remove libnss3.so and libnssutil3.so
rm ./squashfs-root/usr/lib/libnss*.so
# Re-package
rm VNote*.AppImage
linuxdeploy-plugin-appimage-x86_64.AppImage --appdir=./squashfs-root
mv VNote*.AppImage ../
popd
mv VNote*.AppImage VNote-${{env.VNOTE_VER}}-linux-x64.AppImage
working-directory: ${{runner.workspace}}/build
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: VNote-${{env.VNOTE_VER}}-linux-x64.AppImage
path: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-linux-x64.AppImage
- name: Update Tag
if: github.ref == 'refs/heads/master'
run: |
git tag --force continuous-build ${GITHUB_SHA}
git push --force --tags
- name: Update Continuous Build Release
if: github.ref == 'refs/heads/master'
uses: johnwbyrd/update-release@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-linux-x64.AppImage
release: Continuous Build
tag: continuous-build
- name: Release
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, '[Release]')
uses: ncipollo/release-action@v1.11.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-linux-x64.AppImage
commit: master
tag: v${{env.VNOTE_VER}}
allowUpdates: true
draft: true

235
.github/workflows/ci-macos.yml vendored Normal file
View File

@ -0,0 +1,235 @@
name: CI-MacOS
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: false
env:
VNOTE_VER: 3.19.2
CMAKE_VER: 3.24.3
jobs:
build:
environment: Mac-code-sign
name: Build On MacOS
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
config:
- name: "Build on Arm64"
os: macos-latest
arch: universal
qt: 6.8.3
runs-on: ${{matrix.config.os}}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Init Submodules
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install Dependencies
run: |
brew install tree libiodbc libpq
- name: Fix SQL
run: |
sudo mkdir -p /usr/local/opt/libiodbc/lib
sudo ln -s /opt/homebrew/opt/libiodbc/lib/libiodbc.2.dylib /usr/local/opt/libiodbc/lib/libiodbc.2.dylib
sudo mkdir -p /Applications/Postgres.app/Contents/Versions/14/lib
sudo ln -s /opt/homebrew/Cellar/libpq/16.3/lib/libpq.5.dylib /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib
- name: Install a fresh CMake
run: |
wget --no-verbose https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-macos-universal.tar.gz
tar xzf cmake-${CMAKE_VER}-macos-universal.tar.gz
sudo rm -f /usr/local/bin/cmake /usr/local/bin/cpack
sudo ln -s ${{runner.workspace}}/cmake-${CMAKE_VER}-macos-universal/CMake.app/Contents/bin/cmake /usr/local/bin/cmake
sudo ln -s ${{runner.workspace}}/cmake-${CMAKE_VER}-macos-universal/CMake.app/Contents/bin/cpack /usr/local/bin/cpack
working-directory: ${{runner.workspace}}
- name: Install macdeployqtfix
run: |
git clone https://github.com/tamlok/macdeployqtfix.git macdeployqtfix --depth=1
working-directory: ${{runner.workspace}}
- name: Install optool
run: |
wget --no-verbose https://github.com/alexzielenski/optool/releases/download/0.1/optool.zip
unzip ./optool.zip
sudo ln -s ./optool /usr/local/bin/optool
working-directory: ${{runner.workspace}}
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/Qt
key: ${{ runner.os }}-QtCache-6.8
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{matrix.config.qt}}
target: desktop
modules: 'qtwebengine qtwebchannel qtpositioning qtpdf qtimageformats qt5compat qtserialport'
cache: 'true'
- name: Create Build Dir
run: mkdir build
working-directory: ${{runner.workspace}}
- name: Configure Project
run: |
qmake -v
cmake --version
cmake -DMACDEPLOYQTFIX_EXECUTABLE=${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ${GITHUB_WORKSPACE}
working-directory: ${{runner.workspace}}/build
- name: Build Project
run: |
# Keep only required SQL drivers
rm ${{env.Qt6_DIR}}/plugins/sqldrivers/libqsqlmimer.dylib
rm ${{env.Qt6_DIR}}/plugins/sqldrivers/libqsqlodbc.dylib
rm ${{env.Qt6_DIR}}/plugins/sqldrivers/libqsqlpsql.dylib
# Build the project
cmake --build . --target pack
# Fix Qt frameworks
python3 ${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py ./src/VNote.app/Contents/MacOS/VNote ${{env.Qt6_DIR}}/../..
# Only delete rpaths that exist to avoid errors
for rpath in $(otool -l ./src/VNote.app/Contents/MacOS/VNote | awk '/LC_RPATH/ {getline; getline; print $2}' | grep 'vnote'); do
echo "Checking rpath: $rpath"
if otool -l ./src/VNote.app/Contents/MacOS/VNote | grep -q "$rpath"; then
echo "Deleting rpath: $rpath"
install_name_tool -delete_rpath "$rpath" ./src/VNote.app/Contents/MacOS/VNote
else
echo "Rpath not found: $rpath"
fi
done
for rpath in $(otool -l ./src/VNote.app/Contents/Frameworks/libVTextEdit.dylib | awk '/LC_RPATH/ {getline; getline; print $2}' | grep 'vnote'); do
echo "Checking rpath: $rpath"
if otool -l ./src/VNote.app/Contents/Frameworks/libVTextEdit.dylib | grep -q "$rpath"; then
echo "Deleting rpath: $rpath"
install_name_tool -delete_rpath "$rpath" ./src/VNote.app/Contents/Frameworks/libVTextEdit.dylib
else
echo "Rpath not found: $rpath"
fi
done
# Run macdeployqtfix again to ensure all dependencies are properly fixed
python3 ${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py ./src/VNote.app/Contents/MacOS/VNote ${{env.Qt6_DIR}}/../..
working-directory: ${{runner.workspace}}/build
- name: Codesign Bundle
# Extract the secrets we defined earlier as environment variables
env:
MACOS_CERTIFICATE: ${{ secrets.CLI_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.CLI_MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.CLI_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.CLI_MACOS_CERTIFICATE }}
run: |
# Turn our base64-encoded certificate back to a regular .p12 file
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
# We need to create a new keychain, otherwise using the certificate will prompt
# with a UI dialog asking for the certificate password, which we can't
# use in a headless CI environment
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
echo "Codesigning main app bundle"
codesign --force --deep -s "$MACOS_CERTIFICATE_NAME" --entitlements ${{github.workspace}}/package/entitlements.xml --options runtime ./src/VNote.app
codesign -v -vvv ./src/VNote.app
hdiutil create -volname "VNote" -srcfolder ./src/VNote.app -ov -format UDZO VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
codesign --force --deep -s "$MACOS_CERTIFICATE_NAME" --entitlements ${{github.workspace}}/package/entitlements.xml --options runtime ./VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
codesign -v -vvv ./VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
working-directory: ${{runner.workspace}}/build
- name: "Notarize Bundle"
# Extract the secrets we defined earlier as environment variables
env:
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.CLI_MACOS_NOTARY_USER }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.CLI_MACOS_TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.CLI_MACOS_NOTARY_PWD }}
run: |
# Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI
echo "Create keychain profile"
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
# you're curious
echo "Notarize app"
xcrun notarytool submit "${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg" --keychain-profile "notarytool-profile" --wait
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
# validated by macOS even when an internet connection is not available.
echo "Attach staple"
xcrun stapler staple "${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg"
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Archive DMG
uses: actions/upload-artifact@v4
with:
name: VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}
path: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
- name: Update Tag
if: github.ref == 'refs/heads/master'
run: |
git tag --force continuous-build ${GITHUB_SHA}
git push --force --tags
- name: Update Continuous Build Release
if: github.ref == 'refs/heads/master'
uses: johnwbyrd/update-release@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
release: Continuous Build
tag: continuous-build
- name: Release
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, '[Release]')
uses: ncipollo/release-action@v1.11.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
commit: master
tag: v${{env.VNOTE_VER}}
allowUpdates: true
draft: true

157
.github/workflows/ci-win.yml vendored Normal file
View File

@ -0,0 +1,157 @@
name: CI-Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: false
env:
VNOTE_VER: 3.19.2
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: windows-${{ matrix.config.vs_version }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
config:
- name: "Build on Win64 Qt 5.15"
arch: win64_msvc2019_64
vs_version: 2019
vs_cmd: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"
qt: 5.15.2
qt_modules: qtwebengine
qt_tools: tools_opensslv3_x64
qt_major: 5
suffix: "-windows7"
- name: "Build on Win64 Qt 6"
arch: win64_msvc2022_64
vs_version: 2022
vs_cmd: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"
qt: 6.8.3
qt_modules: "qtwebengine qtwebchannel qtpositioning qtpdf qtimageformats qt5compat"
qt_tools: tools_opensslv3_x64
qt_major: 6
suffix: ""
steps:
# Checks-out your repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Init Submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/Qt
key: ${{runner.os}}-${{matrix.config.arch}}-QtCache-${{matrix.config.qt}}
- name: Install Qt Official Build
uses: jurplel/install-qt-action@v3
with:
version: ${{matrix.config.qt}}
target: desktop
arch: ${{matrix.config.arch}}
modules: ${{matrix.config.qt_modules}}
tools: ${{matrix.config.qt_tools}}
cache: 'true'
- name: Create Build Dir
shell: bash
run: mkdir build
working-directory: ${{runner.workspace}}
- name: Clone OpenSSL on 5.15
shell: bash
if: ${{startsWith(matrix.config.qt, '5.15')}}
run: |
git clone https://github.com/tamlok/openssl-utils.git openssl-utils.git --depth=1
working-directory: ${{runner.workspace}}/build
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Configure and Build Project
shell: cmd
run: |
cmake --version
call "${{matrix.config.vs_cmd}}"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_DEFAULT_MAJOR_VERSION=${{matrix.config.qt_major}} -DOPENSSL_EXTRA_LIB_DIR=${{runner.workspace}}\build\openssl-utils.git\1.1.1j\Win_x64 %GITHUB_WORKSPACE%
cmake --build .
cmake --build . --target=pack
7z x VNote*.zip -o*
dir
working-directory: ${{runner.workspace}}/build
- name: Rename on 5.15
shell: bash
if: ${{startsWith(matrix.config.qt, '5.15')}}
run: |
mv VNote-${{env.VNOTE_VER}}-win64 VNote-${{env.VNOTE_VER}}-win64${{matrix.config.suffix}}
mv VNote-${{env.VNOTE_VER}}-win64.zip VNote-${{env.VNOTE_VER}}-win64${{matrix.config.suffix}}.zip
working-directory: ${{runner.workspace}}/build
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: VNote-${{env.VNOTE_VER}}-win64${{matrix.config.suffix}}
path: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-win64${{matrix.config.suffix}}
- name: Archive Installer
if: ${{!startsWith(matrix.config.qt, '5.15')}}
uses: actions/upload-artifact@v4
with:
name: VNote-${{env.VNOTE_VER}}-win64${{matrix.config.suffix}}.msi
path: ${{runner.workspace}}/build/VNote*.msi
- name: Update Tag
if: github.ref == 'refs/heads/master'
shell: bash
run: |
git tag --force continuous-build ${GITHUB_SHA}
git push --force --tags
- name: Update Continuous Build Release
if: github.ref == 'refs/heads/master'
uses: johnwbyrd/update-release@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
# glob not supported
files: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-win64${{matrix.config.suffix}}.zip
release: Continuous Build
tag: continuous-build
- name: Release
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, '[Release]')
uses: ncipollo/release-action@v1.11.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
# glob not supported
artifacts: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-win64${{matrix.config.suffix}}
commit: master
tag: v${{env.VNOTE_VER}}
allowUpdates: true
draft: true

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
*.pro.user
*.pro.user.*
.ccls
compile_commands.json
compile_commands.json.*
compile_flags.txt
.cache
.tasks
.vimspector.json
GPATH
GRTAGS
GTAGS
aqtinstall.log
tags
CMakeLists.txt.user
build
.DS_Store

12
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "src/utils/marked"]
path = src/utils/marked
url = https://github.com/chjj/marked.git
[submodule "hoedown"]
path = hoedown
url = https://github.com/tamlok/hoedown.git
[submodule "libs/vtextedit"]
path = libs/vtextedit
url = https://github.com/vnotex/vtextedit.git
[submodule "libs/QHotkey"]
path = libs/QHotkey
url = https://github.com/vnotex/QHotkey.git

View File

@ -1,31 +0,0 @@
{
"package": {
"name": "vnote",
"repo": "vnote",
"subject": "tamlok",
"desc": "Continuous deployment by Travis-CI",
"website_url": "https://github.com/tamlok/vnote",
"issue_tracker_url": "https://github.com/tamlok/vnote/issues",
"vcs_url": "https://github.com/tamlok/vnote.git",
"github_use_tag_release_notes": false,
"github_release_notes_file": "",
"licenses": ["MIT"],
"labels": ["Markdown", "Note-Taking", "Office", "Utils", "Efficiency"],
"public_download_numbers": true,
"public_stats": true
},
"version": {
"name": "1.4",
"desc": "VNote Releases",
"released": "2017-05-06",
"vcs_tag": "1.4",
"gpgSign": false
},
"files":
[{"includePattern": "build/distrib/(VNote_linux_.*\\.tar\\.gz)", "uploadPattern": "$1",
"matrixParams": {"override": 1 }}],
"publish": true
}

View File

@ -1,31 +0,0 @@
{
"package": {
"name": "vnote",
"repo": "vnote",
"subject": "tamlok",
"desc": "Continuous deployment by Travis-CI",
"website_url": "https://github.com/tamlok/vnote",
"issue_tracker_url": "https://github.com/tamlok/vnote/issues",
"vcs_url": "https://github.com/tamlok/vnote.git",
"github_use_tag_release_notes": false,
"github_release_notes_file": "",
"licenses": ["MIT"],
"labels": ["Markdown", "Note-Taking", "Office", "Utils", "Efficiency"],
"public_download_numbers": true,
"public_stats": true
},
"version": {
"name": "1.4",
"desc": "VNote Releases",
"released": "2017-05-06",
"vcs_tag": "1.4",
"gpgSign": false
},
"files":
[{"includePattern": "build/distrib/(VNote_.*\\.dmg)", "uploadPattern": "$1",
"matrixParams": {"override": 1 }}],
"publish": true
}

View File

@ -1,57 +0,0 @@
dist: trusty
sudo: required
git:
depth: 1
language: cpp
matrix:
include:
- os: osx
compiler: clang
osx_image: xcode8
- os: linux
compiler: g++
branches:
only:
- master
before_install:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get -qq update ; fi
- export version="1.4"
install:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install p7zip-full ; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install chrpath ; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install tree ; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get install -qq gcc-6; sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100 ; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get install -qq g++-6; sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100 ; fi
before_script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then chmod +x .travis_linux.sh ; fi
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then chmod +x .travis_macos.sh ; fi
script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then CXX="g++-6" CC="gcc-6" ./.travis_linux.sh ; fi
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then ./.travis_macos.sh ; fi
deploy:
- provider: bintray
file: "./.linux_bintray.json"
user: tamlok
key:
secure: vADlrYSusARnHxK3NTT3r1r6I/lrxyEuFKLOO73KXl6rvDywrrDDi6YsFekL14/o3clZKLOC8LbvA+4BKPVSoGTO4Dpx/i51fXphf+mMFB3QXSGnbqHm4+2ZnhCl62vfVlFeOPBLDO0KUBI8DCP0I+QogOUickXv3zYx69z6AudSxgjY7nPoN5jGSPgyId4r3o8Shrj1Fk1WtN6qciKyPne57v+jmvRlJTkoEfYkvwTRNMBlmaKy8Vj/CSoIvB8TH8bv3rhHLrN4o1QCwePdaX9G7xlImSpXqgRgzQVU3SRFN2bYTj5DZc1aFyA7iNOhmwgCLAN6OrqXyyJCbyywNhylfgad2rQANcfXiZw9ywooKEYafLDRuiK2G6Pk8m+R6Ded9JBoX9MSz/ZDxxfk4NmLO991wS7IK5aFTQfHZz5W8Tmh1rCphFwlDI/Rxs7ExbXu7INA8IhoLpOSmLIA5lfdC4fD8rv8mjy5gfpMkWlP8XATfi2eMH9uGj89aJa6xp7Bc2mfW3M71YHtYP/pyE/7Bk5vVonP8Cq9rK6OruMIUYtNmXoJnpte20ecSXj9yw7oTR27dhSx3XuAKOXiNpIau0CPxtXA5cSm5X0OS1Lt8RWrms0jp9Ch2dgxlNMpr0soF9DmwekhfHnVoOLyFBWBMDwvkx5TWij9FNAAJb4=
dry-run: false
on:
condition: $TRAVIS_OS_NAME = linux
branch: master
- provider: bintray
file: "./.macos_bintray.json"
user: tamlok
key:
secure: vADlrYSusARnHxK3NTT3r1r6I/lrxyEuFKLOO73KXl6rvDywrrDDi6YsFekL14/o3clZKLOC8LbvA+4BKPVSoGTO4Dpx/i51fXphf+mMFB3QXSGnbqHm4+2ZnhCl62vfVlFeOPBLDO0KUBI8DCP0I+QogOUickXv3zYx69z6AudSxgjY7nPoN5jGSPgyId4r3o8Shrj1Fk1WtN6qciKyPne57v+jmvRlJTkoEfYkvwTRNMBlmaKy8Vj/CSoIvB8TH8bv3rhHLrN4o1QCwePdaX9G7xlImSpXqgRgzQVU3SRFN2bYTj5DZc1aFyA7iNOhmwgCLAN6OrqXyyJCbyywNhylfgad2rQANcfXiZw9ywooKEYafLDRuiK2G6Pk8m+R6Ded9JBoX9MSz/ZDxxfk4NmLO991wS7IK5aFTQfHZz5W8Tmh1rCphFwlDI/Rxs7ExbXu7INA8IhoLpOSmLIA5lfdC4fD8rv8mjy5gfpMkWlP8XATfi2eMH9uGj89aJa6xp7Bc2mfW3M71YHtYP/pyE/7Bk5vVonP8Cq9rK6OruMIUYtNmXoJnpte20ecSXj9yw7oTR27dhSx3XuAKOXiNpIau0CPxtXA5cSm5X0OS1Lt8RWrms0jp9Ch2dgxlNMpr0soF9DmwekhfHnVoOLyFBWBMDwvkx5TWij9FNAAJb4=
dry-run: false
on:
condition: $TRAVIS_OS_NAME = osx
branch: master

View File

@ -1,58 +0,0 @@
#!/bin/bash
project_dir=$(pwd)
qt_install_dir=/opt
cd ${qt_install_dir}
sudo wget https://github.com/adolby/qt-more-builds/releases/download/5.7/qt-opensource-5.7.0-linux-x86_64.7z
sudo 7z x qt-opensource-5.7.0-linux-x86_64.7z &> /dev/null
PATH=${qt_install_dir}/Qt/5.7/gcc_64/bin/:${PATH}
cd ${project_dir}
mkdir build
cd build
qmake -v
qmake CONFIG-=debug CONFIG+=release -spec linux-g++-64 ../VNote.pro
make
mkdir -p distrib/VNote
cd distrib/VNote
# Copy VNote executable
cp ../../src/VNote ./
# Copy ICU libraries
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libicui18n.so.56.1" "libicui18n.so.56"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libicuuc.so.56.1" "libicuuc.so.56"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libicudata.so.56.1" "libicudata.so.56"
mkdir platforms
cp "${qt_install_dir}/Qt/5.7/gcc_64/plugins/platforms/libqxcb.so" "platforms/libqxcb.so"
cp "${qt_install_dir}/Qt/5.7/gcc_64/plugins/platforms/libqminimal.so" "platforms/libqminimal.so"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5WebEngineWidgets.so.5.7.0" "libQt5WebEngineWidgets.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5WebEngineCore.so.5.7.0" "libQt5WebEngineCore.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Widgets.so.5.7.0" "libQt5Widgets.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5WebChannel.so.5.7.0" "libQt5WebChannel.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Core.so.5.7.0" "libQt5Core.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Gui.so.5.7.0" "libQt5Gui.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5DBus.so.5.7.0" "libQt5DBus.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5XcbQpa.so.5.7.0" "libQt5XcbQpa.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Qml.so.5.7.0" "libQt5Qml.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Network.so.5.7.0" "libQt5Network.so.5"
# Use chrpath to set up rpaths for Qt's libraries so they can find
# each other
chrpath -r \$ORIGIN/.. platforms/libqxcb.so
chrpath -r \$ORIGIN/.. platforms/libqminimal.so
# Copy other project files
cp "${project_dir}/README.md" "README.md"
cp "${project_dir}/LICENSE" "LICENSE"
echo ${version} > version
echo "${TRAVIS_COMMIT}" >> version
# Package portable executable
cd ..
tar -czvf VNote_linux_x86_64_portable_${version}.tar.gz VNote
exit 0

View File

@ -1,49 +0,0 @@
#!/bin/bash
project_dir=$(pwd)
brew update > /dev/null
brew install qt@5.7
QTDIR="/usr/local/opt/qt@5.7"
PATH="$QTDIR/bin:$PATH"
LDFLAGS=-L$QTDIR/lib
CPPFLAGS=-I$QTDIR/include
# Build your app
cd ${project_dir}
mkdir build
cd build
qmake -v
qmake CONFIG-=debug CONFIG+=release ../VNote.pro
make -j2
git clone https://github.com/aurelien-rainone/macdeployqtfix.git
# Package DMG from build/src/VNote.app directory
cd src/
sed -i -e 's/com.yourcompany.VNote/com.tamlok.VNote/g' VNote.app/Contents/Info.plist
$QTDIR/bin/macdeployqt VNote.app
python ../macdeployqtfix/macdeployqtfix.py VNote.app/Contents/MacOS/VNote $QTDIR
# Fix Helpers/QtWebEngineProcess.app
cd VNote.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/5/Helpers
$QTDIR/bin/macdeployqt QtWebEngineProcess.app
python ${project_dir}/build/macdeployqtfix/macdeployqtfix.py QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess $QTDIR
cd ${project_dir}/build
mkdir -p distrib/VNote
cd distrib/VNote
mv ../../src/VNote.app ./
cp "${project_dir}/LICENSE" "LICENSE"
cp "${project_dir}/README.md" "README.md"
echo "${version}" > version
echo "${TRAVIS_COMMIT}" >> version
ln -s /Applications ./Applications
cd ..
hdiutil create -srcfolder ./VNote -format UDBZ ./VNote.dmg
mv VNote.dmg VNote_mac_X64_${version}.dmg
cd ..
exit 0

26
CMakeLists.txt Normal file
View File

@ -0,0 +1,26 @@
cmake_minimum_required (VERSION 3.20)
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.1" CACHE STRING "Minimum OS X deployment version")
project(VNote
VERSION 3.19.2
DESCRIPTION "A pleasant note-taking platform"
HOMEPAGE_URL "https://app.vnote.fun"
LANGUAGES C CXX)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type, defaults to Release")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(QHOTKEY_INSTALL OFF CACHE BOOL "Disable installing QHotKey" FORCE)
add_subdirectory(libs)
add_subdirectory(src)
# TODO: find a better way to organize tests
# add_subdirectory(tests)

165
COPYING.LESSER Normal file
View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2016 Le Tan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

326
README.md
View File

@ -1,318 +1,42 @@
# VNote
**VNote** is a Vim-inspired note-taking application, designed specially for **Markdown**.
![CI-Windows](https://github.com/vnotex/vnote/actions/workflows/ci-win.yml/badge.svg?branch=master) ![CI-Linux](https://github.com/vnotex/vnote/actions/workflows/ci-linux.yml/badge.svg?branch=master) ![CI-MacOS](https://github.com/vnotex/vnote/actions/workflows/ci-macos.yml/badge.svg?branch=master)
**VNote** 是一个受Vim启发开发的专门为 **Markdown** 而优化、设计的笔记软件。
[简体中文](README_zh_CN.md)
![VNote](screenshots/vnote.png)
[Project on Gitee](https://gitee.com/vnotex/vnote)
A pleasant note-taking platform.
<!-- vim-markdown-toc GFM -->
* [Downloads (下载)](#downloads-下载)
* [Windows](#windows)
* [Linux](#linux)
* [MacOS](#macos)
* [Description (简介)](#description-简介)
* [Support (支持)](#support-支持)
* [Why VNote (开发VNote的动机)](#why-vnote-开发vnote的动机)
* [Markdown Editor & Note-Taking (Markdown编辑器与笔记管理)](#markdown-editor--note-taking-markdown编辑器与笔记管理)
* [Pleasant Markdown Experience (舒适的Markdown体验)](#pleasant-markdown-experience-舒适的markdown体验)
* [Features (功能)](#features-功能)
* [Notebook-Based Notes Management (基于笔记本的管理)](#notebook-based-notes-management-基于笔记本的管理)
* [Simple Notes Management (直观的笔记管理)](#simple-notes-management-直观的笔记管理)
* [Minimum Gap Between Edit and View (最小化编辑与阅读的鸿沟)](#minimum-gap-between-edit-and-view-最小化编辑与阅读的鸿沟)
* [Syntax Highlight (语法高亮)](#syntax-highlight-语法高亮)
* [Live Image Preview (实时图片预览)](#live-image-preview-实时图片预览)
* [Pleasant Image Experience (良好的图片体验)](#pleasant-image-experience-良好的图片体验)
* [Interactive Outline Viewer for Edit and View Mode (编辑和阅读时交互式大纲视图)](#interactive-outline-viewer-for-edit-and-view-mode-编辑和阅读时交互式大纲视图)
* [Powerful Shortcuts (强大的快捷键)](#powerful-shortcuts-强大的快捷键)
* [Window Split (窗口分割)](#window-split-窗口分割)
* [Highly Configurable (高度可定制)](#highly-configurable-高度可定制)
* [Others (其他)](#others-其他)
* [Build & Development (构建与开发)](#build--development-构建与开发)
* [Clone & Init (克隆代码仓库)](#clone--init-克隆代码仓库)
* [Download Qt & Have Fun (下载Qt)](#download-qt--have-fun-下载qt)
* [Linux Command Line (Linux命令行)](#linux-command-line-linux命令行)
* [MacOS](#macos-1)
* [Dependencies (依赖)](#dependencies-依赖)
* [License (代码许可)](#license-代码许可)
For more information, please visit [**VNote's Home Page**](https://vnotex.github.io/vnote).
<!-- vim-markdown-toc -->
![VNote](pics/vnote.png)
# Downloads (下载)
国内用户可以尝试网盘下载:[Yunpan](http://pan.baidu.com/s/1jI5HROq)。
## Description
**VNote** is a Qt-based, free and open source note-taking application, focusing on Markdown now. VNote is designed to provide a pleasant note-taking platform with excellent editing experience.
## Windows
![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/tamlok/vnote?svg=true)
VNote is **NOT** just a simple editor for Markdown. By providing notes management, VNote makes taking notes in Markdown simpler. In the future, VNote will support more formats besides Markdown.
- [Github Releases](https://github.com/tamlok/vnote/releases)
- [Latest Builds](https://bintray.com/tamlok/vnote/vnote/view/files)
Utilizing Qt, VNote could run on **Linux**, **Windows**, and **macOS**.
## Linux
[![Build Status](https://travis-ci.org/tamlok/vnote.svg?branch=master)](https://travis-ci.org/tamlok/vnote)
![Main](pics/main.png)
**NOT** ready yet! Please help yourself to compile and build it from sources.
![Main2](pics/main2.png)
## MacOS
[![Build Status](https://travis-ci.org/tamlok/vnote.svg?branch=master)](https://travis-ci.org/tamlok/vnote)
## Downloads
Continuous builds on `master` branch could be found at the [Continuous Build](https://github.com/vnotex/vnote/releases/tag/continuous-build) release.
- [Github Releases](https://github.com/tamlok/vnote/releases)
- [Latest Builds](https://bintray.com/tamlok/vnote/vnote/view/files)
Latest stable builds could be found at the [latest release](https://github.com/vnotex/vnote/releases/latest). Alternative download services are available:
# Description (简介)
**VNote** is a Qt-based, free and open source note-taking application, focusing on Markdown. VNote is designed to provide comfortable edit experience.
* [Tianyi Netdisk](https://cloud.189.cn/t/Av67NvmEJVBv)
* [Baidu Netdisk](https://pan.baidu.com/s/1lX69oMBw8XuJshQDN3HiHw?pwd=f8fk)
Utilizing Qt, VNote could run on **Linux**, **Windows** and **MacOS**. Android support will be on the road soon.
## Supports
* [GitHub Issues](https://github.com/vnotex/vnote/issues);
* Email: `tamlokveer at gmail.com`;
* [Telegram](https://t.me/vnotex);
* WeChat Public Account: vnotex;
**VNote**是一个基于Qt框架的、免费的开源笔记软件。VNote专注于Markdown的编辑与阅读以提供舒适的编辑体验为设计目标。
基于Qt框架VNote能够在主流操作系统上运行包括 **Linux**, **Windows** 以及 **MacOS**。Android客户端目前也在开发计划内敬请期待。
![VNote](screenshots/vnote_001.png)
# Support (支持)
- [Github Issues](https://github.com/tamlok/vnote/issues)
- Email: tamlokveer at gmail.com
- QQ群: **487756074** (VNote使用和开发)
# Why VNote (开发VNote的动机)
## Markdown Editor & Note-Taking (Markdown编辑器与笔记管理)
VNote tries to be a Markdown editor with notes management, or a note-taking application with pleasant Markdown support.
Some popular note-taking applications provide Markdown support, such as WizNote, Youdao Note. But most of them provide poor Markdown experience (especially on Linux).
There are always many powerful Markdown editors. But most of them lack the functionality to manage all your notes. During the design and implementation, VNote references to [CuteMarked](https://github.com/cloose/CuteMarkEd/) a lot.
VNote设计为带有笔记管理功能的Markdown编辑器或者有良好Markdown支持的笔记软件。
目前一些流行的笔记软件也提供Markdown的支持比如为知笔记、有道云笔记等但是大多数都只是简(liao)单(sheng)支(yu)持(wu)特别是在Linux平台上更是体(can)验(bu)不(ren)佳(du)。
当然目前也有很多非常强大的专注于Markdown的编辑器。但是大多数都不会提供笔记管理功能作为一个编辑器也没有必要提供或者只是提供一个简单的文件系统浏览器。其中CuteMarked就是一个流行的Markdown编辑器之一VNote在实现的过程中也在很多地方参考借鉴了该软件。
## Pleasant Markdown Experience (舒适的Markdown体验)
VNote tries to minimize the gap between the edit and view of Markdown. Instead of using two panels to edit and preview simultaneously, VNote utilizes syntax highlight to help keeping track of the content. VNote also previews images in place when editing. It is said that you won't want to exit the edit mode when using VNote.
VNote also learns a lot from Vim and Shell to provide many convenient and efficient shortcuts.
VNote尝试尽量减小Markdown与生俱来的编辑和阅读之间的割裂感。目前很多编辑器通过左右两栏来同时编辑和预览Markdown但是编辑和阅读还是割裂明显。VNote利用准确有意义的语法高亮来帮助用户追踪、辨认笔记内容使得Markdown在编辑的时候也能和阅读一样提供良好的视觉、排版效果。同时VNote支持编辑时原地预览图片进一步减小割裂感。使用VNote后你一定会更想留在编辑模式。
另外VNote也借鉴了Vim和Shell来提供很多非常方便高效的快捷键。
# Features (功能)
## Notebook-Based Notes Management (基于笔记本的管理)
VNote uses **notebooks** to hold your notes. Like OneNote, a notebook can be hosted on any location in your system. A notebook is designed to represent one account. For example, you could have one notebook hosted on local file system and another notebook hosted on an OwnCloud server. This is really useful when notes require different levels of security.
A notebook corresponds to a self-contained folder in the file system. You could copy the folder to another location (or on another computer) and import it into VNote.
A notebook could have infinite levels of directories. VNote supports copying or moving directories or notes within or between notebooks.
VNote使用 **笔记本** 来管理笔记。类似于OneNote一个笔记本可以保存在系统上的任意位置。一个笔记本对应于一个账户的概念。例如你可以在本地文件系统上有一个笔记本另外在某台OwnCloud服务器上保存另一个笔记本。当不同的笔记有不同的保密要求时独立的笔记本就非常适用了。
一个笔记本对应于文件系统上的一个独立完整的文件夹。你可以将该文件夹拷贝到其他位置或者另一台计算机上然后将其导入到VNote中。
VNote支持一个笔记本中包含无限层级的文件夹。VNote支持在笔记本内或笔记本间拷贝或剪切文件夹和笔记。
![VNote Directory and File Panel](screenshots/vnote_002.png)
## Simple Notes Management (直观的笔记管理)
All your notes are managed by some plaintext configuration files and stored as plaintext files. You could access your notes without VNote. You could use external file synchronization services to synchronize your notes and import them on another machine.
VNote supports both Markdown (suffix `md`) and rich text notes.
所有笔记被保存为纯文本而且通过纯文本的配置文件进行管理。即使没有VNote你也能方便访问你的数据。这样你也可以使用第三方的文件同步服务来同步你的笔记并在另一台计算机上导入到VNote中。
VNote支持Markdown和富文本笔记其中Markdown笔记必须以`md`为后缀名。
## Minimum Gap Between Edit and View (最小化编辑与阅读的鸿沟)
VNote tries to provide the best-effort *WYSIWYG* for Markdown by utilizing proper syntax highlight and other features.
通过使用有意义的语法高亮和其他一些功能VNote尽可能为Markdown提供 *所见即所得* 的体验。
### Syntax Highlight (语法高亮)
VNote supports accurate syntax highlight for Markdown. Tuning the style of the highlight, VNote enables you to keep track of your document easily.
VNote also supports **syntax highlight for fenced code blocks** in Markdown, which is **superior** than almost all current Markdown editors.
VNote支持精确的Markdown语法高亮。通过精心调试的高亮样式VNote使得你能够轻松跟踪和阅读你的文档。
VNote还支持Markdown中代码块的语法高亮。目前的Markdown编辑器中绝大部分都尚不支持该特性。
![VNote Syntax Highlight](screenshots/vnote_003.png)
### Live Image Preview (实时图片预览)
VNote supports previewing the image link while editing. With this, you could just stay in edit mode as much as possible.
You could select the image to copy it.
VNote支持在编辑时预览图片链接。这样一来你就能尽可能地留在编辑模式避免频繁切换。
如果想要拷贝图片,可以选取该图片,然后复制。
![VNote Live Image Preview](screenshots/vnote_004.png)
### Pleasant Image Experience (良好的图片体验)
Just paste your image into the Markdown note, VNote will manage all other stuffs. VNote stores images in the `images` folder in the same directory with the note. VNote will pop up a window to preview the image when you insert an image. Furthermore, VNote will delete the image file automatically after you remove the image link.
编辑时支持像其他富文本编辑器一样直接粘贴插入图片VNote会帮你管理所插入的图片。VNote将这些图片保存在和笔记同一目录下的 `images` 子目录中。插入图片时VNote会弹出一个窗口预览即将要插入的图片。另外当你移除笔记中的图片链接时VNote会自动删除对应的图片。
![VNote Image Insertion](screenshots/vnote_005.png)
### Interactive Outline Viewer for Edit and View Mode (编辑和阅读时交互式大纲视图)
VNote provides a user-friendly outline viewer for both edit and view mode. The outline viewer is a responsive item tree instead of a segment of HTML.
VNote为编辑和预览模式都提供了一个用户友好的大纲视图。该大纲视图是一个项目树而不是简单地插入一段HTML。
![VNote Outline Viewer](screenshots/vnote_006.png)
## Powerful Shortcuts (强大的快捷键)
VNote supports many pleasant and powerful shortcuts which facilitate your editing, including **Captain Mode** and **Navigation Mode** which enable you to work without the mouse.
Some Examples:
- `Ctrl+W` to enter edit mode; `Ctrl+R` to save and enter read mode; `Ctrl+T` to maximize edit area;
- `Ctrl+B`, `Ctrl+I`, `Ctrl+O` to insert bold, italic and inline-code text.
Please refer to the help menu for more details.
VNote提供很多快捷键从而提供一个愉悦的编辑体验。其中包括 **舰长模式****导航模式**,它们能让你完全摆脱鼠标。
一些例子:
- `Ctrl+W` 进入编辑模式;`Ctrl+R` 保存并进入阅读模式;`Ctrl+T` 最大化编辑区;
- `Ctrl+B`, `Ctrl+I`, `Ctrl+O` 插入粗体、斜体和行内代码。
更多细节请参考帮助文档。
## Window Split (窗口分割)
VNote supports infinite horizontal window split, facilitating notes management and writing.
VNote支持无限水平窗口分割方便你进行笔记的整理和撰写。
![VNote Window Split](screenshots/vnote_007.png)
## Highly Configurable (高度可定制)
In VNote, almost everything is configurable, such as background color, font, and Markdown style. VNote uses a plaintext file to record all your configuration, so you could just copy that file to initialize a new VNote on another computer.
VNote中几乎一切都是可以定制的例如背景颜色、字体以及Markdown样式等。VNote使用一个纯文本文件来记录你的所有配置因此通过拷贝该文件就能够很快地在另一台电脑上初始化一个新的VNote。
## Others (其他)
VNote also supports many other features, like:
- Highlight current cursor line;
- Highlight selected text;
- Powerful search within the note;
- Auto indent and auto list;
VNote还支持其他很多的功能比如
- 高亮当前行;
- 高亮所选择的文本;
- 强大的页内查找;
- 自动缩进和自动列表;
![VNote Find](screenshots/vnote_009.png)
# Build & Development (构建与开发)
## Clone & Init (克隆代码仓库)
```
git clone https://github.com/tamlok/vnote.git vnote.git
cd vnote.git
git submodule update --init
```
## Download Qt & Have Fun (下载Qt)
Download [Qt 5.7.0](http://info.qt.io/download-qt-for-application-development) and open `VNote.pro` as a project.
下载[Qt 5.7.0](http://info.qt.io/download-qt-for-application-development),导入`VNote.pro`创建一个工程。
### Linux Command Line (Linux命令行)
If you prefer command line on Linux, you could follow these steps.
在Linux命令行下你可以执行以下命令来编译和安装
```
cd vnote.git
mkdir build
cd build
# May need to use the qmake in your downloaded Qt.
qmake ../VNote.pro
make
sudo make install
```
## MacOS
If you prefer command line on macOS, you could follow these steps.
1. Install Xcode and Homebrew;
2. Install Qt5.7 via Homebrew:
```
brew install qt@5.7
```
3. In the project directory, create `build_macos.sh` like this:
```sh
QTDIR="/usr/local/opt/qt@5.7"
PATH="$QTDIR/bin:$PATH"
LDFLAGS=-L$QTDIR/lib
CPPFLAGS=-I$QTDIR/include
mkdir -p build
cd build
qmake -v
qmake CONFIG-=debug CONFIG+=release ../VNote.pro
make -j2
```
4. Make `build_macos.sh` executable and run it:
```sh
chmod +x build_macos.sh
./build_macos.sh
```
5. Now you got the bundle `path/to/project/build/src/VNote.app`. Enjoy yourself!
在macOS下你可以执行以下命令来编译
1. 安装Xcode和Homebrew
2. 通过Homebrew安装Qt5.7
```
brew install qt@5.7
```
3. 在VNote源码根目录下新建一个文件`build_macos.sh`
```sh
QTDIR="/usr/local/opt/qt@5.7"
PATH="$QTDIR/bin:$PATH"
LDFLAGS=-L$QTDIR/lib
CPPFLAGS=-I$QTDIR/include
mkdir -p build
cd build
qmake -v
qmake CONFIG-=debug CONFIG+=release ../VNote.pro
make -j2
```
4. 修改`build_macos.sh`的执行权限,并执行:
```sh
chmod +x build_macos.sh
./build_macos.sh
```
5. 此时得到VNote的Bundle `path/to/project/build/src/VNote.app`,打开即可。
# Dependencies (依赖)
- [Qt 5.7](http://qt-project.org) (L-GPL v3)
- [PEG Markdown Highlight](http://hasseg.org/peg-markdown-highlight/) (MIT License)
- [Hoedown 3.0.7](https://github.com/hoedown/hoedown/) (ISC License)
- [Marked](https://github.com/chjj/marked) (MIT License)
- [Highlight.js](https://github.com/isagalaev/highlight.js/) (BSD License)
- [Ionicons 2.0.1](https://github.com/driftyco/ionicons/) (MIT License)
- [markdown-it 8.3.1](https://github.com/markdown-it/markdown-it) (MIT License)
- [markdown-it-headinganchor 1.3.0](https://github.com/adam-p/markdown-it-headinganchor) (MIT License)
- [markdown-it-task-lists 1.4.0](https://github.com/revin/markdown-it-task-lists) (ISC License)
- [mermaid 7.0.0](https://github.com/knsv/mermaid) (MIT License)
# License (代码许可)
VNote is licensed under the [MIT license](http://opensource.org/licenses/MIT).
Thank [users who donated to VNote](https://github.com/vnotex/vnote/wiki/Donate-List)!
## License
VNote is licensed under [GNU LGPLv3](https://opensource.org/licenses/LGPL-3.0). Code base of VNote could be used freely by VNoteX.

42
README_zh_CN.md Normal file
View File

@ -0,0 +1,42 @@
# VNote
![CI-Windows](https://github.com/vnotex/vnote/actions/workflows/ci-win.yml/badge.svg?branch=master) ![CI-Linux](https://github.com/vnotex/vnote/actions/workflows/ci-linux.yml/badge.svg?branch=master) ![CI-MacOS](https://github.com/vnotex/vnote/actions/workflows/ci-macos.yml/badge.svg?branch=master)
[English](README.md)
[Gitee托管项目](https://gitee.com/vnotex/vnote)
一个舒适的笔记平台!
更多信息,请访问[VNote主页](https://vnotex.github.io/vnote)。
![VNote](pics/vnote.png)
## 简介
**VNote**是一个专注于Markdown的基于Qt的开源免费的笔记应用。VNote希望能提供一个拥有完美编辑体验的舒适的笔记平台。
VNote不是一个简单的Markdown编辑器。通过提供强大的笔记管理VNote使得使用Markdown记笔记更轻松简单。将来VNote会支持更多的文档格式。
得益于QtVNote当前可以高效地运行在**Linux****Windows**,以及**macOS**平台上。
![主界面](pics/main.png)
![主界面2](pics/main2.png)
## 下载
基于`master`分支的[持续构建版本发布](https://github.com/vnotex/vnote/releases/tag/continuous-build)。
最新的[稳定版本发布](https://github.com/vnotex/vnote/releases/latest)。其他下载选项:
* [天翼云盘](https://cloud.189.cn/t/Av67NvmEJVBv)
* [百度云盘](https://pan.baidu.com/s/1lX69oMBw8XuJshQDN3HiHw?pwd=f8fk)
## 支持
* [GitHub Issues](https://github.com/vnotex/vnote/issues)
* 邮件:`tamlokveer at gmail.com`
* [Telegram](https://t.me/vnotex)
* 微信公众号:`vnotex`
感谢这些[捐赠用户](https://github.com/vnotex/vnote/wiki/Donate-List)
## 许可
VNote遵循[GNU LGPLv3](https://opensource.org/licenses/LGPL-3.0)许可。VNote项目的代码可以自由给VNoteX项目使用。

15
SECURITY.md Normal file
View File

@ -0,0 +1,15 @@
# Security Policy
## Supported Versions
Only the latest version is supported with security updates.
## Reporting a Vulnerability
Please [contact support](mailto:tamlokveer@gmail.com) **with a proof of concept** that shows the security vulnerability. Please do not contact us without this proof of concept, as we cannot fix anything without this.
For general opinions on what makes an app more or less secure, please use the forum.
## Bounty
We **do not** offer a bounty for discovering vulnerabilities, please do not ask. We can however credit you and link to your website/profile in the changelog and release announcement.

View File

@ -1,15 +0,0 @@
#-------------------------------------------------
#
# Project created by QtCreator 2016-10-01T11:03:59
#
#-------------------------------------------------
TEMPLATE = subdirs
CONFIG += c++11
SUBDIRS = hoedown \
peg-highlight \
src
src.depends = hoedown peg-highlight

View File

@ -1 +0,0 @@
theme: jekyll-theme-cayman

View File

@ -1,66 +0,0 @@
image: Visual Studio 2015
version: 1.4.{build}
branches:
only:
- master
environment:
COMPILER: msvc
VSVER: 14
matrix:
- QT: C:\Qt\5.7\msvc2015_64
PLATFORM: amd64
- QT: C:\Qt\5.7\msvc2015
PLATFORM: x86
clone_depth: 1
# scripts that run after cloning repository
install:
- set PATH=%QT%\bin\;C:\Qt\Tools\QtCreator\bin\;C:\Qt\QtIFW2.0.1\bin\;%PATH%
- git submodule update --init --recursive
# scripts that run before build
before_build:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
# After calling vcvarsall.bat, %PLATFORM% will be X64 or x86
- mkdir build
- cd build
- if "%PLATFORM%" EQU "X64" (qmake -r -spec win32-msvc2015 CONFIG+=x86_64 CONFIG-=debug CONFIG+=release ../VNote.pro)
- if "%PLATFORM%" EQU "x86" (qmake -r -spec win32-msvc2015 CONFIG+=Win32 CONFIG-=debug CONFIG+=release ../VNote.pro)
# custom build scripts
build_script:
- nmake
# scripts that run after build
after_build:
- set vnote_version=1.4
- mkdir distrib\VNote
- windeployqt.exe --dir .\distrib\VNote %APPVEYOR_BUILD_FOLDER%\build\src\release\VNote.exe
- copy "%APPVEYOR_BUILD_FOLDER%\build\src\release\VNote.exe" "distrib\VNote\VNote.exe"
- copy "%APPVEYOR_BUILD_FOLDER%\README.md" "distrib\VNote\README.md"
- copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" "distrib\VNote\LICENSE.txt"
- echo %vnote_version% > "distrib\VNote\version.txt"
- echo %APPVEYOR_REPO_COMMIT% >> "distrib\VNote\version.txt"
- cd distrib
- 7z a VNote_win_%PLATFORM%_portable_%vnote_version%.zip VNote
artifacts:
- path: build\distrib\VNote_win_%PLATFORM%_portable_%vnote_version%.zip
name: portable
deploy:
- provider: BinTray
username: tamlok
api_key:
secure: YJqzsVDlC2NYH2RgzbUMtjZWbSXOdWUiiENOIqImo31hOfeiB0MiVGmBLmKPAHEg
subject: tamlok
repo: vnote
package: vnote
version: 1.4
publish: true
override: true

View File

@ -1,38 +1,256 @@
# Changes History
## v1.4
- Use `_vnote.json` as the config file;
- More user friendly messages;
- Delete notebook by deleting root directories one by one;
- Refactor image preview logics to support previewing all images in edit mode;
- Support constraining the width of previewed images to the edit window;
- bugfix;
# Changes
## v3.19.2
* Codesign MacOS Bundle
* Fix toolbar expansion button style
* Support hot-reloading of theme via --watch-themes option
## v1.3
- Support code block syntax highlight in edit mode;
- A more pleasant AutoIndent and AutoList;
- `Ctrl+<Num>` instead of `Ctrl+Alt+<Num>` to insert title;
- Support custom Markdown CSS styles and editor styles;
## v3.19.1
* Fix toolbar button in Qt 6.8
## v1.2
- Support **MathJax**.
- Fix a crash on macOS.
- Change default font family.
- Refine tab order.
- Better support for HiDPI.
- Support zoom in/out page when reading.
- Introduce **Captain Mode** and **Navigation Mode**.
- A more user friendly popup opened notes list.
- Support jumping to specified tab efficiently by num keys.
- Add shortcuts documentation.
- AutoList and AutoIndent.
## v3.19.0
* Add VSCode-sytle editor shortcuts
## v1.1
- Refine messages and dialogs. Add Chinese translations.
- A new application icon.
- Support install target for Linux.
- Continuous build and deployment for Linux, macOS, and Windows.
- Support both X64 and x86 version of Windows.
- Add `.md` suffix automatically when creating a note.
- A more user friendly insert dialog.
- Support **Mermaid** diagram.
- Add **markdown-it** as the default renderer. Support task list.
## v3.18.1
* Fix crash caused by Qt6 change
* Fix XSS protection exemption
* Check link before open
## v3.18.0
* Upgrade to Qt6
* Support MacOS universal build
* Upgrade Mermaid, Flowchart.js, and markdown-it
* Markdown-it
* Fix XSS protection and turn it on by default
* Support mark by `==xx==`
## v3.17.0
* Quick note: create note in given scheme (@feloxx)
* MarkdownEditor: support inserting multiple images (@feloxx)
* Mermaid: upgrade and fix preview issue (@ygcaicn)
* Flowchart.js: upgrade
## v3.16.0
* Support reading PDF format
* Support Ming Map editor in suffix `*.emind`
* Support "View By" for notebooks selector
* ViewWindow: add shortcut Ctrl+G,V to alternate among view modes
* Bug fixes
## v3.15.1
* Add two themes
* Bug fixes
## v3.15.0
* Editor supports Word Count
* Add Open Windows panel
* Theme: add Vue-light theme
* Support default open mode
* NotebookSelector: support dynamic icons for notebooks
## v3.14.0
* Theme: support custom icons
* Theme: refine icons
* NavigationMode: fix issue for input method
## v3.13.1
* Shortcuts for Copy/Paste/Properties in node explorer
* Global shortcut to call out main window
* UnitedEntry: bug fix for macOS
## v3.13.0
* United Entry: migration of Universal Entry
## v3.12.888
* Fix shortcuts in key sequence with input method (like `Ctrl+G, E`)
* Add line ending settings for config files
* FindAndReplace: fix zero-length search
* QuickAccess: support folders
* Upgrade to Qt 5.15.2
* Support file associations
* NewNoteDialog: remember default file type
## v3.12.0
* NotebookExplorer: support separate node explorer
* Theme: add user-provided VSCode-Dark theme
* MarkdownEditor: use web to highlight code blocks
* MarkdownViewWindow
* Add switch for code block line number
* Fix ParseToMarkdown `<style>` issue
* Add config for overridding MathJax script
* SortDialog: fix sorting issue of date
* FramelessMainWindow: fix StayOnTop issue
## v3.11.0
* Task: support a simple task system (@tootal)
* Theme: add user-provided Solarized-Dark and Solarized-Light themes
* Export: fix wkhtmltopdf table-of-contents translation
* Support equation begin in MathJax
* MainWindow: decide DPI on the screen vnote starts
* Settings: support searching
* Fix crash caused by Youdao Dict
## v3.10.1
* MarkdownEditor: fix view mode issue
* Support print
* Refine icons
## v3.10.0
* MarkdownEditor
* Support side-by-side edit with preview
* Support config for highlighting whitespace
* Tag: fix input method issue on macOS
## v3.9.0
* Remove recycle bin node (now recycle bin is just a simple folder)
* Quick Access: support removing items directly
* MarkdownEditor
* Support centering images in read mode
* Add user.css for user styles in read mode
* Add debugger by F12
* Support context-sensitive context menu for images and links
## v3.8.0
* Support tags
* Introduce notebook database using SQLITE
* A perfect frameless main window on Windows
* Add switch to control whether store history in notebook
* Refine dock widgets of main window
* NotebookExplorer: support scan notebook and import external files
## v3.7.0
* PlantUml/Graphviz: support relative path executable
* macOS: support opening file with VNote in Finder
* Sort notes by name case-insensitively
* Export
* Support All-in-One in PDF format
* Support Custom export format (like Pandoc)
* Allow minimizing the export dialog and doing export at background
* MainWindow: use icon-only bar for docks
* Support update check
* Add shortcuts for CloseOtherTabs and CloseTabsToTheRight
* Search: highlight matched items in opened files
* Editor: support specifying line ending
## v3.6.0
* Support **Image Host**: GitHub and Gitee
* Add config page for Vi
## v3.5.1
* LocationList: fix recently introduced regression when highlighting segments of text
## v3.5.0
* Support History
* ViewArea
* `Ctrl+G, H/J/K/L` to navigate through ViewSplits
* `Ctrl+G, Shift+H/J/K/L` to move ViewWindow across ViewSplits
* MarkdownEditor
* Add configs for in-place preview sources
* Add a tool button to disable in-place preview
* Vi: support align and indent commands `=` and `>`
* LocationList: highlight matched text segments
* SelectDialog: support shortcuts (such as Rich Paste)
## v3.4.0
* Support Snippet
* `Ctrl+G S` to insert a snippet
* `%snippet_name%` to insert a snippet (the legacy Magic Word)
* Snippet is supported in some dialogs (such as creating a new note)
* Support note template (snippet is supported)
* Remove `'` and `"` from auot-brackets
## v3.3.0
* Editor: support auto indent, auto list
* Support opening notes with external programs
* Add a delay after code/math blocks update before preview
## v3.2.0
* Support local PlantUml and Graphviz rendering
* Add shortcuts to tab navigation in ViewSplit
* Editor: support auto bracket and overridding font family
## v3.1.0
* Support Japanese translation (Thanks @miurahr)
* MarkdownEditor: guess image suffix when fetching to local
* Refine read mode styles (Thanks @heartnn)
* Support recovering edit session on start
* Support recovering notebook explorer session on start
* Support Flash Page
* Support Quick Access
* Allow to keep docks (like Outline) when expanding content area
## v3.0.1
* Support spell check via Hunspell
* `Ctrl+Alt+F` to trigger full-text search
* Auto focus to the input widget when activating full-text search
* Fix Expand Content Area with panels
## v3.0.0-beta.11
* Full-text search
## v3.0.0-beta.10
* Show more tips
* Add exclude patterns for external nodes
* Add command line parser and support opening files from command line
* Update Mermaid.js to 8.9.1
* Support exporting current note
* Add ExpandAll to node explorer
## v3.0.0-beta.9
* Fix crash when exporting external files
* Support manual sorting folders and notes
* Support showing external files in notebook
## v3.0.0-beta.8
* Note explorer supports different view orders
* Fix `Ctrl+V` paste in editor
* Fix Linux HTTPS crash bug
* Add button to show/hide recycle bin node
* Other small fixes
## v3.0.0-beta.7
* Support export to Markdown/HTML/PDF
* Support base level 1/2/3 for section number in read mode
* Support opening link to folder in read mode
## v3.0.0-beta.6
* Add theme **pure** for light mode
* Small fixes
## v3.0.0-beta.5
* Refine themes
* Add section number style "1.1" and "1.1.", and use the later as default
* Support indentation of first line of paragraph in read mode
* Add file type combo box in NewNoteDialog
* Add "Insert Mark" in tool bar
* Support **Smart Table**
* Support `*.rmd` as Markdown suffix
* Turn on system title bar by default
* Enable AutoBreak by default
## v3.0.0-beta.4
* Add theme **moonlight** for dark mode
* Add shortcuts for split and workspace
* Bug fix
* More configs in Settings dialog for Markdown viewer
* Support section number in edit mode (without the dot suffix)
* Support link jump in Markdown viewer
* Use socket for single instance guard
## v3.0.0-beta.3
* Support `[TOC]`
* Fix MathJax
* Add shortcut for StayOnTop
* Add Markdown guide and shortcuts guide
* Show hovered link in read mode
* Smart Input Method in Vi mode
* Bug fix in Markdown editor when finding current heading index
* Add custom Info.plist on macOS
* Support minimizing to system tray
* Support restart
* Add read and edit in Markdown ViewWindow
* Add Chinese translations
## v3.0.0-beta.2
* Fix Import Legacy Notebook
* Refine toolbar
* Fix Outline viewer

5
debian/changelog vendored
View File

@ -1,5 +0,0 @@
vnote (1.2-0ubuntu1) xenial; urgency=medium
* Initial release
-- Le Tan <tamlokveer@gmail.com> Sun, 09 Apr 2017 16:32:22 +0800

1
debian/compat vendored
View File

@ -1 +0,0 @@
9

14
debian/control vendored
View File

@ -1,14 +0,0 @@
Source: vnote
Section: editors
Priority: optional
Maintainer: Le Tan <tamlokveer@gmail.com>
Build-Depends: debhelper (>=9), cdbs, qt5-qmake, qtbase5-dev, libqt5svg5-dev, qtdeclarative5-dev, libqt5xmlpatterns5-dev
Standards-Version: 3.9.6
Homepage: https://tamlok.github.io/vnote
#Vcs-Git: git://anonscm.debian.org/collab-maint/vnote.git
Vcs-Browser: https://github.com/tamlok/vnote.git
Package: vnote
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libqt5core5a, libqt5gui5, libqt5sql5, libqt5sql5-sqlite, libqt5widgets5, libqt5qml5, libqt5svg5, libqt5network5, libqt5xml5, libqt5xmlpatterns5, libqt5printsupport5
Description: A Vim-inspired note-taking application, especially for Markdown

7
debian/copyright vendored
View File

@ -1,7 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: vnote
Source: https://tamlok.github.io/vnote
Files: *
Copyright: 2017 Le Tan <tamlokveer@gmail.com>
License: MIT License

28
debian/rules vendored
View File

@ -1,28 +0,0 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
export QT_SELECT=qt5

View File

@ -1 +0,0 @@
3.0 (quilt)

10
debian/vnote.install vendored
View File

@ -1,10 +0,0 @@
src/vnote.desktop usr/share/applications
src/resources/icons/128x128/vnote.png usr/share/pixmaps
src/resources/icons/16x16/vnote.png usr/share/icons/hicolor/16x16/apps
src/resources/icons/32x32/vnote.png usr/share/icons/hicolor/32x32/apps
src/resources/icons/48x48/vnote.png usr/share/icons/hicolor/48x48/apps
src/resources/icons/64x64/vnote.png usr/share/icons/hicolor/64x64/apps
src/resources/icons/128x128/vnote.png usr/share/icons/hicolor/128x128/apps
src/resources/icons/256x256/vnote.png usr/share/icons/hicolor/256x256/apps
src/resources/icons/vnote.svg usr/share/icons/hicolor/scalable/apps
src/VNote usr/bin

@ -1 +0,0 @@
Subproject commit f3c38887a32502ae8eb0e74c6312834243a32e98

2
libs/CMakeLists.txt Normal file
View File

@ -0,0 +1,2 @@
add_subdirectory(QHotkey)
add_subdirectory(vtextedit)

1
libs/QHotkey Submodule

@ -0,0 +1 @@
Subproject commit 8abe0b2280533af57f423f5785acc4d9d4d73ab8

1
libs/vtextedit Submodule

@ -0,0 +1 @@
Subproject commit 50b1421793af3882ddc62ad4e6cf5537e1d7906f

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>

BIN
package/banner_text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

24
package/entitlements.xml Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>

110
package/lgpl-3.0.rtf Normal file
View File

@ -0,0 +1,110 @@
{\rtf1\ansi\deff3\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\fswiss\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}{\f5\froman\fprq0\fcharset128 Helvetica{\*\falt Arial};}{\f6\fnil\fprq2\fcharset0 Droid Sans Fallback;}{\f7\fnil\fprq2\fcharset0 FreeSans;}{\f8\fswiss\fprq0\fcharset128 FreeSans;}}
{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;}
{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033 Normal;}
{\*\cs15\snext15\cf2\ul\ulc0\langfe255\alang255\lang255 Internet Link;}
{\s16\sbasedon0\snext17\sb240\sa120\keepn\dbch\af6\dbch\af7\afs28\loch\f4\fs28 Heading;}
{\s17\sbasedon0\snext17\sl288\slmult1\sb0\sa140 Text Body;}
{\s18\sbasedon17\snext18\sl288\slmult1\sb0\sa140\dbch\af8 List;}
{\s19\sbasedon0\snext19\sb120\sa120\noline\i\dbch\af8\afs24\ai\fs24 Caption;}
{\s20\sbasedon0\snext20\noline\dbch\af8 Index;}
}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern67241986}}\deftab720
\viewscale100
{\*\pgdsctbl
{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default Style;}}
\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pgndec\pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs28\loch\f5
GNU LESSER GENERAL PUBLIC LICENSE}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
Version 3, 29 June 2007}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
Copyright \u169\'3f 2007 Free Software Foundation, Inc. <}{{\field{\*\fldinst HYPERLINK "https://fsf.org/" }{\fldrslt {\cf2\ul\ulc0\langfe255\alang255\lang255\ul\ulc0\rtlch \ltrch\loch\loch\f5
https://fsf.org/}{}}}\rtlch \ltrch\loch\loch\f5
>}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs24\loch\f5
0. Additional Definitions.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
As used herein, \uc2 \u8220\'81\'67this License\u8221\'81\'68 refers to version 3 of the GNU Lesser General Public License, and the \u8220\'81\'67GNU GPL\u8221\'81\'68 refers to version 3 of the GNU General Public License.\uc1 }
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\f5
\uc2 \u8220\'81\'67\uc1 }{\rtlch \ltrch\loch\loch\f5
The Library\uc2 \u8221\'81\'68 refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.\uc1 }
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
An \uc2 \u8220\'81\'67Application\u8221\'81\'68 is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.\uc1 }
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
A \uc2 \u8220\'81\'67Combined Work\u8221\'81\'68 is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \u8220\'81\'67Linked Version\u8221\'81\'68.\uc1 }
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
The \uc2 \u8220\'81\'67Minimal Corresponding Source\u8221\'81\'68 for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.\uc1 }
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
The \uc2 \u8220\'81\'67Corresponding Application Code\u8221\'81\'68 for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.\uc1 }
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs24\loch\f5
1. Exception to Section 3 of the GNU GPL.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs24\loch\f5
2. Conveying Modified Versions.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs24\loch\f5
3. Object Code Incorporating Material from Library Header Files.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab b) Accompany the object code with a copy of the GNU GPL and this license document.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs24\loch\f5
4. Combined Works.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab b) Accompany the Combined Work with a copy of the GNU GPL and this license document.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab d) Do one of the following:}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li720\ri0\lin720\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8211\'3f}{\rtlch \ltrch\loch\loch\f5
\tab 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li720\ri0\lin720\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8211\'3f}{\rtlch \ltrch\loch\loch\f5
\tab 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs24\loch\f5
5. Combined Libraries.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi-360\sb0\sa0{\rtlch \ltrch\loch\f5
\u8226\'3f}{\rtlch \ltrch\loch\loch\f5
\tab b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs24\loch\f5
6. Revised Versions of the GNU Lesser General Public License.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \uc2 \u8220\'81\'67or any later version\u8221\'81\'68 applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.\uc1 }
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.}
\par }

2
package/qt.conf Normal file
View File

@ -0,0 +1,2 @@
[Platforms]
WindowsArguments = fontengine=freetype

BIN
package/wix_banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
package/wix_dialog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,18 +0,0 @@
# PEG-Markdown-Highlight
# Github: https://github.com/ali-rantakari/peg-markdown-highlight
QT -= core gui
TARGET = peg-highlight
TEMPLATE = lib
CONFIG += warn_off
CONFIG += staticlib
SOURCES += pmh_parser.c \
pmh_styleparser.c
HEADERS += pmh_parser.h \
pmh_styleparser.h \
pmh_definitions.h

View File

@ -1,125 +0,0 @@
/* PEG Markdown Highlight
* Copyright 2011-2016 Ali Rantakari -- http://hasseg.org
* Licensed under the GPL2+ and MIT licenses (see LICENSE for more info).
*
* pmh_definitions.h
*/
#ifndef pmh_MARKDOWN_DEFINITIONS
#define pmh_MARKDOWN_DEFINITIONS
/** \file
* \brief Global definitions for the parser.
*/
/**
* \brief Element types.
*
* The first (documented) ones are language element types.
*
* The last (non-documented) ones are utility types used
* by the parser itself.
*
* \sa pmh_element
*/
typedef enum
{
pmh_LINK, /**< Explicit link */
pmh_AUTO_LINK_URL, /**< Implicit URL link */
pmh_AUTO_LINK_EMAIL, /**< Implicit email link */
pmh_IMAGE, /**< Image definition */
pmh_CODE, /**< Code (inline) */
pmh_HTML, /**< HTML */
pmh_HTML_ENTITY, /**< HTML special entity definition */
pmh_EMPH, /**< Emphasized text */
pmh_STRONG, /**< Strong text */
pmh_LIST_BULLET, /**< Bullet for an unordered list item */
pmh_LIST_ENUMERATOR, /**< Enumerator for an ordered list item */
pmh_COMMENT, /**< (HTML) Comment */
// Code assumes that pmh_H1-6 are in order.
pmh_H1, /**< Header, level 1 */
pmh_H2, /**< Header, level 2 */
pmh_H3, /**< Header, level 3 */
pmh_H4, /**< Header, level 4 */
pmh_H5, /**< Header, level 5 */
pmh_H6, /**< Header, level 6 */
pmh_BLOCKQUOTE, /**< Blockquote */
pmh_VERBATIM, /**< Verbatim (e.g. block of code) */
pmh_HTMLBLOCK, /**< Block of HTML */
pmh_HRULE, /**< Horizontal rule */
pmh_REFERENCE, /**< Reference */
pmh_NOTE, /**< Note */
pmh_STRIKE, /**< Strike-through */
// Utility types used by the parser itself:
// List of pmh_RAW element lists, each to be processed separately from
// others (for each element in linked lists of this type, `children` points
// to a linked list of pmh_RAW elements):
pmh_RAW_LIST, /**< Internal to parser. Please ignore. */
// Span marker for positions in original input to be post-processed
// in a second parsing step:
pmh_RAW, /**< Internal to parser. Please ignore. */
// Additional text to be parsed along with spans in the original input
// (these may be added to linked lists of pmh_RAW elements):
pmh_EXTRA_TEXT, /**< Internal to parser. Please ignore. */
// Separates linked lists of pmh_RAW elements into parts to be processed
// separate from each other:
pmh_SEPARATOR, /**< Internal to parser. Please ignore. */
// Placeholder element used while parsing:
pmh_NO_TYPE, /**< Internal to parser. Please ignore. */
// Linked list of *all* elements created while parsing:
pmh_ALL /**< Internal to parser. Please ignore. */
} pmh_element_type;
/**
* \brief Number of types in pmh_element_type.
* \sa pmh_element_type
*/
#define pmh_NUM_TYPES 31
/**
* \brief Number of *language element* types in pmh_element_type.
* \sa pmh_element_type
*/
#define pmh_NUM_LANG_TYPES (pmh_NUM_TYPES - 6)
/**
* \brief A Language element occurrence.
*/
struct pmh_Element
{
pmh_element_type type; /**< \brief Type of element */
unsigned long pos; /**< \brief Unicode code point offset marking the
beginning of this element in the
input. */
unsigned long end; /**< \brief Unicode code point offset marking the
end of this element in the input. */
struct pmh_Element *next; /**< \brief Next element in list */
char *label; /**< \brief Label (for links and references) */
char *address; /**< \brief Address (for links and references) */
};
typedef struct pmh_Element pmh_element;
/**
* \brief Bitfield enumeration of supported Markdown extensions.
*/
enum pmh_extensions
{
pmh_EXT_NONE = 0, /**< No extensions */
pmh_EXT_NOTES = (1 << 0), /**< Footnote syntax:
http://pandoc.org/README.html#footnotes */
pmh_EXT_STRIKE = (1 << 1) /**< Strike-through syntax:
http://pandoc.org/README.html#strikeout */
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,91 +0,0 @@
/* PEG Markdown Highlight
* Copyright 2011-2016 Ali Rantakari -- http://hasseg.org
* Licensed under the GPL2+ and MIT licenses (see LICENSE for more info).
*
* pmh_parser.h
*/
#ifdef Q_CC_GNU
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/** \file
* \brief Parser public interface.
*/
#ifndef __cplusplus
#include <stdbool.h>
#endif
#include <stdlib.h>
#include <assert.h>
#include "pmh_definitions.h"
/**
* \brief Parse Markdown text, return elements
*
* Parses the given Markdown text and returns the results as an
* array of linked lists of elements, indexed by type.
*
* \param[in] text The Markdown text to parse for highlighting.
* \param[in] extensions The extensions to use in parsing (a bitfield
* of pmh_extensions values).
* \param[out] out_result A pmh_element array, indexed by type, containing
* the results of the parsing (linked lists of elements).
* You must pass this to pmh_free_elements() when it's
* not needed anymore.
*
* \sa pmh_element_type
*/
void pmh_markdown_to_elements(char *text, int extensions,
pmh_element **out_result[]);
/**
* \brief Sort elements in list by start offset.
*
* Sorts the linked lists of elements in the list returned by
* pmh_markdown_to_elements() by their start offsets (pos).
*
* \param[in] element_lists Array of linked lists of elements (output
* from pmh_markdown_to_elements()).
*
* \sa pmh_markdown_to_elements
* \sa pmh_element::pos
*/
void pmh_sort_elements_by_pos(pmh_element *element_lists[]);
/**
* \brief Free pmh_element array
*
* Frees an pmh_element array returned by pmh_markdown_to_elements().
*
* \param[in] elems The pmh_element array resulting from calling
* pmh_markdown_to_elements().
*
* \sa pmh_markdown_to_elements
*/
void pmh_free_elements(pmh_element **elems);
/**
* \brief Get element type name
*
* \param[in] type The type value to get the name for.
*
* \return The name of the given type as a null-terminated string.
*
* \sa pmh_element_type
*/
char *pmh_element_name_from_type(pmh_element_type type);
/**
* \brief Get element type from a name
*
* \param[in] name The name of the type.
*
* \return The element type corresponding to the given name.
*
* \sa pmh_element_type
*/
pmh_element_type pmh_element_type_from_name(char *name);

View File

@ -1,932 +0,0 @@
/* PEG Markdown Highlight
* Copyright 2011-2016 Ali Rantakari -- http://hasseg.org
* Licensed under the GPL2+ and MIT licenses (see LICENSE for more info).
*
* styleparser.c
*
* Parser for custom syntax highlighting stylesheets.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include "pmh_styleparser.h"
#include "pmh_parser.h"
#if pmh_DEBUG_OUTPUT
#define pmhsp_PRINTF(x, ...) fprintf(stderr, x, ##__VA_ARGS__)
#else
#define pmhsp_PRINTF(x, ...)
#endif
// vasprintf is not in the C standard nor in POSIX so we provide our own
static int our_vasprintf(char **strptr, const char *fmt, va_list argptr)
{
int ret;
va_list argptr2;
*strptr = NULL;
va_copy(argptr2, argptr);
ret = vsnprintf(NULL, 0, fmt, argptr2);
if (ret <= 0)
return ret;
*strptr = (char *)malloc(ret+1);
if (*strptr == NULL)
return -1;
va_copy(argptr2, argptr);
ret = vsnprintf(*strptr, ret+1, fmt, argptr2);
return ret;
}
// Parsing context data
typedef struct
{
char *input;
void (*error_callback)(char*,int,void*);
void *error_callback_context;
int styles_pos;
pmh_style_collection *styles;
} style_parser_data;
typedef struct raw_attribute
{
char *name;
char *value;
int line_number;
struct raw_attribute *next;
} raw_attribute;
static raw_attribute *new_raw_attribute(char *name, char *value,
int line_number)
{
raw_attribute *v = (raw_attribute *)malloc(sizeof(raw_attribute));
v->name = name;
v->value = value;
v->line_number = line_number;
v->next = NULL;
return v;
}
static void free_raw_attributes(raw_attribute *list)
{
raw_attribute *cur = list;
while (cur != NULL)
{
if (cur->name != NULL) free(cur->name);
if (cur->value != NULL) free(cur->value);
raw_attribute *this = cur;
cur = cur->next;
free(this);
}
}
static void report_error(style_parser_data *p_data,
int line_number, char *str, ...)
{
if (p_data->error_callback == NULL)
return;
va_list argptr;
va_start(argptr, str);
char *errmsg;
our_vasprintf(&errmsg, str, argptr);
va_end(argptr);
p_data->error_callback(errmsg, line_number,
p_data->error_callback_context);
free(errmsg);
}
static char *trim_str(char *str)
{
while (isspace(*str))
str++;
if (*str == '\0')
return str;
char *end = str + strlen(str) - 1;
while (end > str && isspace(*end))
end--;
*(end+1) = '\0';
return str;
}
static char *trim_str_dup(char *str)
{
size_t start = 0;
while (isspace(*(str + start)))
start++;
size_t end = strlen(str) - 1;
while (start < end && isspace(*(str + end)))
end--;
size_t len = end - start + 1;
char *ret = (char *)malloc(sizeof(char)*len + 1);
*ret = '\0';
strncat(ret, (str + start), len);
return ret;
}
static char *strcpy_lower(char *str)
{
char *low = strdup(str);
int i;
int len = strlen(str);
for (i = 0; i < len; i++)
*(low+i) = tolower(*(low+i));
return low;
}
static char *standardize_str(char *str)
{
return strcpy_lower(trim_str(str));
}
static pmh_attr_argb_color *new_argb_color(int r, int g, int b, int a)
{
pmh_attr_argb_color *c = (pmh_attr_argb_color *)
malloc(sizeof(pmh_attr_argb_color));
c->red = r; c->green = g; c->blue = b; c->alpha = a;
return c;
}
static pmh_attr_argb_color *new_argb_from_hex(long long hex, bool has_alpha)
{
// 0xaarrggbb
int a = has_alpha ? ((hex >> 24) & 0xFF) : 255;
int r = ((hex >> 16) & 0xFF);
int g = ((hex >> 8) & 0xFF);
int b = (hex & 0xFF);
return new_argb_color(r,g,b,a);
}
static pmh_attr_argb_color *new_argb_from_hex_str(style_parser_data *p_data,
int attr_line_number,
char *str)
{
// "aarrggbb"
int len = strlen(str);
if (len != 6 && len != 8) {
report_error(p_data, attr_line_number,
"Value '%s' is not a valid color value: it should be a "
"hexadecimal number, 6 or 8 characters long.",
str);
return NULL;
}
char *endptr = NULL;
long long num = strtoll(str, &endptr, 16);
if (*endptr != '\0') {
report_error(p_data, attr_line_number,
"Value '%s' is not a valid color value: the character "
"'%c' is invalid. The color value should be a hexadecimal "
"number, 6 or 8 characters long.",
str, *endptr);
return NULL;
}
return new_argb_from_hex(num, (len == 8));
}
static pmh_attr_value *new_attr_value()
{
return (pmh_attr_value *)malloc(sizeof(pmh_attr_value));
}
static pmh_attr_font_styles *new_font_styles()
{
pmh_attr_font_styles *ret = (pmh_attr_font_styles *)
malloc(sizeof(pmh_attr_font_styles));
ret->italic = false;
ret->bold = false;
ret->underlined = false;
return ret;
}
static pmh_attr_font_size *new_font_size()
{
pmh_attr_font_size *ret = (pmh_attr_font_size *)
malloc(sizeof(pmh_attr_font_size));
ret->is_relative = false;
ret->size_pt = 0;
return ret;
}
static pmh_style_attribute *new_attr(char *name, pmh_attr_type type)
{
pmh_style_attribute *attr = (pmh_style_attribute *)malloc(sizeof(pmh_style_attribute));
attr->name = strdup(name);
attr->type = type;
attr->next = NULL;
return attr;
}
static void free_style_attributes(pmh_style_attribute *list)
{
pmh_style_attribute *cur = list;
while (cur != NULL)
{
if (cur->name != NULL)
free(cur->name);
if (cur->value != NULL)
{
if (cur->type == pmh_attr_type_foreground_color
|| cur->type == pmh_attr_type_background_color
|| cur->type == pmh_attr_type_caret_color
|| cur->type == pmh_attr_type_strike_color)
free(cur->value->argb_color);
else if (cur->type == pmh_attr_type_font_family)
free(cur->value->font_family);
else if (cur->type == pmh_attr_type_font_style)
free(cur->value->font_styles);
else if (cur->type == pmh_attr_type_font_size_pt)
free(cur->value->font_size);
else if (cur->type == pmh_attr_type_other)
free(cur->value->string);
free(cur->value);
}
pmh_style_attribute *this = cur;
cur = cur->next;
free(this);
}
}
#define IF_ATTR_NAME(x) if (strcmp(x, name) == 0)
pmh_attr_type pmh_attr_type_from_name(char *name)
{
IF_ATTR_NAME("color") return pmh_attr_type_foreground_color;
else IF_ATTR_NAME("foreground") return pmh_attr_type_foreground_color;
else IF_ATTR_NAME("foreground-color") return pmh_attr_type_foreground_color;
else IF_ATTR_NAME("background") return pmh_attr_type_background_color;
else IF_ATTR_NAME("background-color") return pmh_attr_type_background_color;
else IF_ATTR_NAME("caret") return pmh_attr_type_caret_color;
else IF_ATTR_NAME("caret-color") return pmh_attr_type_caret_color;
else IF_ATTR_NAME("strike") return pmh_attr_type_strike_color;
else IF_ATTR_NAME("strike-color") return pmh_attr_type_strike_color;
else IF_ATTR_NAME("font-size") return pmh_attr_type_font_size_pt;
else IF_ATTR_NAME("font-family") return pmh_attr_type_font_family;
else IF_ATTR_NAME("font-style") return pmh_attr_type_font_style;
return pmh_attr_type_other;
}
char *pmh_attr_name_from_type(pmh_attr_type type)
{
switch (type)
{
case pmh_attr_type_foreground_color:
return "foreground-color"; break;
case pmh_attr_type_background_color:
return "background-color"; break;
case pmh_attr_type_caret_color:
return "caret-color"; break;
case pmh_attr_type_strike_color:
return "strike-color"; break;
case pmh_attr_type_font_size_pt:
return "font-size"; break;
case pmh_attr_type_font_family:
return "font-family"; break;
case pmh_attr_type_font_style:
return "font-style"; break;
default:
return "unknown";
}
}
typedef struct multi_value
{
char *value;
size_t length;
int line_number;
struct multi_value *next;
} multi_value;
static multi_value *split_multi_value(char *input, char separator)
{
multi_value *head = NULL;
multi_value *tail = NULL;
char *c = input;
while (*c != '\0')
{
size_t i;
for (i = 0; (*(c+i) != '\0' && *(c+i) != separator); i++);
multi_value *mv = (multi_value *)malloc(sizeof(multi_value));
mv->value = (char *)malloc(sizeof(char)*i + 1);
mv->length = i;
mv->line_number = 0;
mv->next = NULL;
*mv->value = '\0';
strncat(mv->value, c, i);
if (head == NULL) {
head = mv;
tail = mv;
} else {
tail->next = mv;
tail = mv;
}
if (*(c+i) == separator)
i++;
c += i;
}
return head;
}
static void free_multi_value(multi_value *val)
{
multi_value *cur = val;
while (cur != NULL)
{
multi_value *this = cur;
multi_value *next_cur = cur->next;
free(this->value);
free(this);
cur = next_cur;
}
}
#define EQUALS(a,b) (strcmp(a, b) == 0)
static pmh_style_attribute *interpret_attributes(style_parser_data *p_data,
pmh_element_type lang_element_type,
raw_attribute *raw_attributes)
{
pmh_style_attribute *attrs = NULL;
raw_attribute *cur = raw_attributes;
while (cur != NULL)
{
pmh_attr_type atype = pmh_attr_type_from_name(cur->name);
pmh_style_attribute *attr = new_attr(cur->name, atype);
attr->lang_element_type = lang_element_type;
attr->value = new_attr_value();
if (atype == pmh_attr_type_foreground_color
|| atype == pmh_attr_type_background_color
|| atype == pmh_attr_type_caret_color
|| atype == pmh_attr_type_strike_color)
{
char *hexstr = trim_str(cur->value);
// new_argb_from_hex_str() reports conversion errors
attr->value->argb_color =
new_argb_from_hex_str(p_data, cur->line_number, hexstr);
if (attr->value->argb_color == NULL) {
free_style_attributes(attr);
attr = NULL;
}
}
else if (atype == pmh_attr_type_font_size_pt)
{
pmh_attr_font_size *fs = new_font_size();
attr->value->font_size = fs;
char *trimmed_value = trim_str_dup(cur->value);
fs->is_relative = (*trimmed_value == '+' || *trimmed_value == '-');
char *endptr = NULL;
fs->size_pt = (int)strtol(cur->value, &endptr, 10);
if (endptr == cur->value) {
report_error(p_data, cur->line_number,
"Value '%s' is invalid for attribute '%s'",
cur->value, cur->name);
free_style_attributes(attr);
attr = NULL;
}
free(trimmed_value);
}
else if (atype == pmh_attr_type_font_family)
{
attr->value->font_family = trim_str_dup(cur->value);
}
else if (atype == pmh_attr_type_font_style)
{
attr->value->font_styles = new_font_styles();
multi_value *values = split_multi_value(cur->value, ',');
multi_value *value_cur = values;
while (value_cur != NULL)
{
char *standardized_value = standardize_str(value_cur->value);
if (EQUALS(standardized_value, "italic"))
attr->value->font_styles->italic = true;
else if (EQUALS(standardized_value, "bold"))
attr->value->font_styles->bold = true;
else if (EQUALS(standardized_value, "underlined"))
attr->value->font_styles->underlined = true;
else {
report_error(p_data, cur->line_number,
"Value '%s' is invalid for attribute '%s'",
standardized_value, cur->name);
}
free(standardized_value);
value_cur = value_cur->next;
}
free_multi_value(values);
}
else if (atype == pmh_attr_type_other)
{
attr->value->string = trim_str_dup(cur->value);
}
if (attr != NULL) {
// add to linked list
attr->next = attrs;
attrs = attr;
}
cur = cur->next;
}
return attrs;
}
static void interpret_and_add_style(style_parser_data *p_data,
char *style_rule_name,
int style_rule_line_number,
raw_attribute *raw_attributes)
{
bool isEditorType = false;
bool isCurrentLineType = false;
bool isSelectionType = false;
pmh_element_type type = pmh_element_type_from_name(style_rule_name);
if (type == pmh_NO_TYPE)
{
if (EQUALS(style_rule_name, "editor"))
isEditorType = true, type = pmh_NO_TYPE;
else if (EQUALS(style_rule_name, "editor-current-line"))
isCurrentLineType = true, type = pmh_NO_TYPE;
else if (EQUALS(style_rule_name, "editor-selection"))
isSelectionType = true, type = pmh_NO_TYPE;
else {
report_error(p_data, style_rule_line_number,
"Style rule '%s' is not a language element type name or "
"one of the following: 'editor', 'editor-current-line', "
"'editor-selection'",
style_rule_name);
return;
}
}
pmh_style_attribute *attrs = interpret_attributes(p_data, type, raw_attributes);
if (isEditorType)
p_data->styles->editor_styles = attrs;
else if (isCurrentLineType)
p_data->styles->editor_current_line_styles = attrs;
else if (isSelectionType)
p_data->styles->editor_selection_styles = attrs;
else
p_data->styles->element_styles[(p_data->styles_pos)++] = attrs;
}
static bool char_is_whitespace(char c)
{
return (c == ' ' || c == '\t');
}
static bool char_begins_linecomment(char c)
{
return (c == '#');
}
static bool line_is_comment(multi_value *line)
{
char *c;
for (c = line->value; *c != '\0'; c++)
{
if (!char_is_whitespace(*c))
return char_begins_linecomment(*c);
}
return false;
}
static bool line_is_empty(multi_value *line)
{
char *c;
for (c = line->value; *c != '\0'; c++)
{
if (!char_is_whitespace(*c))
return false;
}
return true;
}
typedef struct block
{
multi_value *lines;
struct block *next;
} block;
static block *new_block()
{
block *ret = (block *)malloc(sizeof(block));
ret->next = NULL;
ret->lines = NULL;
return ret;
}
static void free_blocks(block *val)
{
block *cur = val;
while (cur != NULL)
{
block *this = cur;
block *next = this->next;
free_multi_value(this->lines);
free(this);
cur = next;
}
}
static block *get_blocks(char *input)
{
block *head = NULL;
block *tail = NULL;
block *current_block = NULL;
multi_value *discarded_lines = NULL;
int line_number_counter = 1;
multi_value *lines = split_multi_value(input, '\n');
multi_value *previous_line = NULL;
multi_value *line_cur = lines;
while (line_cur != NULL)
{
bool discard_line = false;
line_cur->line_number = line_number_counter++;
if (line_is_empty(line_cur))
{
discard_line = true;
if (current_block != NULL)
{
// terminate block
if (tail != current_block)
tail->next = current_block;
tail = current_block;
current_block = NULL;
previous_line->next = NULL;
}
}
else if (line_is_comment(line_cur))
{
// Do not discard (i.e. free()) comment lines within blocks:
if (current_block == NULL)
discard_line = true;
}
else
{
if (current_block == NULL)
{
// start block
current_block = new_block();
current_block->lines = line_cur;
if (previous_line != NULL)
previous_line->next = NULL;
}
if (head == NULL) {
head = current_block;
tail = current_block;
}
}
multi_value *next_cur = line_cur->next;
previous_line = (discard_line) ? NULL : line_cur;
if (discard_line) {
line_cur->next = discarded_lines;
discarded_lines = line_cur;
}
line_cur = next_cur;
}
if (current_block != NULL && tail != current_block)
tail->next = current_block;
free_multi_value(discarded_lines);
return head;
}
#define ASSIGNMENT_OP_UITEXT "':' or '='"
#define IS_ASSIGNMENT_OP(c) ((c) == ':' || (c) == '=')
#define IS_STYLE_RULE_NAME_CHAR(c) \
( (c) != '\0' && !isspace(c) \
&& !char_begins_linecomment(c) && !IS_ASSIGNMENT_OP(c) )
#define IS_ATTRIBUTE_NAME_CHAR(c) \
( (c) != '\0' && !char_begins_linecomment(c) && !IS_ASSIGNMENT_OP(c) )
#define IS_ATTRIBUTE_VALUE_CHAR(c) \
( (c) != '\0' && !char_begins_linecomment(c) )
static char *get_style_rule_name(multi_value *line)
{
char *str = line->value;
// Scan past leading whitespace:
size_t start_index;
for (start_index = 0;
(*(str+start_index) != '\0' && isspace(*(str+start_index)));
start_index++);
// Scan until style rule name characters end:
size_t value_end_index;
for (value_end_index = start_index;
IS_STYLE_RULE_NAME_CHAR(*(str + value_end_index));
value_end_index++);
// Copy style rule name:
size_t value_len = value_end_index - start_index;
char *value = (char *)malloc(sizeof(char)*value_len + 1);
*value = '\0';
strncat(value, (str + start_index), value_len);
return value;
}
static bool parse_attribute_line(style_parser_data *p_data, multi_value *line,
char **out_attr_name, char **out_attr_value)
{
char *str = line->value;
// Scan past leading whitespace:
size_t name_start_index;
for (name_start_index = 0;
( *(str+name_start_index) != '\0' &&
isspace(*(str+name_start_index)) );
name_start_index++);
// Scan until attribute name characters end:
size_t name_end_index;
for (name_end_index = name_start_index;
IS_ATTRIBUTE_NAME_CHAR(*(str + name_end_index));
name_end_index++);
// Scan backwards to trim trailing whitespace off:
while (name_start_index < name_end_index
&& isspace(*(str + name_end_index - 1)))
name_end_index--;
// Scan until just after the first assignment operator:
size_t assignment_end_index;
for (assignment_end_index = name_end_index;
( *(str + assignment_end_index) != '\0' &&
!IS_ASSIGNMENT_OP(*(str + assignment_end_index)) );
assignment_end_index++);
// Scan over the found assignment operator, or report error:
if (IS_ASSIGNMENT_OP(*(str + assignment_end_index)))
assignment_end_index++;
else
{
report_error(p_data, line->line_number,
"Invalid attribute definition: str does not contain "
"an assignment operator (%s): '%s'",
ASSIGNMENT_OP_UITEXT, str);
return false;
}
size_t value_start_index = assignment_end_index;
// Scan until attribute value characters end:
size_t value_end_index;
for (value_end_index = value_start_index;
IS_ATTRIBUTE_VALUE_CHAR(*(str + value_end_index));
value_end_index++);
// Copy attribute name:
size_t name_len = name_end_index - name_start_index;
char *attr_name = (char *)malloc(sizeof(char)*name_len + 1);
*attr_name = '\0';
strncat(attr_name, (str + name_start_index), name_len);
*out_attr_name = attr_name;
// Copy attribute value:
size_t attr_value_len = value_end_index - assignment_end_index;
char *attr_value_str = (char *)malloc(sizeof(char)*attr_value_len + 1);
*attr_value_str = '\0';
strncat(attr_value_str, (str + assignment_end_index), attr_value_len);
*out_attr_value = attr_value_str;
return true;
}
#define HAS_UTF8_BOM(x) ( ((*x & 0xFF) == 0xEF)\
&& ((*(x+1) & 0xFF) == 0xBB)\
&& ((*(x+2) & 0xFF) == 0xBF) )
// - Removes UTF-8 BOM
// - Standardizes line endings to \n
static char *strcpy_preformat_style(char *str)
{
char *new_str = (char *)malloc(sizeof(char) * strlen(str) + 1);
char *c = str;
int i = 0;
if (HAS_UTF8_BOM(c))
c += 3;
while (*c != '\0')
{
if (*c == '\r' && *(c+1) == '\n')
{
*(new_str+i) = '\n';
i++;
c += 2;
}
else if (*c == '\r')
{
*(new_str+i) = '\n';
i++;
c++;
}
else
{
*(new_str+i) = *c;
i++;
c++;
}
}
*(new_str+i) = '\0';
return new_str;
}
static void _sty_parse(style_parser_data *p_data)
{
// We don't have to worry about leaking the original p_data->input;
// the user of the library is responsible for that:
p_data->input = strcpy_preformat_style(p_data->input);
block *blocks = get_blocks(p_data->input);
block *block_cur = blocks;
while (block_cur != NULL)
{
pmhsp_PRINTF("Block:\n");
multi_value *header_line = block_cur->lines;
if (header_line == NULL) {
block_cur = block_cur->next;
continue;
}
pmhsp_PRINTF(" Head line (len %ld): '%s'\n",
header_line->length, header_line->value);
char *style_rule_name = get_style_rule_name(header_line);
pmhsp_PRINTF(" Style rule name: '%s'\n", style_rule_name);
multi_value *attr_line_cur = header_line->next;
if (attr_line_cur == NULL)
report_error(p_data, header_line->line_number,
"No style attributes defined for style rule '%s'",
style_rule_name);
raw_attribute *attributes_head = NULL;
raw_attribute *attributes_tail = NULL;
while (attr_line_cur != NULL)
{
if (line_is_comment(attr_line_cur))
{
attr_line_cur = attr_line_cur->next;
continue;
}
pmhsp_PRINTF(" Attr line (len %ld): '%s'\n",
attr_line_cur->length, attr_line_cur->value);
char *attr_name_str;
char *attr_value_str;
bool success = parse_attribute_line(p_data,
attr_line_cur,
&attr_name_str,
&attr_value_str);
if (success)
{
pmhsp_PRINTF(" Attr: '%s' Value: '%s'\n",
attr_name_str, attr_value_str);
raw_attribute *attribute =
new_raw_attribute(attr_name_str, attr_value_str,
attr_line_cur->line_number);
if (attributes_head == NULL) {
attributes_head = attribute;
attributes_tail = attribute;
} else {
attributes_tail->next = attribute;
attributes_tail = attribute;
}
}
attr_line_cur = attr_line_cur->next;
}
if (attributes_head != NULL)
{
interpret_and_add_style(p_data, style_rule_name,
header_line->line_number, attributes_head);
free_raw_attributes(attributes_head);
}
free(style_rule_name);
block_cur = block_cur->next;
}
free_blocks(blocks);
free(p_data->input);
}
static pmh_style_collection *new_style_collection()
{
pmh_style_collection *sc = (pmh_style_collection *)
malloc(sizeof(pmh_style_collection));
sc->element_styles = (pmh_style_attribute**)
malloc(sizeof(pmh_style_attribute*)
* pmh_NUM_LANG_TYPES);
int i;
for (i = 0; i < pmh_NUM_LANG_TYPES; i++)
sc->element_styles[i] = NULL;
sc->editor_styles = NULL;
sc->editor_current_line_styles = NULL;
sc->editor_selection_styles = NULL;
return sc;
}
void pmh_free_style_collection(pmh_style_collection *coll)
{
free_style_attributes(coll->editor_styles);
free_style_attributes(coll->editor_current_line_styles);
free_style_attributes(coll->editor_selection_styles);
int i;
for (i = 0; i < pmh_NUM_LANG_TYPES; i++)
free_style_attributes(coll->element_styles[i]);
free(coll->element_styles);
free(coll);
}
static style_parser_data *new_style_parser_data(char *input)
{
style_parser_data *p_data = (style_parser_data*)
malloc(sizeof(style_parser_data));
p_data->input = input;
p_data->styles_pos = 0;
p_data->styles = new_style_collection();
return p_data;
}
pmh_style_collection *pmh_parse_styles(char *input,
void(*error_callback)(char*,int,void*),
void *error_callback_context)
{
style_parser_data *p_data = new_style_parser_data(input);
p_data->error_callback = error_callback;
p_data->error_callback_context = error_callback_context;
_sty_parse(p_data);
pmh_style_collection *ret = p_data->styles;
free(p_data);
return ret;
}

View File

@ -1,148 +0,0 @@
/* PEG Markdown Highlight
* Copyright 2011-2016 Ali Rantakari -- http://hasseg.org
* Licensed under the GPL2+ and MIT licenses (see LICENSE for more info).
*
* pmh_styleparser.h
*
* Public interface of a parser for custom syntax highlighting stylesheets.
*/
/** \file
* \brief Style parser public interface.
*/
#include "pmh_definitions.h"
#include <stdbool.h>
/**
* \brief Color (ARGB) attribute value.
*
* All values are 0-255.
*/
typedef struct
{
int red; /**< Red color component (0-255) */
int green; /**< Green color component (0-255) */
int blue; /**< Blue color component (0-255) */
int alpha; /**< Alpha (opacity) color component (0-255) */
} pmh_attr_argb_color;
/** \brief Font style attribute value. */
typedef struct
{
bool italic;
bool bold;
bool underlined;
} pmh_attr_font_styles;
/** \brief Font size attribute value. */
typedef struct
{
int size_pt; /**< The font point size */
bool is_relative; /**< Whether the size is relative (i.e. size_pt points
larger than the default font) */
} pmh_attr_font_size;
/** \brief Style attribute types. */
typedef enum
{
pmh_attr_type_foreground_color, /**< Foreground color */
pmh_attr_type_background_color, /**< Background color */
pmh_attr_type_caret_color, /**< Caret (insertion point) color */
pmh_attr_type_font_size_pt, /**< Font size (in points) */
pmh_attr_type_font_family, /**< Font family */
pmh_attr_type_font_style, /**< Font style */
pmh_attr_type_strike_color, /**< Strike-through color */
pmh_attr_type_other /**< Arbitrary custom attribute */
} pmh_attr_type;
/**
* \brief Style attribute value.
*
* Determine which member to access in this union based on the
* 'type' value of the pmh_style_attribute.
*
* \sa pmh_style_attribute
*/
typedef union
{
pmh_attr_argb_color *argb_color; /**< ARGB color */
pmh_attr_font_styles *font_styles; /**< Font styles */
pmh_attr_font_size *font_size; /**< Font size */
char *font_family; /**< Font family */
char *string; /**< Arbitrary custom string value
(use this if the attribute's type
is pmh_attr_type_other) */
} pmh_attr_value;
/** \brief Style attribute. */
typedef struct pmh_style_attribute
{
pmh_element_type lang_element_type; /**< The Markdown language element this
style applies to */
pmh_attr_type type; /**< The type of the attribute */
char *name; /**< The name of the attribute (if type
is pmh_attr_type_other, you can
use this value to determine what
the attribute is) */
pmh_attr_value *value; /**< The value of the attribute */
struct pmh_style_attribute *next; /**< Next attribute in linked list */
} pmh_style_attribute;
/** \brief Collection of styles. */
typedef struct
{
/** Styles that apply to the editor in general */
pmh_style_attribute *editor_styles;
/** Styles that apply to the line in the editor where the caret (insertion
point) resides */
pmh_style_attribute *editor_current_line_styles;
/** Styles that apply to the range of selected text in the editor */
pmh_style_attribute *editor_selection_styles;
/** Styles that apply to specific Markdown language elements */
pmh_style_attribute **element_styles;
} pmh_style_collection;
/**
* \brief Parse stylesheet string, return style collection
*
* \param[in] input The stylesheet string to parse.
* \param[in] error_callback Callback function to be called when errors
* occur during parsing. The first argument
* to the callback function is the error
* message and the second one the line number
* in the original input where the error
* occurred. The last argument will always
* get the value you pass in for the
* error_callback_context argument to this
* function.
* Pass in NULL to suppress error reporting.
* \param[in] error_callback_context Arbitrary context pointer for the error
* callback function; will be passed in as
* the last argument to error_callback.
*
* \return A pmh_style_collection. You must pass this value to
* pmh_free_style_collection() when it's not needed anymore.
*/
pmh_style_collection *pmh_parse_styles(char *input,
void(*error_callback)(char*,int,void*),
void *error_callback_context);
/**
* \brief Free a pmh_style_collection.
*
* Frees a pmh_style_collection value returned by pmh_parse_styles().
*
* \param[in] collection The collection to free.
*/
void pmh_free_style_collection(pmh_style_collection *collection);
char *pmh_attr_name_from_type(pmh_attr_type type);
pmh_attr_type pmh_attr_type_from_name(char *name);

View File

@ -1,8 +0,0 @@
NONEXISTENT_TYPE
x: 3
STRONG
font-style: funkadelic, bold, snazzy
foreground: 13bx12
background: 5

View File

@ -1,87 +0,0 @@
# Styles using 'Solarized' color scheme
# by Ethan Schoonover: http://ethanschoonover.com/solarized
#
# (dark background version)
editor
foreground: 93a1a1 # base1
background: 002b36 # base03
caret: ffffff
font-size: 13
H1
foreground: 6c71c4 # violet
font-style: bold
font-size: +6
H2
foreground: 6c71c4 # violet
font-style: bold
font-size: +5
H3
foreground: 6c71c4 # violet
font-size: +4
H4
foreground: 268bd2 # blue
font-size: +3
H5
foreground: 268bd2 # blue
font-size: +2
H6
foreground: 268bd2 # blue
font-size: +1
HRULE
foreground: 586e75 # base01
LIST_BULLET
foreground: b58900 # yellow
LIST_ENUMERATOR
foreground: b58900 # yellow
LINK
foreground: 2aa198 # cyan
AUTO_LINK_URL
foreground: 2aa198 # cyan
AUTO_LINK_EMAIL
foreground: 2aa198 # cyan
IMAGE
foreground: d33682 # magenta
REFERENCE
foreground: 80b58900 # yellow, reduced alpha
font-size: -2
CODE
foreground: 859900 # green
EMPH
foreground: cb4b16 # orange
font-style: italic
STRONG
foreground: dc322f # red
font-style: bold
HTML_ENTITY
foreground: 6c71c4 # violet
COMMENT
foreground: 93a1a1 # base1
VERBATIM
foreground: 859900 # green
BLOCKQUOTE
foreground: d33682 # magenta
STRIKE
strike-color: 93a1a1 # base1

View File

@ -1 +0,0 @@
# linecomment editor # comment foreground : 13ff13 background : 000000 # comment # linecomment STRONG: EMPH= # comment foreground: 00ff00 comment asd background: AB0000ff STRONG : dog: 1 # something cat: 4 font-style: underlined, Italic , BoLD #hi, hello font-size: 14pt font-family: Courier New, Times # linecomment BOO x: 3 editor-selection: foreground: abcdef background: abcdef editor-current-line: background: ffffff

View File

@ -1,22 +0,0 @@
editor :
foreground : 13ff13
background : 000000
caret: ffffff
EMPH
font-style: italic
STRONG
font-style: bold
LINK
font-style: underlined
editor-selection:
foreground: ff0000
background: eeeeee
font-style: underlined
editor-current-line:
background: ffffff

View File

@ -1,79 +0,0 @@
# Styles using 'Solarized' color scheme
# by Ethan Schoonover: http://ethanschoonover.com/solarized
#
# (dark background version)
editor
foreground: 93a1a1 # base1
background: 002b36 # base03
caret: ffffff
H1
foreground: 6c71c4 # violet
font-style: bold
H2
foreground: 6c71c4 # violet
font-style: bold
H3
foreground: 6c71c4 # violet
H4
foreground: 268bd2 # blue
H5
foreground: 268bd2 # blue
H6
foreground: 268bd2 # blue
HRULE
foreground: 586e75 # base01
LIST_BULLET
foreground: b58900 # yellow
LIST_ENUMERATOR
foreground: b58900 # yellow
LINK
foreground: 2aa198 # cyan
AUTO_LINK_URL
foreground: 2aa198 # cyan
AUTO_LINK_EMAIL
foreground: 2aa198 # cyan
IMAGE
foreground: d33682 # magenta
REFERENCE
foreground: 80b58900 # yellow, reduced alpha
CODE
foreground: 859900 # green
EMPH
foreground: cb4b16 # orange
font-style: italic
STRONG
foreground: dc322f # red
font-style: bold
HTML_ENTITY
foreground: 6c71c4 # violet
COMMENT
foreground: 93a1a1 # base1
VERBATIM
foreground: 859900 # green
BLOCKQUOTE
foreground: d33682 # magenta
STRIKE
strike-color: 93a1a1 # base1

View File

@ -1,80 +0,0 @@
# Styles using 'Solarized' color scheme
# by Ethan Schoonover: http://ethanschoonover.com/solarized
#
# (light background version)
editor
foreground: 586e75 # base01
background: fdf6e3 # base3
caret: 000000
H1
foreground: 6c71c4 # violet
font-style: bold
H2
foreground: 6c71c4 # violet
font-style: bold
H3
foreground: 6c71c4 # violet
H4
foreground: 268bd2 # blue
H5
foreground: 268bd2 # blue
H6
foreground: 268bd2 # blue
HRULE
foreground: 586e75 # base01
LIST_BULLET
foreground: b58900 # yellow
LIST_ENUMERATOR
foreground: b58900 # yellow
LINK
foreground: 2aa198 # cyan
AUTO_LINK_URL
foreground: 2aa198 # cyan
AUTO_LINK_EMAIL
foreground: 2aa198 # cyan
IMAGE
foreground: d33682 # magenta
REFERENCE
foreground: 80b58900 # yellow, reduced alpha
CODE
foreground: 859900 # green
EMPH
foreground: cb4b16 # orange
font-style: italic
STRONG
foreground: dc322f # red
font-style: bold
HTML_ENTITY
foreground: 6c71c4 # violet
COMMENT
foreground: 93a1a1 # base1
VERBATIM
foreground: 859900 # green
BLOCKQUOTE
foreground: d33682 # magenta
STRIKE
strike-color: 586e75 # base01

View File

@ -1,33 +0,0 @@
# linecomment
editor # comment
foreground : 13ff13
background : 000000 # comment
# linecomment
STRONG:
EMPH=
# comment
foreground: 00ff00
comment asd
background: AB0000ff
STRONG :
dog: 1 # something
cat: 4
font-style: underlined, Italic , BoLD #hi, hello
font-size: 14pt
font-family: Courier New, Times
# linecomment
BOO
x: 3
editor-selection:
foreground: abcdef
background: abcdef
editor-current-line:
background: ffffff

View File

@ -1,33 +0,0 @@
# linecomment
editor # comment
foreground : 13ff13
background : 000000 # comment
# linecomment
STRONG:
EMPH=
# comment
foreground: 00ff00
comment asd
background: AB0000ff
STRONG :
dog: 1 # something
cat: 4
font-style: underlined, Italic , BoLD #hi, hello
font-size: 14pt
font-family: Courier New, Times
# linecomment
BOO
x: 3
editor-selection:
foreground: abcdef
background: abcdef
editor-current-line:
background: ffffff

View File

@ -1,199 +0,0 @@
The Syntax of PEG Markdown Highlight Stylesheets
================================================
[PEG Markdown Highlight][pmh] includes a parser for stylesheets that define how different Markdown language elements are to be highlighted. This document describes the syntax of these stylesheets.
[pmh]: http://hasseg.org/peg-markdown-highlight/
Example
-------
Here is a quick, simple example of a stylesheet:
<style>
.codetable { border-collapse: collapse; }
.codetable .left { text-align: right; padding-right: 10px; }
.codetable .right { text-align: left; padding-left: 10px; }
.codetable .content { font-family: monospace; background: #eee; padding: 0 5px; }
.codetable .comment { color: #174EB3; }
.codetable .rule { color: #491B8F; }
.codetable .attrname { color: #48B317; }
.codetable .attrvalue { color: #A65C1F; }
</style>
<table class="codetable">
<tr>
<td class="left"></td>
<td class="content"># The first comment lines</td>
<td class="right"></td>
</tr>
<tr>
<td class="left"></td>
<td class="content"># describe the stylesheet.</td>
<td class="right"></td>
</tr>
<tr>
<td class="left"></td>
<td class="content">&nbsp;</td>
<td class="right"></td>
</tr>
<tr>
<td class="left"><span class="rule">Style rule &rarr;</span></td>
<td class="content"><span class="rule">editor:</span></td>
<td class="right"></td>
</tr>
<tr>
<td class="left"></td>
<td class="content">&nbsp;&nbsp;foreground: ff0000 <span class="comment"># red text</span></td>
<td class="right"><span class="comment">&larr; Comment</span></td>
</tr>
<tr>
<td class="left"><span class="attrname">Attribute name &rarr;</span></td>
<td class="content">&nbsp;&nbsp;<span class="attrname">font-family</span>: <span class="attrvalue">Consolas</span></td>
<td class="right"><span class="attrvalue">&larr; Attribute value</span></td>
</tr>
<tr>
<td class="left"></td>
<td class="content">&nbsp;</td>
<td class="right"></td>
</tr>
<tr>
<td class="left"></td>
<td class="content">EMPH:</td>
<td class="right"></td>
</tr>
<tr>
<td class="left"></td>
<td class="content">&nbsp;&nbsp;font-size: 14</td>
<td class="right"></td>
</tr>
<tr>
<td class="left"></td>
<td class="content">&nbsp;&nbsp;font-style: bold, underlined</td>
<td class="right"></td>
</tr>
</table>
Style Rules
-----------
A stylesheet is composed of one or more *rules*. Rules are separated from each other by **empty lines** like so:
H2:
foreground: ff0000
H3:
foreground: 00ff00
Each begins with the ***name* of the rule**, which is always on its own line, and may be one of the following:
- **`editor`**: Styles that apply to the whole document/editor
- **`editor-current-line`**: Styles that apply to the current line in the editor (i.e. the line where the caret is)
- **`editor-selection`**: Styles that apply to the selected range in the editor when the user makes a selection in the text
- A Markdown element type (like `EMPH`, `REFERENCE` or `H1`): Styles that apply to occurrences of that particular element. The supported element types are:
- **`LINK`:** Explicit link (like `[click here][ref]`)
- **`AUTO_LINK_URL`:** Implicit URL link (like `<http://google.com>`)
- **`AUTO_LINK_EMAIL`:** Implicit email link (like `<first.last@google.com>`)
- **`IMAGE`:** Image definition
- **`REFERENCE`:** Reference (like `[id]: http://www.google.com`)
- **`CODE`:** Inline code
- **`EMPH`:** Emphasized text
- **`STRONG`:** Strong text
- **`LIST_BULLET`:** Bullet for an unordered list item
- **`LIST_ENUMERATOR`:** Enumerator for an ordered list item
- **`H1`:** Header, level 1
- **`H2`:** Header, level 2
- **`H3`:** Header, level 3
- **`H4`:** Header, level 4
- **`H5`:** Header, level 5
- **`H6`:** Header, level 6
- **`BLOCKQUOTE`:** Blockquote marker
- **`VERBATIM`:** Block of code
- **`HRULE`:** Horizontal rule
- **`HTML`:** HTML tag
- **`HTML_ENTITY`:** HTML special entity definition (like `&hellip;`)
- **`HTMLBLOCK`:** Block of HTML
- **`COMMENT`:** (HTML) Comment
- **`NOTE`:** Note
- **`STRIKE`:** Strike-through
The name may be optionally followed by an assignment operator (either `:` or `=`):
H1:
foreground: ff00ff
H2 =
foreground: ff0000
H3
foreground: 00ff00
The **order of style rules is significant**; it defines the order in which different language elements should be highlighted. *(Of course applications that use PEG Markdown Highlight and the style parser may disregard this and highlight elements in whatever order they desire.)*
After the name of the rule, there can be one or more *attributes*.
Style Attributes
----------------
Attribute assignments are each on their own line, and they consist of the *name* of the attribute as well as the *value* assigned to it. An assignment operator (either `:` or `=`) separates the name from the value:
attribute-name: value
attribute-name= value
Attribute assignment lines **may be indented**.
### Attribute Names and Types
The following is a list of the names of predefined attributes, and the values they may be assigned:
- `foreground-color` *(aliases: `foreground` and `color`)*
- See the *Color Attribute Values* subsection for information about valid values for this attribute.
- `background-color` *(alias: `background`)*
- See the *Color Attribute Values* subsection for information about valid values for this attribute.
- `caret-color` *(alias: `caret`)*
- See the *Color Attribute Values* subsection for information about valid values for this attribute.
- `strike-color` *(alias: `strike`)*
- See the *Color Attribute Values* subsection for information about valid values for this attribute.
- `font-size`
- An integer value for the font size, *in points* (i.e. not in pixels). The number may have a textual suffix such as `pt`.
- If the value begins with `+` or `-`, it is considered *relative* to some base font size (as defined by the host application). For example, the value `3` defines the font size as 3 (absolute) while `+3` defines it as +3 (relative), i.e. 3 point sizes larger than the base font size.
- `font-family`
- A comma-separated list of one or more arbitrary font family names. *(It is up to the application that uses the PEG Markdown Highlight library to resolve this string to actual fonts on the system.)*
- `font-style`
- A comma-separated list of one or more of the following:
- `italic`
- `bold`
- `underlined`
Applications may also include support for any **custom attribute names and values** they desire &mdash; attributes other than the ones listed above will be included in the style parser results, with their values stored as strings.
## Color Attribute Values
Colors can be specified either in **RGB** (red, green, blue) or **ARGB** (alpha, red, green, blue) formats. In both, each component is a two-character hexadecimal value (from `00` to `FF`):
foreground: ff00ee # red = ff, green = 00, blue = ee (and implicitly, alpha = ff)
background: 99ff00ee # alpha = 99, red = ff, green = 00, blue = ee
Comments
--------
Each line in a stylesheet may have a comment. The `#` character begins a line comment that continues until the end of the line:
# this line has only this comment
H1: # this line has a style rule name and then a comment
foreground: ff0000 # this line has an attribute and then a comment

BIN
pics/alipay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
pics/main.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

BIN
pics/main2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

BIN
pics/vnote.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
pics/wechat_pay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

26
privacy_policy.md Normal file
View File

@ -0,0 +1,26 @@
# Privacy Policy
## Introduction
Welcome to VNote! We value your privacy and are committed to protecting your personal information. This Privacy Policy explains how we handle your information when you use our application.
## Information We Collect
VNote does not collect any personal or usage data from its users. Your interactions with the app remain private and are not stored or shared.
## How We Use Your Information
Since VNote does not collect any user data, we do not use, store, or process any personal information.
## Sharing Your Information
As VNote does not collect any user data, we do not share any personal information with third parties.
## Security
While VNote does not collect any user data, we still implement security measures to ensure the integrity and safety of the application itself.
## Your Choices
Since no data is collected, there are no choices or actions required from users regarding their personal information.
## Children's Privacy
Our services are not intended for children under the age of 13. We do not knowingly collect personal information from children under 13.
## Changes to This Privacy Policy
We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on our app. You are advised to review this Privacy Policy periodically for any changes.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

39
scripts/update_version.py Normal file
View File

@ -0,0 +1,39 @@
import fileinput
import sys
import re
if len(sys.argv) < 2:
print("Please provide a new version string!")
exit
newVersion = sys.argv[1]
shortVersion = re.match('^(\\d+\\.\\d+).', newVersion).group(1)
print("New version: {0}".format(newVersion))
# CMakeList
regExp = re.compile('(\\s+)VERSION \\S+')
for line in fileinput.input(['CMakeLists.txt'], inplace = True):
print(regExp.sub('\\1VERSION ' + newVersion, line), end='')
# vnotex.json
regExp = re.compile('(\\s+)"version" : "\\S+"')
for line in fileinput.input(['src/data/core/vnotex.json'], inplace = True):
print(regExp.sub('\\1"version" : "' + newVersion + '"', line), end='')
# ci-xxx.yml
regExp = re.compile('(\\s+)VNOTE_VER: \\S+')
for line in fileinput.input(['.github/workflows/ci-win.yml', '.github/workflows/ci-linux.yml', '.github/workflows/ci-macos.yml'], inplace = True):
print(regExp.sub('\\1VNOTE_VER: ' + newVersion, line), end='')
# Info.plist
regExp = re.compile('(\\s+)<string>(?!10\\.15)\\d+\\.\\d+</string>')
for line in fileinput.input(['src/data/core/Info.plist'], inplace = True):
print(regExp.sub('\\1<string>' + shortVersion + '</string>', line), end='')
regExp = re.compile('(\\s+)<string>\\d+\\.\\d+\\.\\d+</string>')
for line in fileinput.input(['src/data/core/Info.plist'], inplace = True):
print(regExp.sub('\\1<string>' + newVersion + '</string>', line), end='')
regExp = re.compile('(\\s+)<string>\\d+\\.\\d+\\.\\d+\\.\\d+</string>')
for line in fileinput.input(['src/data/core/Info.plist'], inplace = True):
print(regExp.sub('\\1<string>' + newVersion + '.1</string>', line), end='')

179
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,179 @@
cmake_minimum_required(VERSION 3.20)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INSTALL_BINDIR "." CACHE STRING "Binary dir for install")
set(QT_DEFAULT_MAJOR_VERSION 6 CACHE STRING "Qt version to use (5 or 6), defaults to 6")
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} REQUIRED COMPONENTS Core Gui Network PrintSupport Sql Svg Widgets WebChannel WebEngineWidgets LinguistTools)
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} OPTIONAL_COMPONENTS Core5Compat)
if ((QT_DEFAULT_MAJOR_VERSION GREATER 5))
qt_standard_project_setup()
else()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
endif()
# Application icon on Windows
set(VX_APP_ICON_RC_WIN data/core/icons/vnote.rc)
# The MACOSX_BUNDLE_ICON_FILE variable is added to the Info.plist
# generated by CMake. This variable contains the .icns file name,
# without the path.
set(MACOSX_BUNDLE_ICON_FILE vnote.icns)
# And the following tells CMake where to find and install the file itself.
set(VX_APP_ICON_MACOS data/core/icons/vnote.icns)
set_source_files_properties(${VX_APP_ICON_MACOS} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
# Translations
set(VX_TS_FILES data/core/translations/vnote_zh_CN.ts
data/core/translations/vnote_ja.ts)
if((QT_DEFAULT_MAJOR_VERSION EQUAL 6))
if((Qt6Widgets_VERSION VERSION_GREATER_EQUAL 6.7.0))
qt_add_lupdate(TS_FILES ${VX_TS_FILES}
SOURCE_TARGETS vnote)
else()
qt_add_lupdate(vnote TS_FILES ${VX_TS_FILES})
endif()
endif()
# Generate .qm files from .ts files (lrelease)
set_source_files_properties(${VX_TS_FILES} PROPERTIES
OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/translations")
qt_add_translation(VX_QM_FILES ${VX_TS_FILES})
add_custom_target(lrelease DEPENDS ${VX_QM_FILES})
# TODO: VTextEdit translations
list(APPEND VX_QM_FILES
${CMAKE_CURRENT_LIST_DIR}/data/core/translations/qdialogbuttonbox_zh_CN.qm
${CMAKE_CURRENT_LIST_DIR}/data/core/translations/qtbase_ja.qm
${CMAKE_CURRENT_LIST_DIR}/data/core/translations/qtbase_zh_CN.qm
${CMAKE_CURRENT_LIST_DIR}/data/core/translations/qtv_ja.qm
${CMAKE_CURRENT_LIST_DIR}/data/core/translations/qtv_zh_CN.qm
${CMAKE_CURRENT_LIST_DIR}/data/core/translations/qwebengine_zh_CN.qm
)
# Resources
set(VX_RESOURCE_FILES data/core/core.qrc)
set(VX_EXTRA_RESOURCE_FILES_RCC ${CMAKE_CURRENT_BINARY_DIR}/vnote_extra.rcc)
qt_add_binary_resources(VX_EXTRA_RESOURCE data/extra/extra.qrc DESTINATION ${VX_EXTRA_RESOURCE_FILES_RCC} OPTIONS -compress 9)
add_executable(vnote WIN32 MACOSX_BUNDLE
application.cpp application.h
commandlineoptions.cpp commandlineoptions.h
fakeaccessible.cpp fakeaccessible.h
main.cpp
${VX_APP_ICON_RC_WIN} ${VX_APP_ICON_MACOS} ${VX_RESOURCE_FILES}
)
add_dependencies(vnote VX_EXTRA_RESOURCE)
set(VX_LIBS_FOLDER ../libs)
target_include_directories(vnote PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
find_program(GOLD_LINKER "ld.gold")
if (NOT ${GOLD_LINKER} STREQUAL GOLD_LINKER-NOTFOUND)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
endif()
target_compile_definitions(vnote PRIVATE
QT_MESSAGELOGCONTEXT
)
add_subdirectory(core)
add_subdirectory(export)
add_subdirectory(imagehost)
add_subdirectory(search)
add_subdirectory(snippet)
add_subdirectory(task)
add_subdirectory(unitedentry)
add_subdirectory(utils)
add_subdirectory(widgets)
target_link_libraries(vnote PRIVATE
Qt::Core
Qt::Gui
Qt::Network
Qt::PrintSupport
Qt::Sql
Qt::Svg
Qt::WebChannel
Qt::WebEngineWidgets
Qt::Widgets
VTextEdit
qhotkey
)
if((QT_DEFAULT_MAJOR_VERSION GREATER 5))
target_link_libraries(vnote PRIVATE
Qt::Core5Compat
)
endif()
# Copy the qt.conf on Windows
if(WIN32)
add_custom_command(TARGET vnote POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/package/qt.conf" $<TARGET_FILE_DIR:vnote>)
endif()
# Installation
if (WIN32)
install(TARGETS vnote RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES "${PROJECT_SOURCE_DIR}/package/qt.conf" DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${VX_EXTRA_RESOURCE_FILES_RCC} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${VX_QM_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}/translations" OPTIONAL)
elseif(APPLE)
set(CMAKE_MACOSX_RPATH ON)
# TODO: declare install for macOS if necessary. For packing, we will manually copy files into
# the src/vnote.app bundle.
# The generated Info.plist will be overridden.
set_target_properties(vnote
PROPERTIES
OUTPUT_NAME "${PROJECT_NAME}"
MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}"
MACOSX_BUNDLE_INFO_STRING "${PROJECT_DESCRIPTION}"
MACOSX_BUNDLE_GUI_IDENTIFIER "fun.vnote.vnote"
MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "Distributed under LGPL-3.0 license. Copyright (c) 2024 app.vnote.fun"
)
else()
install(TARGETS vnote
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(FILES ${VX_EXTRA_RESOURCE_FILES_RCC} DESTINATION ${CMAKE_INSTALL_DATADIR})
install(FILES ${VX_QM_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/translations" OPTIONAL)
set(desktop.path applications)
set(desktop.files data/core/vnote.desktop)
set(icon16.path icons/hicolor/16x16/apps)
set(icon16.files data/core/logo/16x16/vnote.png)
set(icon32.path icons/hicolor/32x32/apps)
set(icon32.files data/core/logo/32x32/vnote.png)
set(icon48.path icons/hicolor/48x48/apps)
set(icon48.files data/core/logo/48x48/vnote.png)
set(icon64.path icons/hicolor/64x64/apps)
set(icon64.files data/core/logo/64x64/vnote.png)
set(icon128.path icons/hicolor/128x128/apps)
set(icon128.files data/core/logo/128x128/vnote.png)
set(icon256.path icons/hicolor/256x256/apps)
set(icon256.files data/core/logo/256x256/vnote.png)
set(iconsvg.path icons/hicolor/scalable/apps)
set(iconsvg.files data/core/logo/vnote.svg)
foreach(item IN ITEMS desktop icon16 icon32 icon48 icon64 icon128 icon256 iconsvg)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/${${item}.files}
DESTINATION ${CMAKE_INSTALL_DATADIR}/${${item}.path}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
endforeach()
endif()
include(${CMAKE_CURRENT_LIST_DIR}/Packaging.cmake)

View File

@ -0,0 +1,16 @@
message(STATUS "VX_APPIMAGE_DEST_DIR ${VX_APPIMAGE_DEST_DIR}")
message(STATUS "VX_APPIMAGE_DESKTOP_FILE ${VX_APPIMAGE_DESKTOP_FILE}")
execute_process(
COMMAND ${CMAKE_MAKE_PROGRAM} DESTDIR=${VX_APPIMAGE_DEST_DIR} install
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
execute_process(
COMMAND env QMAKE=${QMAKE_EXECUTABLE} LD_LIBRARY_PATH=/usr/local/lib64:$ENV{LD_LIBRARY_PATH} "${LINUXDEPLOY_EXECUTABLE}" --plugin=qt --output=appimage
--appdir=${VX_APPIMAGE_DEST_DIR} -e ${CMAKE_CURRENT_BINARY_DIR}/vnote -d ${VX_APPIMAGE_DESKTOP_FILE}
-i ${CMAKE_CURRENT_LIST_DIR}/data/core/logo/64x64/vnote.png
-l ${QT_PLUGINS_DIR}/platformthemes/libqgtk3.so
-l /usr/local/lib64/libcrypto.so.3
-l /usr/local/lib64/libssl.so.3
# --exclude-library option does not work as expected
# --exclude-library=libssl.so.1.1,libcrypto.so.1.1,libnss3.so,libnssutil3.so
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY})

View File

@ -0,0 +1,6 @@
execute_process(COMMAND "optool" strip -t ${CMAKE_CURRENT_BINARY_DIR}/VNote.app
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
)
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}/VNote.app -always-overwrite -verbose=1
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
)

165
src/Packaging.cmake Normal file
View File

@ -0,0 +1,165 @@
# from: https://github.com/miurahr/cmake-qt-packaging-example
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} REQUIRED COMPONENTS Core)
get_target_property(QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QMAKE_EXECUTABLE}" DIRECTORY)
execute_process(COMMAND ${QMAKE_EXECUTABLE} -query QT_VERSION OUTPUT_VARIABLE QT_VERSION)
set(QT_TOOLS_DIR "${QT_BIN_DIR}/../../../Tools")
cmake_path(NORMAL_PATH QT_TOOLS_DIR OUTPUT_VARIABLE QT_TOOLS_DIR)
set(QT_PLUGINS_DIR "${QT_BIN_DIR}/../plugins")
cmake_path(NORMAL_PATH QT_PLUGINS_DIR OUTPUT_VARIABLE QT_PLUGINS_DIR)
# To use the specific version of Qt
set(WINDEPLOYQT_EXECUTABLE "${QT_BIN_DIR}/windeployqt.exe")
find_program(LINUXDEPLOY_EXECUTABLE linuxdeploy linuxdeploy-x86_64.AppImage HINTS "${QT_BIN_DIR}")
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")
find_program(MACDEPLOYQTFIX_EXECUTABLE macdeployqtfix.py HINTS "${QT_BIN_DIR}")
find_package(Python)
function(windeployqt target)
# Bundle Library Files
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
if ((QT_DEFAULT_MAJOR_VERSION GREATER 5))
if(CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG")
set(WINDEPLOYQT_ARGS --debug)
else()
set(WINDEPLOYQT_ARGS --release)
endif()
endif()
add_custom_target(deploy
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/"
COMMAND "${CMAKE_COMMAND}" -E
env PATH="${QT_BIN_DIR}" "${WINDEPLOYQT_EXECUTABLE}"
${WINDEPLOYQT_ARGS}
--no-quick-import
--no-opengl-sw
--no-compiler-runtime
--translations zh_CN,ja
--dir "${CMAKE_CURRENT_BINARY_DIR}/winqt/"
$<TARGET_FILE:${target}>
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/generic/"
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/styles/"
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/qmltooling/"
COMMENT "Deploying Qt..."
DEPENDS vnote lrelease
)
add_dependencies(pack deploy)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/winqt/" DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
set(OPENSSL_ROOT_DIR "${QT_TOOLS_DIR}/OpenSSL/Win_x64" CACHE STRING "OpenSSL dir")
file(GLOB OPENSSL_LIBS_FILES "${OPENSSL_ROOT_DIR}/bin/lib*.dll")
cmake_path(NORMAL_PATH OPENSSL_LIBS_FILES OUTPUT_VARIABLE OPENSSL_LIBS_FILES)
install(FILES ${OPENSSL_LIBS_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
message(STATUS "OpenSSLExtraLIBDIR:${OPENSSL_EXTRA_LIB_DIR}")
file(GLOB OPENSSL_EXTRA_LIB_FILES "${OPENSSL_EXTRA_LIB_DIR}/lib*.dll")
cmake_path(NORMAL_PATH OPENSSL_EXTRA_LIB_FILES OUTPUT_VARIABLE OPENSSL_EXTRA_LIB_FILES)
message(STATUS "OpenSSLExtraLibFiles:${OPENSSL_EXTRA_LIB_FILES}")
install(FILES ${OPENSSL_EXTRA_LIB_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
endfunction()
set(CPACK_PACKAGE_VENDOR "VNoteX")
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_CONTACT "Le Tan <tamlokveer@gmail.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING.LESSER")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}")
# Start menu entry on Windows
set(CPACK_PACKAGE_EXECUTABLES "vnote" "VNote")
# Desktop link on Windows
set(CPACK_CREATE_DESKTOP_LINKS "vnote")
set(CPACK_STRIP_FILES TRUE)
# WIX generator
set(CPACK_WIX_UPGRADE_GUID BA25F337-991A-4893-9D8A-AD5E89BAF5C4)
set(CPACK_WIX_PRODUCT_GUID BA25F337-991A-4893-9D8A-AD5E89BAF5C4)
set(CPACK_WIX_LICENSE_RTF "${PROJECT_SOURCE_DIR}/package/lgpl-3.0.rtf")
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_LIST_DIR}/data/core/icons/vnote.ico")
set(CPACK_WIX_UI_BANNER "${PROJECT_SOURCE_DIR}/package/wix_banner.png")
set(CPACK_WIX_UI_DIALOG "${PROJECT_SOURCE_DIR}/package/wix_dialog.png")
#------------------------------------------------------------------------------
# include CPack, so we get target for packages
set(CPACK_OUTPUT_CONFIG_FILE "${CMAKE_BINARY_DIR}/BundleConfig.cmake")
add_custom_target(pack
COMMAND ${CMAKE_CPACK_COMMAND} "--config" "${CMAKE_BINARY_DIR}/BundleConfig.cmake" "--verbose"
COMMENT "Running CPACK. Please wait..."
DEPENDS vnote)
add_dependencies(pack lrelease)
set(CPACK_GENERATOR)
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_LIST_DIR}/data/core/logo/64x64/vnote.png")
if(WIN32)
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}" DOC "Path to the windeployqt utility")
list(APPEND CPACK_GENERATOR ZIP)
message(STATUS "Package generation - Windows - Zip")
find_program(WIX_EXECUTABLE wix HINTS "${QT_BIN_DIR}" DOC "Path to the WiX utility")
if (NOT WIX_EXECUTABLE-NOTFOUND)
list(APPEND CPACK_GENERATOR WIX)
message(STATUS "Package generation - Windows - WiX")
endif()
windeployqt(vnote)
elseif(APPLE)
# Manually copy resources.
set(VX_BUNDLE_CONTENTS_DIR $<TARGET_FILE_DIR:vnote>/..)
add_custom_target(deploy
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_LIST_DIR}/data/core/Info.plist" ${VX_BUNDLE_CONTENTS_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${VX_EXTRA_RESOURCE_FILES_RCC} ${VX_BUNDLE_CONTENTS_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E make_directory ${VX_BUNDLE_CONTENTS_DIR}/Resources/translations
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${VX_QM_FILES} ${VX_BUNDLE_CONTENTS_DIR}/Resources/translations
COMMENT "Copying resources into bundle Contents ${VX_BUNDLE_CONTENTS_DIR}"
DEPENDS vnote lrelease
)
add_dependencies(pack deploy)
message(STATUS "MACDeployQtExecutable: ${MACDEPLOYQT_EXECUTABLE}")
if (MACDEPLOYQT_EXECUTABLE)
message(STATUS "Package generation - MacOS - DMG")
list(APPEND CPACK_GENERATOR External)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CPackMacDeployQt.cmake.in "${CMAKE_BINARY_DIR}/CPackExternal.cmake")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_BINARY_DIR}/CPackExternal.cmake")
include(InstallRequiredSystemLibraries)
endif()
else()
message(STATUS "LinuxDeployExecutable: ${LINUXDEPLOY_EXECUTABLE}")
if(LINUXDEPLOY_EXECUTABLE)
message(STATUS "Package generation - Linux - AppImage")
list(APPEND CPACK_GENERATOR External)
set(VX_APPIMAGE_DEST_DIR "${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/Linux/External/AppImage")
set(VX_APPIMAGE_DESKTOP_FILE "${VX_APPIMAGE_DEST_DIR}${CMAKE_INSTALL_PREFIX}/share/applications/vnote.desktop")
configure_file(${CMAKE_CURRENT_LIST_DIR}/CPackLinuxDeployQt.cmake.in "${CMAKE_BINARY_DIR}/CPackExternal.cmake")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_BINARY_DIR}/CPackExternal.cmake")
endif()
endif()
include(CPack)

75
src/application.cpp Normal file
View File

@ -0,0 +1,75 @@
#include "application.h"
#include <QFileOpenEvent>
#include <QDebug>
#include <QDir>
#include <QStyle>
#include <QFileSystemWatcher>
#include <QTimer>
#include <core/vnotex.h>
using namespace vnotex;
Application::Application(int &p_argc, char **p_argv)
: QApplication(p_argc, p_argv)
{
}
void Application::watchThemeFolder(const QString &p_themeFolderPath)
{
if (p_themeFolderPath.isEmpty()) {
return;
}
// Initialize watchers only when needed
if (!m_styleWatcher) {
m_styleWatcher = new QFileSystemWatcher(this);
}
if (!m_reloadTimer) {
m_reloadTimer = new QTimer(this);
m_reloadTimer->setSingleShot(true);
m_reloadTimer->setInterval(500); // 500ms debounce delay
connect(m_reloadTimer, &QTimer::timeout,
this, &Application::reloadThemeResources);
// Connect file watcher to timer
connect(m_styleWatcher, &QFileSystemWatcher::directoryChanged,
m_reloadTimer, qOverload<>(&QTimer::start));
connect(m_styleWatcher, &QFileSystemWatcher::fileChanged,
m_reloadTimer, qOverload<>(&QTimer::start));
}
// Watch the theme folder and its files
m_styleWatcher->addPath(p_themeFolderPath);
// Also watch individual files in the theme folder
QDir themeDir(p_themeFolderPath);
QStringList files = themeDir.entryList(QDir::Files);
for (const QString &file : files) {
m_styleWatcher->addPath(themeDir.filePath(file));
}
}
void Application::reloadThemeResources()
{
VNoteX::getInst().getThemeMgr().refreshCurrentTheme();
auto stylesheet = VNoteX::getInst().getThemeMgr().fetchQtStyleSheet();
if (!stylesheet.isEmpty()) {
setStyleSheet(stylesheet);
style()->unpolish(this);
style()->polish(this);
}
}
bool Application::event(QEvent *p_event)
{
// On macOS, we need this to open file from Finder.
if (p_event->type() == QEvent::FileOpen) {
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(p_event);
qDebug() << "request to open file" << openEvent->file();
emit openFileRequested(openEvent->file());
}
return QApplication::event(p_event);
}

34
src/application.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef APPLICATION_H
#define APPLICATION_H
#include <QApplication>
class QFileSystemWatcher;
class QTimer;
namespace vnotex
{
class Application : public QApplication
{
Q_OBJECT
public:
Application(int &p_argc, char **p_argv);
// Set up theme folder watcher for hot-reload
void watchThemeFolder(const QString &p_themeFolderPath);
// Reload the theme resources (stylesheet, icons, etc)
void reloadThemeResources();
signals:
void openFileRequested(const QString &p_filePath);
protected:
bool event(QEvent *p_event) Q_DECL_OVERRIDE;
private:
QFileSystemWatcher *m_styleWatcher = nullptr;
QTimer *m_reloadTimer = nullptr;
};
}
#endif // APPLICATION_H

View File

@ -0,0 +1,81 @@
#include "commandlineoptions.h"
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QCoreApplication>
#include <QDebug>
#include <widgets/mainwindow.h>
using vnotex::MainWindow;
CommandLineOptions::ParseResult CommandLineOptions::parse(const QStringList &p_arguments)
{
QCommandLineParser parser;
parser.setApplicationDescription(MainWindow::tr("A pleasant note-taking platform."));
const auto helpOpt = parser.addHelpOption();
const auto versionOpt = parser.addVersionOption();
// Positional arguments.
parser.addPositionalArgument("paths", MainWindow::tr("Files or folders to open."));
const QCommandLineOption verboseOpt("verbose", MainWindow::tr("Print more logs."));
parser.addOption(verboseOpt);
const QCommandLineOption logStderrOpt("log-stderr", MainWindow::tr("Log to stderr."));
parser.addOption(logStderrOpt);
const QCommandLineOption watchThemesOpt("watch-themes", MainWindow::tr("Watch theme folder for changes."));
parser.addOption(watchThemesOpt);
// WebEngine options.
// No need to handle them. Just add them to the parser to avoid parse error.
{
QCommandLineOption webRemoteDebuggingPortOpt("remote-debugging-port",
MainWindow::tr("WebEngine remote debugging port."),
MainWindow::tr("port_number"));
webRemoteDebuggingPortOpt.setFlags(QCommandLineOption::HiddenFromHelp);
parser.addOption(webRemoteDebuggingPortOpt);
QCommandLineOption webNoSandboxOpt("no-sandbox", MainWindow::tr("WebEngine without sandbox."));
webNoSandboxOpt.setFlags(QCommandLineOption::HiddenFromHelp);
parser.addOption(webNoSandboxOpt);
QCommandLineOption webDisableGpu("disable-gpu", MainWindow::tr("WebEngine with GPU disabled."));
webDisableGpu.setFlags(QCommandLineOption::HiddenFromHelp);
parser.addOption(webDisableGpu);
}
if (!parser.parse(p_arguments)) {
m_errorMsg = parser.errorText();
return ParseResult::Error;
}
// Handle results.
m_helpText = parser.helpText();
if (parser.isSet(helpOpt)) {
return ParseResult::HelpRequested;
}
if (parser.isSet(versionOpt)) {
return ParseResult::VersionRequested;
}
// Position arguments.
const auto args = parser.positionalArguments();
m_pathsToOpen = args;
if (parser.isSet(verboseOpt)) {
m_verbose = true;
}
if (parser.isSet(logStderrOpt)) {
m_logToStderr = true;
}
if (parser.isSet(watchThemesOpt)) {
m_watchThemes = true;
}
return ParseResult::Ok;
}

35
src/commandlineoptions.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef COMMANDLINEOPTIONS_H
#define COMMANDLINEOPTIONS_H
#include <QStringList>
class CommandLineOptions
{
public:
enum ParseResult
{
Ok,
Error,
VersionRequested,
HelpRequested
};
CommandLineOptions() = default;
ParseResult parse(const QStringList &p_arguments);
QString m_errorMsg;
QString m_helpText;
QStringList m_pathsToOpen;
bool m_verbose = false;
bool m_logToStderr = false;
// Whether to watch theme folder for changes
bool m_watchThemes = false;
};
#endif // COMMANDLINEOPTIONS_H

87
src/core/CMakeLists.txt Normal file
View File

@ -0,0 +1,87 @@
target_sources(vnote PRIVATE
buffer/buffer.cpp buffer/buffer.h
buffer/bufferprovider.cpp buffer/bufferprovider.h
buffer/filebufferprovider.cpp buffer/filebufferprovider.h
buffer/filetypehelper.cpp buffer/filetypehelper.h
buffer/ibufferfactory.h
buffer/markdownbuffer.cpp buffer/markdownbuffer.h
buffer/markdownbufferfactory.cpp buffer/markdownbufferfactory.h
buffer/mindmapbuffer.cpp buffer/mindmapbuffer.h
buffer/mindmapbufferfactory.cpp buffer/mindmapbufferfactory.h
buffer/nodebufferprovider.cpp buffer/nodebufferprovider.h
buffer/pdfbuffer.cpp buffer/pdfbuffer.h
buffer/pdfbufferfactory.cpp buffer/pdfbufferfactory.h
buffer/textbuffer.cpp buffer/textbuffer.h
buffer/textbufferfactory.cpp buffer/textbufferfactory.h
buffer/urlbasedbufferprovider.h
buffermgr.cpp buffermgr.h
clipboarddata.cpp clipboarddata.h
configmgr.cpp configmgr.h
coreconfig.cpp coreconfig.h
editorconfig.cpp editorconfig.h
events.h
exception.h
externalfile.cpp externalfile.h
file.cpp file.h
filelocator.h
fileopenparameters.h
global.cpp global.h
historyitem.cpp historyitem.h
historymgr.cpp historymgr.h
htmltemplatehelper.cpp htmltemplatehelper.h
iconfig.h
location.h
logger.cpp logger.h
mainconfig.cpp mainconfig.h
markdowneditorconfig.cpp markdowneditorconfig.h
mindmapeditorconfig.cpp mindmapeditorconfig.h
namebasedserver.h
noncopyable.h
notebook/bundlenotebook.cpp notebook/bundlenotebook.h
notebook/bundlenotebookfactory.cpp notebook/bundlenotebookfactory.h
notebook/externalnode.cpp notebook/externalnode.h
notebook/historyi.h
notebook/inotebookfactory.h
notebook/node.cpp notebook/node.h
notebook/nodeparameters.cpp notebook/nodeparameters.h
notebook/notebook.cpp notebook/notebook.h
notebook/notebookdatabaseaccess.cpp notebook/notebookdatabaseaccess.h
notebook/notebookparameters.cpp notebook/notebookparameters.h
notebook/notebooktagmgr.cpp notebook/notebooktagmgr.h
notebook/tag.cpp notebook/tag.h
notebook/tagi.h
notebook/vxnode.cpp notebook/vxnode.h
notebook/vxnodefile.cpp notebook/vxnodefile.h
notebookbackend/inotebookbackend.cpp notebookbackend/inotebookbackend.h
notebookbackend/inotebookbackendfactory.h
notebookbackend/localnotebookbackend.cpp notebookbackend/localnotebookbackend.h
notebookbackend/localnotebookbackendfactory.cpp notebookbackend/localnotebookbackendfactory.h
notebookconfigmgr/bundlenotebookconfigmgr.cpp notebookconfigmgr/bundlenotebookconfigmgr.h
notebookconfigmgr/inotebookconfigmgr.cpp notebookconfigmgr/inotebookconfigmgr.h
notebookconfigmgr/inotebookconfigmgrfactory.h
notebookconfigmgr/notebookconfig.cpp notebookconfigmgr/notebookconfig.h
notebookconfigmgr/vxnodeconfig.cpp notebookconfigmgr/vxnodeconfig.h
notebookconfigmgr/vxnotebookconfigmgr.cpp notebookconfigmgr/vxnotebookconfigmgr.h
notebookconfigmgr/vxnotebookconfigmgrfactory.cpp notebookconfigmgr/vxnotebookconfigmgrfactory.h
notebookmgr.cpp notebookmgr.h
pdfviewerconfig.cpp pdfviewerconfig.h
quickaccesshelper.cpp quickaccesshelper.h
sessionconfig.cpp sessionconfig.h
singleinstanceguard.cpp singleinstanceguard.h
templatemgr.cpp templatemgr.h
texteditorconfig.cpp texteditorconfig.h
theme.cpp theme.h
thememgr.cpp thememgr.h
versioncontroller/dummyversioncontroller.cpp versioncontroller/dummyversioncontroller.h
versioncontroller/dummyversioncontrollerfactory.cpp versioncontroller/dummyversioncontrollerfactory.h
versioncontroller/iversioncontroller.h
versioncontroller/iversioncontrollerfactory.h
versioncontroller/versioncontrollerserver.cpp versioncontroller/versioncontrollerserver.h
vnotex.cpp vnotex.h
webresource.h
widgetconfig.cpp widgetconfig.h
)
target_include_directories(vnote PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)

577
src/core/buffer/buffer.cpp Normal file
View File

@ -0,0 +1,577 @@
#include "buffer.h"
#include <QTimer>
#include <notebook/node.h>
#include <utils/fileutils.h>
#include <widgets/viewwindow.h>
#include <utils/pathutils.h>
#include <core/configmgr.h>
#include <core/editorconfig.h>
#include "bufferprovider.h"
#include "exception.h"
using namespace vnotex;
static vnotex::ID generateBufferID()
{
static vnotex::ID id = 0;
return ++id;
}
Buffer::Buffer(const BufferParameters &p_parameters,
QObject *p_parent)
: QObject(p_parent),
m_provider(p_parameters.m_provider),
m_id(generateBufferID()),
m_readOnly(m_provider->isReadOnly())
{
m_autoSaveTimer = new QTimer(this);
m_autoSaveTimer->setSingleShot(true);
m_autoSaveTimer->setInterval(1000);
connect(m_autoSaveTimer, &QTimer::timeout,
this, &Buffer::autoSave);
readContent();
checkBackupFileOfPreviousSession();
}
Buffer::~Buffer()
{
Q_ASSERT(m_attachedViewWindowCount == 0);
Q_ASSERT(!m_viewWindowToSync);
Q_ASSERT(!isModified());
Q_ASSERT(m_backupFilePath.isEmpty());
}
int Buffer::getAttachViewWindowCount() const
{
return m_attachedViewWindowCount;
}
void Buffer::attachViewWindow(ViewWindow *p_win)
{
Q_UNUSED(p_win);
Q_ASSERT(!(m_state & StateFlag::Discarded));
++m_attachedViewWindowCount;
}
void Buffer::detachViewWindow(ViewWindow *p_win)
{
Q_UNUSED(p_win);
Q_ASSERT(p_win != m_viewWindowToSync);
--m_attachedViewWindowCount;
Q_ASSERT(m_attachedViewWindowCount >= 0);
if (m_attachedViewWindowCount == 0) {
emit attachedViewWindowEmpty();
}
}
ViewWindow *Buffer::createViewWindow(const QSharedPointer<FileOpenParameters> &p_paras, QWidget *p_parent)
{
auto window = createViewWindowInternal(p_paras, p_parent);
Q_ASSERT(window);
window->attachToBuffer(this, p_paras);
return window;
}
bool Buffer::match(const Node *p_node) const
{
Q_ASSERT(p_node);
return m_provider->match(p_node);
}
bool Buffer::match(const QString &p_filePath) const
{
return m_provider->match(p_filePath);
}
QString Buffer::getName() const
{
return m_provider->getName();
}
QString Buffer::getPath() const
{
return m_provider->getPath();
}
QString Buffer::getContentPath() const
{
return m_provider->getContentPath();
}
QString Buffer::getResourcePath() const
{
return m_provider->getResourcePath();
}
ID Buffer::getId() const
{
return m_id;
}
const QString &Buffer::getContent() const
{
const_cast<Buffer *>(this)->syncContent();
return m_content;
}
void Buffer::setContent(const QString &p_content, int &p_revision)
{
m_viewWindowToSync = nullptr;
m_content = p_content;
p_revision = ++m_revision;
setModified(true);
m_autoSaveTimer->start();
emit contentsChanged();
}
void Buffer::invalidateContent(const ViewWindow *p_win,
const std::function<void(int)> &p_setRevision)
{
Q_ASSERT(!m_viewWindowToSync || m_viewWindowToSync == p_win);
++m_revision;
p_setRevision(m_revision);
m_viewWindowToSync = p_win;
m_autoSaveTimer->start();
emit contentsChanged();
}
int Buffer::getRevision() const
{
return m_revision;
}
void Buffer::syncContent(const ViewWindow *p_win)
{
if (m_viewWindowToSync == p_win) {
syncContent();
}
}
void Buffer::syncContent()
{
if (m_viewWindowToSync) {
// Need to sync content.
m_content = m_viewWindowToSync->getLatestContent();
m_viewWindowToSync = nullptr;
}
}
bool Buffer::isModified() const
{
return m_modified;
}
void Buffer::setModified(bool p_modified)
{
if (m_modified == p_modified) {
return;
}
m_modified = p_modified;
emit modified(m_modified);
}
bool Buffer::isReadOnly() const
{
return m_readOnly;
}
Buffer::OperationCode Buffer::save(bool p_force)
{
Q_ASSERT(!m_readOnly);
if (m_readOnly) {
return OperationCode::Failed;
}
if (m_modified
|| p_force
|| m_state & (StateFlag::FileMissingOnDisk | StateFlag::FileChangedOutside)) {
syncContent();
// We do not involve user here to handle file missing and changed outside cases.
// The active ViewWindow will check this periodically.
// Check if file still exists.
if (!p_force && !checkFileExistsOnDisk()) {
qWarning() << "failed to save buffer due to file missing on disk" << getPath();
return OperationCode::FileMissingOnDisk;
}
// Check if file is modified outside.
if (!p_force && checkFileChangedOutside()) {
qWarning() << "failed to save buffer due to file changed from outside" << getPath();
return OperationCode::FileChangedOutside;
}
try {
m_provider->write(m_content);
} catch (Exception &p_e) {
qWarning() << "failed to write the buffer content" << getPath() << p_e.what();
return OperationCode::Failed;
}
setModified(false);
m_state &= ~(StateFlag::FileMissingOnDisk | StateFlag::FileChangedOutside);
}
return OperationCode::Success;
}
Buffer::OperationCode Buffer::reload()
{
// Check if file is missing.
if (!checkFileExistsOnDisk()) {
qWarning() << "failed to save buffer due to file missing on disk" << getPath();
return OperationCode::FileMissingOnDisk;
}
if (m_modified
|| m_state & (StateFlag::FileMissingOnDisk | StateFlag::FileChangedOutside)) {
readContent();
emit modified(m_modified);
emit contentsChanged();
}
return OperationCode::Success;
}
void Buffer::readContent()
{
m_content = m_provider->read();
++m_revision;
// Reset state.
m_viewWindowToSync = nullptr;
m_modified = false;
}
void Buffer::discard()
{
Q_ASSERT(!(m_state & StateFlag::Discarded));
Q_ASSERT(m_attachedViewWindowCount == 1);
m_autoSaveTimer->stop();
m_content.clear();
m_state |= StateFlag::Discarded;
++m_revision;
m_viewWindowToSync = nullptr;
m_modified = false;
}
void Buffer::close()
{
// Delete the backup file if exists.
m_autoSaveTimer->stop();
if (!m_backupFilePath.isEmpty()) {
FileUtils::removeFile(m_backupFilePath);
m_backupFilePath.clear();
}
}
QString Buffer::getImageFolderPath() const
{
return const_cast<Buffer *>(this)->m_provider->fetchImageFolderPath();
}
QString Buffer::insertImage(const QString &p_srcImagePath, const QString &p_imageFileName)
{
Q_UNUSED(p_srcImagePath);
Q_UNUSED(p_imageFileName);
Q_ASSERT_X(false, "insertImage", "image insert is not supported");
return QString();
}
QString Buffer::insertImage(const QImage &p_image, const QString &p_imageFileName)
{
Q_UNUSED(p_image);
Q_UNUSED(p_imageFileName);
Q_ASSERT_X(false, "insertImage", "image insert is not supported");
return QString();
}
void Buffer::removeImage(const QString &p_imagePath)
{
Q_UNUSED(p_imagePath);
Q_ASSERT_X(false, "removeImage", "image remove is not supported");
}
void Buffer::autoSave()
{
if (m_readOnly) {
m_autoSaveTimer->stop();
return;
}
if (m_state & (StateFlag::FileMissingOnDisk | StateFlag::FileChangedOutside)) {
qDebug() << "disable AutoSave due to file missing on disk or changed outside";
return;
}
Q_ASSERT(!(m_state & StateFlag::Discarded));
auto policy = ConfigMgr::getInst().getEditorConfig().getAutoSavePolicy();
switch (policy) {
case EditorConfig::AutoSavePolicy::None:
return;
case EditorConfig::AutoSavePolicy::AutoSave:
if (save(false) != OperationCode::Success) {
qWarning() << "AutoSave failed to save buffer, retry later";
} else {
emit autoSaved();
}
break;
case EditorConfig::AutoSavePolicy::BackupFile:
try {
writeBackupFile();
} catch (Exception &p_e) {
qWarning() << "AutoSave failed to write backup file, retry later" << p_e.what();
}
break;
}
}
void Buffer::writeBackupFile()
{
if (m_backupFilePath.isEmpty()) {
const auto &config = ConfigMgr::getInst().getEditorConfig();
QString backupDirPath(QDir(getResourcePath()).filePath(config.getBackupFileDirectory()));
backupDirPath = QDir::cleanPath(backupDirPath);
auto backupFileName = FileUtils::generateFileNameWithSequence(backupDirPath,
getName(),
config.getBackupFileExtension());
QDir backupDir(backupDirPath);
backupDir.mkpath(backupDirPath);
m_backupFilePath = backupDir.filePath(backupFileName);
}
Q_ASSERT(m_backupFilePathOfPreviousSession.isEmpty());
// Just use FileUtils instead of notebook backend.
FileUtils::writeFile(m_backupFilePath, generateBackupFileHead() + getContent());
}
QString Buffer::generateBackupFileHead() const
{
return QStringLiteral("vnotex_backup_file %1|").arg(getContentPath());
}
void Buffer::checkBackupFileOfPreviousSession()
{
const auto &config = ConfigMgr::getInst().getEditorConfig();
if (config.getAutoSavePolicy() != EditorConfig::AutoSavePolicy::BackupFile) {
return;
}
QString backupDirPath(QDir(getResourcePath()).filePath(config.getBackupFileDirectory()));
backupDirPath = QDir::cleanPath(backupDirPath);
QDir backupDir(backupDirPath);
QStringList backupFiles;
{
const QString nameFilter = QStringLiteral("%1*%2").arg(getName(), config.getBackupFileExtension());
backupFiles = backupDir.entryList(QStringList(nameFilter),
QDir::Files | QDir::Hidden | QDir::NoSymLinks | QDir::NoDotAndDotDot);
}
if (backupFiles.isEmpty()) {
return;
}
for (const auto &file : backupFiles) {
const auto filePath = backupDir.filePath(file);
if (isBackupFileOfBuffer(filePath)) {
const auto backupContent = readBackupFile(filePath);
if (backupContent == getContent()) {
// Found backup file with identical content.
// Just discard the backup file.
FileUtils::removeFile(filePath);
qInfo() << "delete identical backup file of previous session" << filePath;
} else {
m_backupFilePathOfPreviousSession = filePath;
qInfo() << "found backup file of previous session" << filePath;
}
break;
}
}
}
bool Buffer::isBackupFileOfBuffer(const QString &p_file) const
{
QFile file(p_file);
if (!file.open(QFile::ReadOnly | QIODevice::Text)) {
return false;
}
QTextStream st(&file);
const auto head = st.readLine();
return head.startsWith(generateBackupFileHead());
}
const QString &Buffer::getBackupFileOfPreviousSession() const
{
return m_backupFilePathOfPreviousSession;
}
QString Buffer::readBackupFile(const QString &p_filePath)
{
auto content = FileUtils::readTextFile(p_filePath);
return content.mid(content.indexOf(QLatin1Char('|')) + 1);
}
void Buffer::discardBackupFileOfPreviousSession()
{
Q_ASSERT(!m_backupFilePathOfPreviousSession.isEmpty());
FileUtils::removeFile(m_backupFilePathOfPreviousSession);
qInfo() << "discard backup file of previous session" << m_backupFilePathOfPreviousSession;
m_backupFilePathOfPreviousSession.clear();
}
void Buffer::recoverFromBackupFileOfPreviousSession()
{
Q_ASSERT(!m_backupFilePathOfPreviousSession.isEmpty());
m_content = readBackupFile(m_backupFilePathOfPreviousSession);
m_provider->write(m_content);
++m_revision;
FileUtils::removeFile(m_backupFilePathOfPreviousSession);
qInfo() << "recover from backup file of previous session" << m_backupFilePathOfPreviousSession;
m_backupFilePathOfPreviousSession.clear();
// Reset state.
m_viewWindowToSync = nullptr;
m_modified = false;
emit modified(m_modified);
emit contentsChanged();
}
bool Buffer::isChildOf(const Node *p_node) const
{
return m_provider->isChildOf(p_node);
}
bool Buffer::isAttachmentSupported() const
{
return !m_readOnly && m_provider->isAttachmentSupported();
}
bool Buffer::hasAttachment() const
{
if (!isAttachmentSupported()) {
return false;
}
if (m_provider->getAttachmentFolder().isEmpty()) {
return false;
}
QDir dir(getAttachmentFolderPath());
return !dir.isEmpty();
}
QString Buffer::getAttachmentFolderPath() const
{
Q_ASSERT(isAttachmentSupported());
return const_cast<Buffer *>(this)->m_provider->fetchAttachmentFolderPath();
}
QStringList Buffer::addAttachment(const QString &p_destFolderPath, const QStringList &p_files)
{
if (p_files.isEmpty()) {
return QStringList();
}
auto destFolderPath = p_destFolderPath.isEmpty() ? getAttachmentFolderPath() : p_destFolderPath;
Q_ASSERT(PathUtils::pathContains(getAttachmentFolderPath(), destFolderPath));
auto files = m_provider->addAttachment(destFolderPath, p_files);
if (!files.isEmpty()) {
emit attachmentChanged();
}
return files;
}
QString Buffer::newAttachmentFile(const QString &p_destFolderPath, const QString &p_name)
{
Q_ASSERT(PathUtils::pathContains(getAttachmentFolderPath(), p_destFolderPath));
auto filePath = m_provider->newAttachmentFile(p_destFolderPath, p_name);
emit attachmentChanged();
return filePath;
}
QString Buffer::newAttachmentFolder(const QString &p_destFolderPath, const QString &p_name)
{
Q_ASSERT(PathUtils::pathContains(getAttachmentFolderPath(), p_destFolderPath));
auto folderPath = m_provider->newAttachmentFolder(p_destFolderPath, p_name);
emit attachmentChanged();
return folderPath;
}
QString Buffer::renameAttachment(const QString &p_path, const QString &p_name)
{
Q_ASSERT(PathUtils::pathContains(getAttachmentFolderPath(), p_path));
return m_provider->renameAttachment(p_path, p_name);
}
void Buffer::removeAttachment(const QStringList &p_paths)
{
m_provider->removeAttachment(p_paths);
emit attachmentChanged();
}
bool Buffer::isAttachment(const QString &p_path) const
{
return PathUtils::pathContains(getAttachmentFolderPath(), p_path);
}
bool Buffer::isTagSupported() const
{
return m_provider->isTagSupported();
}
Buffer::ProviderType Buffer::getProviderType() const
{
return m_provider->getType();
}
Node *Buffer::getNode() const
{
return m_provider->getNode();
}
bool Buffer::checkFileExistsOnDisk()
{
if (m_provider->checkFileExistsOnDisk()) {
m_state &= ~StateFlag::FileMissingOnDisk;
return true;
} else {
m_state |= StateFlag::FileMissingOnDisk;
return false;
}
}
bool Buffer::checkFileChangedOutside()
{
if (m_provider->checkFileChangedOutside()) {
m_state |= StateFlag::FileChangedOutside;
return true;
} else {
m_state &= ~StateFlag::FileChangedOutside;
return false;
}
}
Buffer::StateFlags Buffer::state() const
{
return m_state;
}
QSharedPointer<File> Buffer::getFile() const
{
return m_provider->getFile();
}

250
src/core/buffer/buffer.h Normal file
View File

@ -0,0 +1,250 @@
#ifndef BUFFER_H
#define BUFFER_H
#include <QObject>
#include <QSharedPointer>
#include <functional>
#include <global.h>
class QWidget;
class QTimer;
namespace vnotex
{
class Node;
class Buffer;
class ViewWindow;
struct FileOpenParameters;
class BufferProvider;
class File;
struct BufferParameters
{
QSharedPointer<BufferProvider> m_provider;
};
class Buffer : public QObject
{
Q_OBJECT
public:
enum class ProviderType
{
Internal,
External
};
enum class OperationCode
{
Success,
FileMissingOnDisk,
FileChangedOutside,
Failed
};
enum StateFlag
{
Normal = 0,
FileMissingOnDisk = 0x1,
FileChangedOutside = 0x2,
Discarded = 0x4
};
Q_DECLARE_FLAGS(StateFlags, StateFlag);
Buffer(const BufferParameters &p_parameters,
QObject *p_parent = nullptr);
virtual ~Buffer();
int getAttachViewWindowCount() const;
void attachViewWindow(ViewWindow *p_win);
void detachViewWindow(ViewWindow *p_win);
// Create a view window to show the content of this buffer.
// Attach the created view window to this buffer.
ViewWindow *createViewWindow(const QSharedPointer<FileOpenParameters> &p_paras, QWidget *p_parent);
// Whether this buffer matches @p_node.
bool match(const Node *p_node) const;
// Whether this buffer matches @p_filePath.
bool match(const QString &p_filePath) const;
// Buffer name.
QString getName() const;
QString getPath() const;
// In some cases, getPath() may point to a container containting all the stuffs.
// getContentPath() will return the real path to the file providing the content.
QString getContentPath() const;
// Get the base path to resolve resources.
QString getResourcePath() const;
// Return nullptr if not available.
QSharedPointer<File> getFile() const;
ID getId() const;
// Get buffer content.
// It may differ from the content on disk.
// For performance, we need to sync the content with ViewWindow before returning
// the latest content.
const QString &getContent() const;
// @p_revision will be set before contentsChanged is emitted.
void setContent(const QString &p_content, int &p_revision);
// Invalidate the content of buffer.
// Need to sync with @p_win to get the latest content.
// @p_setRevision will be called to set revision before contentsChanged is emitted.
void invalidateContent(const ViewWindow *p_win,
const std::function<void(int)> &p_setRevision);
// Sync content with @p_win if @p_win is the window needed to sync.
void syncContent(const ViewWindow *p_win);
int getRevision() const;
bool isModified() const;
void setModified(bool p_modified);
bool isReadOnly() const;
// Save buffer content to file.
OperationCode save(bool p_force);
// Discard changes and reload file.
OperationCode reload();
// Discard the buffer which will invalidate the buffer.
void discard();
// Buffer is about to be deleted.
void close();
// Insert image from @p_srcImagePath.
// Return inserted image file path.
virtual QString insertImage(const QString &p_srcImagePath, const QString &p_imageFileName);
virtual QString insertImage(const QImage &p_image, const QString &p_imageFileName);
virtual void removeImage(const QString &p_imagePath);
const QString &getBackupFileOfPreviousSession() const;
void discardBackupFileOfPreviousSession();
void recoverFromBackupFileOfPreviousSession();
// Whether this buffer's provider is a child of @p_node or an attachment of @p_node.
bool isChildOf(const Node *p_node) const;
Node *getNode() const;
bool isAttachmentSupported() const;
bool hasAttachment() const;
QString getAttachmentFolderPath() const;
// @p_destFolderPath: folder path locating in attachment folder. Use the root folder if empty.
QStringList addAttachment(const QString &p_destFolderPath, const QStringList &p_files);
QString newAttachmentFile(const QString &p_destFolderPath, const QString &p_name);
QString newAttachmentFolder(const QString &p_destFolderPath, const QString &p_name);
QString renameAttachment(const QString &p_path, const QString &p_name);
void removeAttachment(const QStringList &p_paths);
// Judge whether file @p_path is attachment.
bool isAttachment(const QString &p_path) const;
bool isTagSupported() const;
ProviderType getProviderType() const;
bool checkFileExistsOnDisk();
bool checkFileChangedOutside();
StateFlags state() const;
static QString readBackupFile(const QString &p_filePath);
signals:
void attachedViewWindowEmpty();
void modified(bool p_modified);
void contentsChanged();
void nameChanged();
void attachmentChanged();
// This buffer is AutoSavePolicy::AutoSave.
void autoSaved();
protected:
virtual ViewWindow *createViewWindowInternal(const QSharedPointer<FileOpenParameters> &p_paras, QWidget *p_parent) = 0;
QSharedPointer<BufferProvider> m_provider;
private slots:
void autoSave();
private:
void syncContent();
void readContent();
// Get the path of the image folder.
QString getImageFolderPath() const;
void writeBackupFile();
// Generate backup file head.
QString generateBackupFileHead() const;
void checkBackupFileOfPreviousSession();
bool isBackupFileOfBuffer(const QString &p_file) const;
// Will be assigned uniquely once created.
const ID m_id = 0;
// Revision of contents.
int m_revision = 0;
// If the buffer is modified, m_content reflect the latest changes instead
// of the file content.
QString m_content;
bool m_readOnly = false;
bool m_modified = false;
int m_attachedViewWindowCount = 0;
const ViewWindow *m_viewWindowToSync = nullptr;
// Managed by QObject.
QTimer *m_autoSaveTimer = nullptr;
QString m_backupFilePath;
QString m_backupFilePathOfPreviousSession;
StateFlags m_state = StateFlag::Normal;
};
} // ns vnotex
Q_DECLARE_OPERATORS_FOR_FLAGS(vnotex::Buffer::StateFlags)
#endif // BUFFER_H

View File

@ -0,0 +1,25 @@
#include "bufferprovider.h"
#include <QFileInfo>
using namespace vnotex;
bool BufferProvider::checkFileExistsOnDisk() const
{
return QFileInfo::exists(getContentPath());
}
QDateTime BufferProvider::getLastModifiedFromFile() const
{
return QFileInfo(getContentPath()).lastModified();
}
bool BufferProvider::checkFileChangedOutside() const
{
// TODO: support non-local URLs.
QFileInfo info(getContentPath());
if (!info.exists() || m_lastModified != info.lastModified()) {
return true;
}
return false;
}

View File

@ -0,0 +1,89 @@
#ifndef BUFFERPROVIDER_H
#define BUFFERPROVIDER_H
#include <QObject>
#include <QDateTime>
#include "buffer.h"
namespace vnotex
{
class Node;
// Content provider for Buffer.
class BufferProvider : public QObject
{
Q_OBJECT
public:
BufferProvider(QObject *p_parent = nullptr)
: QObject(p_parent)
{
}
virtual ~BufferProvider() {}
virtual Buffer::ProviderType getType() const = 0;
virtual bool match(const Node *p_node) const = 0;
virtual bool match(const QString &p_filePath) const = 0;
virtual QString getName() const = 0;
virtual QString getPath() const = 0;
virtual QString getContentPath() const = 0;
virtual QString getResourcePath() const = 0;
virtual void write(const QString &p_content) = 0;
virtual QString read() const = 0;
virtual QString fetchImageFolderPath() = 0;
virtual bool isChildOf(const Node *p_node) const = 0;
virtual Node *getNode() const = 0;
virtual QString getAttachmentFolder() const = 0;
virtual QString fetchAttachmentFolderPath() = 0;
virtual QStringList addAttachment(const QString &p_destFolderPath, const QStringList &p_files) = 0;
virtual QString newAttachmentFile(const QString &p_destFolderPath, const QString &p_name) = 0;
virtual QString newAttachmentFolder(const QString &p_destFolderPath, const QString &p_name) = 0;
virtual QString renameAttachment(const QString &p_path, const QString &p_name) = 0;
virtual void removeAttachment(const QStringList &p_paths) = 0;
virtual QString insertImage(const QString &p_srcImagePath, const QString &p_imageFileName) = 0;
virtual QString insertImage(const QImage &p_image, const QString &p_imageFileName) = 0;
virtual void removeImage(const QString &p_imagePath) = 0;
virtual bool isAttachmentSupported() const = 0;
virtual bool isTagSupported() const = 0;
virtual bool checkFileExistsOnDisk() const;
virtual bool checkFileChangedOutside() const;
virtual bool isReadOnly() const = 0;
// Return nullptr if not available.
virtual QSharedPointer<File> getFile() const = 0;
protected:
virtual QDateTime getLastModifiedFromFile() const;
QDateTime m_lastModified;
};
}
#endif // BUFFERPROVIDER_H

View File

@ -0,0 +1,195 @@
#include "filebufferprovider.h"
#include <QFileInfo>
#include <utils/pathutils.h>
#include <utils/fileutils.h>
#include <notebook/node.h>
#include <core/file.h>
#include <core/exception.h>
using namespace vnotex;
FileBufferProvider::FileBufferProvider(const QSharedPointer<File> &p_file,
Node *p_nodeAttachedTo,
bool p_readOnly,
QObject *p_parent)
: BufferProvider(p_parent),
m_file(p_file),
c_nodeAttachedTo(p_nodeAttachedTo),
m_readOnly(p_readOnly)
{
}
Buffer::ProviderType FileBufferProvider::getType() const
{
return Buffer::ProviderType::External;
}
bool FileBufferProvider::match(const Node *p_node) const
{
Q_UNUSED(p_node);
return false;
}
bool FileBufferProvider::match(const QString &p_filePath) const
{
return PathUtils::areSamePaths(m_file->getFilePath(), p_filePath);
}
QString FileBufferProvider::getName() const
{
return m_file->getName();
}
QString FileBufferProvider::getPath() const
{
return m_file->getFilePath();
}
QString FileBufferProvider::getContentPath() const
{
return m_file->getContentPath();
}
QString FileBufferProvider::getResourcePath() const
{
return m_file->getResourcePath();
}
void FileBufferProvider::write(const QString &p_content)
{
m_file->write(p_content);
m_lastModified = getLastModifiedFromFile();
}
QString FileBufferProvider::read() const
{
const_cast<FileBufferProvider *>(this)->m_lastModified = getLastModifiedFromFile();
return m_file->read();
}
QString FileBufferProvider::fetchImageFolderPath()
{
auto file = m_file->getImageInterface();
if (file) {
return file->fetchImageFolderPath();
} else {
return QString();
}
}
bool FileBufferProvider::isChildOf(const Node *p_node) const
{
if (c_nodeAttachedTo) {
return c_nodeAttachedTo == p_node || Node::isAncestor(p_node, c_nodeAttachedTo);
}
return false;
}
QString FileBufferProvider::getAttachmentFolder() const
{
Q_ASSERT(false);
return QString();
}
QString FileBufferProvider::fetchAttachmentFolderPath()
{
Q_ASSERT(false);
return QString();
}
QStringList FileBufferProvider::addAttachment(const QString &p_destFolderPath, const QStringList &p_files)
{
Q_UNUSED(p_destFolderPath);
Q_UNUSED(p_files);
Q_ASSERT(false);
return QStringList();
}
QString FileBufferProvider::newAttachmentFile(const QString &p_destFolderPath, const QString &p_name)
{
Q_UNUSED(p_destFolderPath);
Q_UNUSED(p_name);
Q_ASSERT(false);
return QString();
}
QString FileBufferProvider::newAttachmentFolder(const QString &p_destFolderPath, const QString &p_name)
{
Q_UNUSED(p_destFolderPath);
Q_UNUSED(p_name);
Q_ASSERT(false);
return QString();
}
QString FileBufferProvider::renameAttachment(const QString &p_path, const QString &p_name)
{
Q_UNUSED(p_path);
Q_UNUSED(p_name);
Q_ASSERT(false);
return QString();
}
void FileBufferProvider::removeAttachment(const QStringList &p_paths)
{
Q_UNUSED(p_paths);
Q_ASSERT(false);
}
QString FileBufferProvider::insertImage(const QString &p_srcImagePath, const QString &p_imageFileName)
{
auto file = m_file->getImageInterface();
if (file) {
return file->insertImage(p_srcImagePath, p_imageFileName);
} else {
return QString();
}
}
QString FileBufferProvider::insertImage(const QImage &p_image, const QString &p_imageFileName)
{
auto file = m_file->getImageInterface();
if (file) {
return file->insertImage(p_image, p_imageFileName);
} else {
return QString();
}
}
void FileBufferProvider::removeImage(const QString &p_imagePath)
{
auto file = m_file->getImageInterface();
if (file) {
try {
file->removeImage(p_imagePath);
} catch (Exception &e) {
qWarning() << "failed to remove image" << p_imagePath << e.what();
}
}
}
bool FileBufferProvider::isAttachmentSupported() const
{
return false;
}
bool FileBufferProvider::isTagSupported() const
{
return false;
}
Node *FileBufferProvider::getNode() const
{
return c_nodeAttachedTo;
}
bool FileBufferProvider::isReadOnly() const
{
return m_readOnly;
}
QSharedPointer<File> FileBufferProvider::getFile() const
{
return m_file;
}

View File

@ -0,0 +1,81 @@
#ifndef FILEBUFFERPROVIDER_H
#define FILEBUFFERPROVIDER_H
#include "bufferprovider.h"
namespace vnotex
{
class File;
// Buffer provider based on external file.
class FileBufferProvider : public BufferProvider
{
Q_OBJECT
public:
FileBufferProvider(const QSharedPointer<File> &m_file,
Node *p_nodeAttachedTo,
bool p_readOnly,
QObject *p_parent = nullptr);
Buffer::ProviderType getType() const Q_DECL_OVERRIDE;
bool match(const Node *p_node) const Q_DECL_OVERRIDE;
bool match(const QString &p_filePath) const Q_DECL_OVERRIDE;
QString getName() const Q_DECL_OVERRIDE;
QString getPath() const Q_DECL_OVERRIDE;
QString getContentPath() const Q_DECL_OVERRIDE;
QString getResourcePath() const Q_DECL_OVERRIDE;
void write(const QString &p_content) Q_DECL_OVERRIDE;
QString read() const Q_DECL_OVERRIDE;
QString fetchImageFolderPath() Q_DECL_OVERRIDE;
bool isChildOf(const Node *p_node) const Q_DECL_OVERRIDE;
Node *getNode() const Q_DECL_OVERRIDE;
QString getAttachmentFolder() const Q_DECL_OVERRIDE;
QString fetchAttachmentFolderPath() Q_DECL_OVERRIDE;
QStringList addAttachment(const QString &p_destFolderPath, const QStringList &p_files) Q_DECL_OVERRIDE;
QString newAttachmentFile(const QString &p_destFolderPath, const QString &p_name) Q_DECL_OVERRIDE;
QString newAttachmentFolder(const QString &p_destFolderPath, const QString &p_name) Q_DECL_OVERRIDE;
QString renameAttachment(const QString &p_path, const QString &p_name) Q_DECL_OVERRIDE;
void removeAttachment(const QStringList &p_paths) Q_DECL_OVERRIDE;
QString insertImage(const QString &p_srcImagePath, const QString &p_imageFileName) Q_DECL_OVERRIDE;
QString insertImage(const QImage &p_image, const QString &p_imageFileName) Q_DECL_OVERRIDE;
void removeImage(const QString &p_imagePath) Q_DECL_OVERRIDE;
bool isAttachmentSupported() const Q_DECL_OVERRIDE;
bool isTagSupported() const Q_DECL_OVERRIDE;
bool isReadOnly() const Q_DECL_OVERRIDE;
QSharedPointer<File> getFile() const Q_DECL_OVERRIDE;
private:
QSharedPointer<File> m_file;
Node *c_nodeAttachedTo = nullptr;
bool m_readOnly = false;
};
}
#endif // FILEBUFFERPROVIDER_H

View File

@ -0,0 +1,197 @@
#include "filetypehelper.h"
#include <QFileInfo>
#include <QDebug>
#include <utils/fileutils.h>
#include "buffer.h"
#include <core/configmgr.h>
#include <core/coreconfig.h>
using namespace vnotex;
QString FileType::preferredSuffix() const
{
return m_suffixes.isEmpty() ? QString() : m_suffixes.first();
}
bool FileType::isMarkdown() const
{
return m_type == Type::Markdown;
}
QString FileTypeHelper::s_systemDefaultProgram = QStringLiteral("System");
FileTypeHelper::FileTypeHelper()
{
reload();
}
void FileTypeHelper::reload()
{
setupBuiltInTypes();
setupSuffixTypeMap();
}
void FileTypeHelper::setupBuiltInTypes()
{
m_fileTypes.clear();
const auto &coreConfig = ConfigMgr::getInst().getCoreConfig();
{
FileType type;
type.m_type = FileType::Markdown;
type.m_typeName = QStringLiteral("Markdown");
type.m_displayName = Buffer::tr("Markdown");
auto suffixes = coreConfig.findFileTypeSuffix(type.m_typeName);
if (suffixes && !suffixes->isEmpty()) {
type.m_suffixes = *suffixes;
} else {
type.m_suffixes << QStringLiteral("md")
<< QStringLiteral("mkd")
<< QStringLiteral("rmd")
<< QStringLiteral("markdown");
}
m_fileTypes.push_back(type);
}
{
FileType type;
type.m_type = FileType::Text;
type.m_typeName = QStringLiteral("Text");
type.m_displayName = Buffer::tr("Text");
auto suffixes = coreConfig.findFileTypeSuffix(type.m_typeName);
if (suffixes && !suffixes->isEmpty()) {
type.m_suffixes = *suffixes;
} else {
type.m_suffixes << QStringLiteral("txt") << QStringLiteral("text") << QStringLiteral("log");
}
m_fileTypes.push_back(type);
}
{
FileType type;
type.m_type = FileType::Pdf;
type.m_typeName = QStringLiteral("PDF");
type.m_displayName = Buffer::tr("Portable Document Format");
type.m_isNewable = false;
auto suffixes = coreConfig.findFileTypeSuffix(type.m_typeName);
if (suffixes && !suffixes->isEmpty()) {
type.m_suffixes = *suffixes;
} else {
type.m_suffixes << QStringLiteral("pdf");
}
m_fileTypes.push_back(type);
}
{
FileType type;
type.m_type = FileType::MindMap;
type.m_typeName = QStringLiteral("MindMap");
type.m_displayName = Buffer::tr("Mind Map");
auto suffixes = coreConfig.findFileTypeSuffix(type.m_typeName);
if (suffixes && !suffixes->isEmpty()) {
type.m_suffixes = *suffixes;
} else {
type.m_suffixes << QStringLiteral("emind");
}
m_fileTypes.push_back(type);
}
{
FileType type;
type.m_type = FileType::Others;
type.m_typeName = QStringLiteral("Others");
type.m_displayName = Buffer::tr("Others");
m_fileTypes.push_back(type);
}
}
const FileType &FileTypeHelper::getFileType(const QString &p_filePath) const
{
Q_ASSERT(!p_filePath.isEmpty());
QFileInfo fi(p_filePath);
auto suffix = fi.suffix().toLower();
auto it = m_suffixTypeMap.find(suffix);
if (it != m_suffixTypeMap.end()) {
return m_fileTypes.at(it.value());
}
// Treat all unknown text files as plain text files.
if (FileUtils::isText(p_filePath)) {
return m_fileTypes[FileType::Text];
}
return m_fileTypes[FileType::Others];
}
const FileType &FileTypeHelper::getFileTypeBySuffix(const QString &p_suffix) const
{
auto it = m_suffixTypeMap.find(p_suffix.toLower());
if (it != m_suffixTypeMap.end()) {
return m_fileTypes.at(it.value());
} else {
return m_fileTypes[FileType::Others];
}
}
void FileTypeHelper::setupSuffixTypeMap()
{
m_suffixTypeMap.clear();
for (int i = 0; i < m_fileTypes.size(); ++i) {
for (const auto &suffix : m_fileTypes[i].m_suffixes) {
if (m_suffixTypeMap.contains(suffix)) {
qWarning() << "suffix conflicts detected" << suffix << m_fileTypes[i].m_type;
}
m_suffixTypeMap.insert(suffix, i);
}
}
}
const QVector<FileType> &FileTypeHelper::getAllFileTypes() const
{
return m_fileTypes;
}
const FileType &FileTypeHelper::getFileType(int p_type) const
{
if (p_type >= m_fileTypes.size()) {
p_type = FileType::Others;
}
return m_fileTypes[p_type];
}
FileTypeHelper &FileTypeHelper::getInst()
{
static FileTypeHelper helper;
return helper;
}
bool FileTypeHelper::checkFileType(const QString &p_filePath, int p_type) const
{
return getFileType(p_filePath).m_type == p_type;
}
const FileType &FileTypeHelper::getFileTypeByName(const QString &p_typeName) const
{
for (const auto &ft : m_fileTypes) {
if (ft.m_typeName == p_typeName) {
return ft;
}
}
Q_ASSERT(false);
return m_fileTypes[FileType::Others];
}

View File

@ -0,0 +1,78 @@
#ifndef FILETYPEHELPER_H
#define FILETYPEHELPER_H
#include <QString>
#include <QMap>
#include <QVector>
namespace vnotex
{
class FileType
{
public:
// There may be other types after Others.
enum Type
{
Markdown = 0,
Text,
Pdf,
MindMap,
Others
};
QString preferredSuffix() const;
bool isMarkdown() const;
// Type.
int m_type = -1;
QString m_typeName;
QString m_displayName;
QStringList m_suffixes;
// Whether we can new this type of file.
bool m_isNewable = true;
};
// Only handle built-in editors.
class FileTypeHelper
{
public:
const FileType &getFileType(const QString &p_filePath) const;
const FileType &getFileType(int p_type) const;
const FileType &getFileTypeByName(const QString &p_typeName) const;
const FileType &getFileTypeBySuffix(const QString &p_suffix) const;
const QVector<FileType> &getAllFileTypes() const;
bool checkFileType(const QString &p_filePath, int p_type) const;
void reload();
static FileTypeHelper &getInst();
static QString s_systemDefaultProgram;
private:
FileTypeHelper();
void setupBuiltInTypes();
void setupSuffixTypeMap();
// Built-in Type could be accessed via enum Type.
QVector<FileType> m_fileTypes;
// suffix -> index of m_fileTypes.
// TODO: handle suffix conflicts.
QMap<QString, int> m_suffixTypeMap;
};
} // ns vnotex
#endif // FILETYPEHELPER_H

View File

@ -0,0 +1,26 @@
#ifndef IBUFFERFACTORY_H
#define IBUFFERFACTORY_H
#include <QSharedPointer>
namespace vnotex
{
class Buffer;
struct BufferParameters;
// Abstract factory to create buffer.
class IBufferFactory
{
public:
virtual ~IBufferFactory()
{
}
virtual Buffer *createBuffer(const BufferParameters &p_parameters,
QObject *p_parent) = 0;
virtual bool isBufferCreatedByFactory(const Buffer *p_buffer) const = 0;
};
} // ns vnotex
#endif // IBUFFERFACTORY_H

View File

@ -0,0 +1,107 @@
#include "markdownbuffer.h"
#include <QDir>
#include <widgets/markdownviewwindow.h>
#include <notebook/node.h>
#include <utils/pathutils.h>
#include <buffer/bufferprovider.h>
using namespace vnotex;
MarkdownBuffer::MarkdownBuffer(const BufferParameters &p_parameters,
QObject *p_parent)
: Buffer(p_parameters, p_parent)
{
fetchInitialImages();
}
ViewWindow *MarkdownBuffer::createViewWindowInternal(const QSharedPointer<FileOpenParameters> &p_paras, QWidget *p_parent)
{
Q_UNUSED(p_paras);
return new MarkdownViewWindow(p_parent);
}
QString MarkdownBuffer::insertImage(const QString &p_srcImagePath, const QString &p_imageFileName)
{
return m_provider->insertImage(p_srcImagePath, p_imageFileName);
}
QString MarkdownBuffer::insertImage(const QImage &p_image, const QString &p_imageFileName)
{
return m_provider->insertImage(p_image, p_imageFileName);
}
void MarkdownBuffer::fetchInitialImages()
{
Q_ASSERT(m_initialImages.isEmpty());
// There is compilation error on Linux and macOS using TypeFlags directly.
int linkFlags = vte::MarkdownLink::TypeFlag::LocalRelativeInternal | vte::MarkdownLink::TypeFlag::Remote;
m_initialImages = vte::MarkdownUtils::fetchImagesFromMarkdownText(getContent(),
getResourcePath(),
static_cast<vte::MarkdownLink::TypeFlags>(linkFlags));
}
void MarkdownBuffer::addInsertedImage(const QString &p_imagePath, const QString &p_urlInLink)
{
vte::MarkdownLink link;
link.m_path = p_imagePath;
link.m_urlInLink = p_urlInLink;
// There are two types: local internal and remote for image host.
link.m_type = PathUtils::isLocalFile(p_imagePath) ? vte::MarkdownLink::TypeFlag::LocalRelativeInternal : vte::MarkdownLink::TypeFlag::Remote;
m_insertedImages.append(link);
}
QHash<QString, bool> MarkdownBuffer::clearObsoleteImages()
{
QHash<QString, bool> obsoleteImages;
Q_ASSERT(!isModified());
const bool discarded = state() & StateFlag::Discarded;
const int linkFlags = vte::MarkdownLink::TypeFlag::LocalRelativeInternal | vte::MarkdownLink::TypeFlag::Remote;
const auto latestImages =
vte::MarkdownUtils::fetchImagesFromMarkdownText(!discarded ? getContent() : m_provider->read(),
getResourcePath(),
static_cast<vte::MarkdownLink::TypeFlags>(linkFlags));
QSet<QString> latestImagesPath;
for (const auto &link : latestImages) {
if (link.m_type & vte::MarkdownLink::TypeFlag::Remote) {
latestImagesPath.insert(link.m_path);
} else {
latestImagesPath.insert(PathUtils::normalizePath(link.m_path));
}
}
for (const auto &link : m_insertedImages) {
if (!(link.m_type & linkFlags)) {
continue;
}
const bool isRemote = link.m_type & vte::MarkdownLink::TypeFlag::Remote;
const auto linkPath = isRemote ? link.m_path : PathUtils::normalizePath(link.m_path);
if (!latestImagesPath.contains(linkPath)) {
obsoleteImages.insert(link.m_path, isRemote);
}
}
m_insertedImages.clear();
for (const auto &link : m_initialImages) {
Q_ASSERT(link.m_type & linkFlags);
const bool isRemote = link.m_type & vte::MarkdownLink::TypeFlag::Remote;
const auto linkPath = isRemote ? link.m_path : PathUtils::normalizePath(link.m_path);
if (!latestImagesPath.contains(linkPath)) {
obsoleteImages.insert(link.m_path, isRemote);
}
}
m_initialImages = latestImages;
return obsoleteImages;
}
void MarkdownBuffer::removeImage(const QString &p_imagePath)
{
qDebug() << "remove obsolete image" << p_imagePath;
m_provider->removeImage(p_imagePath);
}

View File

@ -0,0 +1,48 @@
#ifndef MARKDOWNBUFFER_H
#define MARKDOWNBUFFER_H
#include "buffer.h"
#include <QVector>
#include <QHash>
#include <vtextedit/markdownutils.h>
namespace vnotex
{
class MarkdownBuffer : public Buffer
{
Q_OBJECT
public:
MarkdownBuffer(const BufferParameters &p_parameters,
QObject *p_parent = nullptr);
QString insertImage(const QString &p_srcImagePath, const QString &p_imageFileName) Q_DECL_OVERRIDE;
QString insertImage(const QImage &p_image, const QString &p_imageFileName) Q_DECL_OVERRIDE;
void removeImage(const QString &p_imagePath) Q_DECL_OVERRIDE;
void addInsertedImage(const QString &p_imagePath, const QString &p_urlInLink);
// Clear obsolete images.
// Won't delete images, just return a list of obsolete images path.
// Will re-init m_initialImages and clear m_insertedImages.
// Return [ImagePath] -> IsRemote.
QHash<QString, bool> clearObsoleteImages();
protected:
ViewWindow *createViewWindowInternal(const QSharedPointer<FileOpenParameters> &p_paras, QWidget *p_parent) Q_DECL_OVERRIDE;
private:
void fetchInitialImages();
// Images referenced in the file before opening this buffer.
QVector<vte::MarkdownLink> m_initialImages;
// Images newly inserted during this buffer's lifetime.
QVector<vte::MarkdownLink> m_insertedImages;
};
} // ns vnotex
#endif // MARKDOWNBUFFER_H

View File

@ -0,0 +1,16 @@
#include "markdownbufferfactory.h"
#include "markdownbuffer.h"
using namespace vnotex;
Buffer *MarkdownBufferFactory::createBuffer(const BufferParameters &p_parameters,
QObject *p_parent)
{
return new MarkdownBuffer(p_parameters, p_parent);
}
bool MarkdownBufferFactory::isBufferCreatedByFactory(const Buffer *p_buffer) const
{
return dynamic_cast<const MarkdownBuffer *>(p_buffer) != nullptr;
}

View File

@ -0,0 +1,19 @@
#ifndef MARKDOWNBUFFERFACTORY_H
#define MARKDOWNBUFFERFACTORY_H
#include "ibufferfactory.h"
namespace vnotex
{
// Buffer factory for Markdown file.
class MarkdownBufferFactory : public IBufferFactory
{
public:
Buffer *createBuffer(const BufferParameters &p_parameters,
QObject *p_parent) Q_DECL_OVERRIDE;
bool isBufferCreatedByFactory(const Buffer *p_buffer) const Q_DECL_OVERRIDE;
};
} // vnotex
#endif // MARKDOWNBUFFERFACTORY_H

View File

@ -0,0 +1,17 @@
#include "mindmapbuffer.h"
#include <widgets/mindmapviewwindow.h>
using namespace vnotex;
MindMapBuffer::MindMapBuffer(const BufferParameters &p_parameters,
QObject *p_parent)
: Buffer(p_parameters, p_parent)
{
}
ViewWindow *MindMapBuffer::createViewWindowInternal(const QSharedPointer<FileOpenParameters> &p_paras, QWidget *p_parent)
{
Q_UNUSED(p_paras);
return new MindMapViewWindow(p_parent);
}

View File

@ -0,0 +1,21 @@
#ifndef MINDMAPBUFFER_H
#define MINDMAPBUFFER_H
#include "buffer.h"
namespace vnotex
{
class MindMapBuffer : public Buffer
{
Q_OBJECT
public:
MindMapBuffer(const BufferParameters &p_parameters,
QObject *p_parent = nullptr);
protected:
ViewWindow *createViewWindowInternal(const QSharedPointer<FileOpenParameters> &p_paras,
QWidget *p_parent) Q_DECL_OVERRIDE;
};
}
#endif // MINDMAPBUFFER_H

View File

@ -0,0 +1,16 @@
#include "mindmapbufferfactory.h"
#include "mindmapbuffer.h"
using namespace vnotex;
Buffer *MindMapBufferFactory::createBuffer(const BufferParameters &p_parameters,
QObject *p_parent)
{
return new MindMapBuffer(p_parameters, p_parent);
}
bool MindMapBufferFactory::isBufferCreatedByFactory(const Buffer *p_buffer) const
{
return dynamic_cast<const MindMapBuffer *>(p_buffer) != nullptr;
}

View File

@ -0,0 +1,19 @@
#ifndef MINDMAPBUFFERFACTORY_H
#define MINDMAPBUFFERFACTORY_H
#include "ibufferfactory.h"
namespace vnotex
{
// Buffer factory for MindMap file.
class MindMapBufferFactory : public IBufferFactory
{
public:
Buffer *createBuffer(const BufferParameters &p_parameters,
QObject *p_parent) Q_DECL_OVERRIDE;
bool isBufferCreatedByFactory(const Buffer *p_buffer) const Q_DECL_OVERRIDE;
};
}
#endif // MINDMAPBUFFERFACTORY_H

View File

@ -0,0 +1,175 @@
#include "nodebufferprovider.h"
#include <QFileInfo>
#include <notebook/node.h>
#include <notebook/notebook.h>
#include <utils/pathutils.h>
#include <core/file.h>
#include <core/exception.h>
using namespace vnotex;
NodeBufferProvider::NodeBufferProvider(const QSharedPointer<Node> &p_node,
const QSharedPointer<File> &p_file,
QObject *p_parent)
: BufferProvider(p_parent),
m_node(p_node),
m_nodeFile(p_file)
{
}
Buffer::ProviderType NodeBufferProvider::getType() const
{
return Buffer::ProviderType::Internal;
}
bool NodeBufferProvider::match(const Node *p_node) const
{
return m_node.data() == p_node;
}
bool NodeBufferProvider::match(const QString &p_filePath) const
{
return PathUtils::areSamePaths(getPath(), p_filePath);
}
QString NodeBufferProvider::getName() const
{
return m_node->getName();
}
QString NodeBufferProvider::getPath() const
{
return m_nodeFile->getFilePath();
}
QString NodeBufferProvider::getContentPath() const
{
return m_nodeFile->getContentPath();
}
QString NodeBufferProvider::getResourcePath() const
{
return m_nodeFile->getResourcePath();
}
void NodeBufferProvider::write(const QString &p_content)
{
m_nodeFile->write(p_content);
m_lastModified = getLastModifiedFromFile();
}
QString NodeBufferProvider::read() const
{
const_cast<NodeBufferProvider *>(this)->m_lastModified = getLastModifiedFromFile();
return m_nodeFile->read();
}
QString NodeBufferProvider::fetchImageFolderPath()
{
auto file = m_nodeFile->getImageInterface();
if (file) {
return file->fetchImageFolderPath();
} else {
Q_ASSERT(false);
return getContentPath();
}
}
bool NodeBufferProvider::isChildOf(const Node *p_node) const
{
return Node::isAncestor(p_node, m_node.data());
}
QString NodeBufferProvider::getAttachmentFolder() const
{
return m_node->getAttachmentFolder();
}
QString NodeBufferProvider::fetchAttachmentFolderPath()
{
return m_node->fetchAttachmentFolderPath();
}
QStringList NodeBufferProvider::addAttachment(const QString &p_destFolderPath, const QStringList &p_files)
{
return m_node->addAttachment(p_destFolderPath, p_files);
}
QString NodeBufferProvider::newAttachmentFile(const QString &p_destFolderPath, const QString &p_name)
{
return m_node->newAttachmentFile(p_destFolderPath, p_name);
}
QString NodeBufferProvider::newAttachmentFolder(const QString &p_destFolderPath, const QString &p_name)
{
return m_node->newAttachmentFolder(p_destFolderPath, p_name);
}
QString NodeBufferProvider::renameAttachment(const QString &p_path, const QString &p_name)
{
return m_node->renameAttachment(p_path, p_name);
}
void NodeBufferProvider::removeAttachment(const QStringList &p_paths)
{
return m_node->removeAttachment(p_paths);
}
QString NodeBufferProvider::insertImage(const QString &p_srcImagePath, const QString &p_imageFileName)
{
auto file = m_nodeFile->getImageInterface();
if (file) {
return file->insertImage(p_srcImagePath, p_imageFileName);
} else {
return QString();
}
}
QString NodeBufferProvider::insertImage(const QImage &p_image, const QString &p_imageFileName)
{
auto file = m_nodeFile->getImageInterface();
if (file) {
return file->insertImage(p_image, p_imageFileName);
} else {
return QString();
}
}
void NodeBufferProvider::removeImage(const QString &p_imagePath)
{
auto file = m_nodeFile->getImageInterface();
if (file) {
try {
file->removeImage(p_imagePath);
} catch (Exception &e) {
qWarning() << "failed to remove image" << p_imagePath << e.what();
}
}
}
bool NodeBufferProvider::isAttachmentSupported() const
{
return true;
}
bool NodeBufferProvider::isTagSupported() const
{
return m_node->getNotebook()->tag() != nullptr;
}
Node *NodeBufferProvider::getNode() const
{
return m_node.data();
}
bool NodeBufferProvider::isReadOnly() const
{
return m_node->isReadOnly();
}
QSharedPointer<File> NodeBufferProvider::getFile() const
{
return m_nodeFile;
}

View File

@ -0,0 +1,81 @@
#ifndef NODEBUFFERPROVIDER_H
#define NODEBUFFERPROVIDER_H
#include <QSharedPointer>
#include "bufferprovider.h"
namespace vnotex
{
class File;
class IFileWithImage;
// Buffer provider based on an internal node.
class NodeBufferProvider : public BufferProvider
{
Q_OBJECT
public:
NodeBufferProvider(const QSharedPointer<Node> &p_node,
const QSharedPointer<File> &p_file,
QObject *p_parent = nullptr);
Buffer::ProviderType getType() const Q_DECL_OVERRIDE;
bool match(const Node *p_node) const Q_DECL_OVERRIDE;
bool match(const QString &p_filePath) const Q_DECL_OVERRIDE;
QString getName() const Q_DECL_OVERRIDE;
QString getPath() const Q_DECL_OVERRIDE;
QString getContentPath() const Q_DECL_OVERRIDE;
QString getResourcePath() const Q_DECL_OVERRIDE;
void write(const QString &p_content) Q_DECL_OVERRIDE;
QString read() const Q_DECL_OVERRIDE;
QString fetchImageFolderPath() Q_DECL_OVERRIDE;
bool isChildOf(const Node *p_node) const Q_DECL_OVERRIDE;
Node *getNode() const Q_DECL_OVERRIDE;
QString getAttachmentFolder() const Q_DECL_OVERRIDE;
QString fetchAttachmentFolderPath() Q_DECL_OVERRIDE;
QStringList addAttachment(const QString &p_destFolderPath, const QStringList &p_files) Q_DECL_OVERRIDE;
QString newAttachmentFile(const QString &p_destFolderPath, const QString &p_name) Q_DECL_OVERRIDE;
QString newAttachmentFolder(const QString &p_destFolderPath, const QString &p_name) Q_DECL_OVERRIDE;
QString renameAttachment(const QString &p_path, const QString &p_name) Q_DECL_OVERRIDE;
void removeAttachment(const QStringList &p_paths) Q_DECL_OVERRIDE;
QString insertImage(const QString &p_srcImagePath, const QString &p_imageFileName) Q_DECL_OVERRIDE;
QString insertImage(const QImage &p_image, const QString &p_imageFileName) Q_DECL_OVERRIDE;
void removeImage(const QString &p_imagePath) Q_DECL_OVERRIDE;
bool isAttachmentSupported() const Q_DECL_OVERRIDE;
bool isTagSupported() const Q_DECL_OVERRIDE;
bool isReadOnly() const Q_DECL_OVERRIDE;
QSharedPointer<File> getFile() const Q_DECL_OVERRIDE;
private:
QSharedPointer<Node> m_node;
QSharedPointer<File> m_nodeFile;
};
}
#endif // NODEBUFFERPROVIDER_H

View File

@ -0,0 +1,17 @@
#include "pdfbuffer.h"
#include <widgets/pdfviewwindow.h>
using namespace vnotex;
PdfBuffer::PdfBuffer(const BufferParameters &p_parameters,
QObject *p_parent)
: Buffer(p_parameters, p_parent)
{
}
ViewWindow *PdfBuffer::createViewWindowInternal(const QSharedPointer<FileOpenParameters> &p_paras, QWidget *p_parent)
{
Q_UNUSED(p_paras);
return new PdfViewWindow(p_parent);
}

Some files were not shown because too many files have changed in this diff Show More