Compare commits

...

780 Commits

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
2233 changed files with 461880 additions and 128558 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

18
.gitignore vendored
View File

@ -1 +1,17 @@
/VNote.pro.user
*.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.22",
"desc": "VNote Releases",
"released": "2018-08-23",
"vcs_tag": "1.22",
"gpgSign": false
},
"files":
[{"includePattern": "build/(VNote-.*\\.AppImage)", "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.22",
"desc": "VNote Releases",
"released": "2018-08-23",
"vcs_tag": "1.22",
"gpgSign": false
},
"files":
[{"includePattern": "build/distrib/(VNote-.*\\.dmg)", "uploadPattern": "$1",
"matrixParams": {"override": 1 }}],
"publish": true
}

View File

@ -1,61 +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.22"
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 openssl libssl-dev ; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install libgl1-mesa-dev ; 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
skip_cleanup: true
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
skip_cleanup: true
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,88 +0,0 @@
#!/bin/bash
project_dir=$(pwd)
# Install qt5.9
sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
sudo add-apt-repository ppa:beineri/opt-qt593-trusty -y
sudo apt-get update -qq
sudo apt-get -y install qt59base qt59webengine qt59webchannel qt59svg qt59location qt59tools qt59translations
source /opt/qt*/bin/qt*-env.sh
# Compile newer version fcitx-qt5
sudo apt-get -y install fcitx-libs-dev libgl1-mesa-dev bison
sudo apt-get -y install cmake
wget http://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz
tar xf libxkbcommon-0.5.0.tar.xz
cd libxkbcommon-0.5.0
./configure -prefix=/usr -libdir=/usr/lib/x86_64-linux-gnu -disable-x11
make -j$(nproc) && sudo make install
git clone git://anongit.kde.org/extra-cmake-modules
cd extra-cmake-modules
mkdir build && cd build
cmake ..
make -j$(nproc) && sudo make install
git clone https://github.com/fcitx/fcitx-qt5
cd fcitx-qt5
git checkout 1.0.5
cmake .
make -j$(nproc) && sudo make install
# Copy fcitx-qt5 files to qt
sudo cp /usr/local/lib/libFcitxQt5DBusAddons.so* /opt/qt*/lib/
sudo cp /usr/local/lib/libFcitxQt5WidgetsAddons.so* /opt/qt*/lib/
tree /opt/qt59/lib/
cd ${project_dir}
mkdir build
cd build
qmake -v
qmake CONFIG+=release -spec linux-g++-64 ../VNote.pro
make -j$(nproc)
#
# Pack AppImage using linuxdeployqt
#
mkdir dist
INSTALL_ROOT=${project_dir}/build/dist make install ; tree dist/
# Copy SVG module
mkdir -p ./dist/usr/plugins/iconengines
mkdir -p ./dist/usr/plugins/imageformats
mkdir -p ./dist/usr/plugins/platforminputcontexts
cp /opt/qt59/plugins/iconengines/* ./dist/usr/plugins/iconengines/
cp /opt/qt59/plugins/imageformats/* ./dist/usr/plugins/imageformats/
cp /opt/qt59/plugins/platforminputcontexts/* ./dist/usr/plugins/platforminputcontexts/
# Copy other project files
cp "${project_dir}/README.md" "dist/README.md"
cp "${project_dir}/LICENSE" "dist/LICENSE"
echo ${version} > ./dist/version
echo "${TRAVIS_COMMIT}" >> ./dist/version
# Get linuxdeployqt tool
git clone https://github.com/tamlok/vnote-utils.git vnote-utils.git
cp vnote-utils.git/linuxdeployqt-continuous-x86_64.AppImage ./linuxdeployqt-continuous-x86_64.AppImage
# wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
./linuxdeployqt*.AppImage ./dist/usr/share/applications/*.desktop -bundle-non-qt-libs -exclude-libs=libnss3,libnssutil3
# Copy translations
cp /opt/qt59/translations/*_zh_CN.qm ./dist/usr/translations/
# Package it for the second time.
./linuxdeployqt*.AppImage ./dist/usr/share/applications/*.desktop -appimage -exclude-libs=libnss3,libnssutil3
tree dist/
ls -l *.AppImage
mv VNote-*.AppImage VNote-${version}-x86_64.AppImage
cd ..
exit 0

View File

@ -1,57 +0,0 @@
#!/bin/bash
project_dir=$(pwd)
brew update > /dev/null
# Use Qt5.9.3 instead of 5.10
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git checkout 13d52537d1e0e5f913de4639012 qt.rb
sed -i '' 's/:mysql/"mysql"/' qt.rb
sed -i '' 's/:postgresql/"postgresql"/' qt.rb
cat qt.rb
brew install qt
QTDIR="/usr/local/opt/qt"
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-${version}-x64.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.

View File

@ -1,9 +0,0 @@
- English is preferred;
- Make the title as meaningful as possible;
- One issue for only one thing, since large issues are difficult to remember and handle;
- When reporting problems, elaborate it as detailed as possible like:
- Version of VNote, which operating system;
- What is the symptoms;
- What action triggered it;
- How to reproduce it;
- Please delete all these text and put whatever you want below. :)

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.

216
README.md
View File

@ -1,210 +1,42 @@
# VNote
- [中文 Chinese](./README_zh.md)
- [VNote Homepage](https://tamlok.github.io/vnote)
- [Documentation](http://vnote.readthedocs.io/en/latest/)
- [Screenshots](https://tamlok.github.io/vnote/gallery.html)
- [VNote Posts](https://github.com/tamlok/vnote-posts)
![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)
Designed specially for **Markdown**, **VNote** is a Vim-inspired note-taking application, which knows programmers and Markdown better.
[简体中文](README_zh_CN.md)
![VNote](screenshots/vnote.png)
[Project on Gitee](https://gitee.com/vnotex/vnote)
# Downloads
Users from China can download the latest release of VNote from [Baidu Netdisk](http://pan.baidu.com/s/1jI5HROq).
A pleasant note-taking platform.
## Windows
![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/tamlok/vnote?svg=true)
For more information, please visit [**VNote's Home Page**](https://vnotex.github.io/vnote).
- [Github releases](https://github.com/tamlok/vnote/releases)
- Latest builds on master: [ ![Download](https://api.bintray.com/packages/tamlok/vnote/vnote/images/download.svg) ](https://bintray.com/tamlok/vnote/vnote/_latestVersion)
![VNote](pics/vnote.png)
**NOT** supported in XP since QtWebEngineProcess used by VNote could not work in XP.
## 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.
## Linux
### AppImage
[![Build Status](https://travis-ci.org/tamlok/vnote.svg?branch=master)](https://travis-ci.org/tamlok/vnote)
There is an AppImage format standalone executable of VNote for major Linux distributions. **Any help for packaging and distribution on Linux is appreciated!**
- [Github releases](https://github.com/tamlok/vnote/releases)
- Latest builds on master: [ ![Download](https://api.bintray.com/packages/tamlok/vnote/vnote/images/download.svg) ](https://bintray.com/tamlok/vnote/vnote/_latestVersion)
### openSUSE
Currently `vnote` on openSUSE Tumbleweed can be installed from `home:opensuse_zh` project on OBS. You can execute the following command directly:
```shell
sudo zypper ar https://download.opensuse.org/repositories/home:/opensuse_zh/openSUSE_Tumbleweed/ home:opensuse_zh
sudo zypper ref
sudo zypper in vnote
```
For other architectures, please search for `vnote` at [software.opensuse.org](https://software.opensuse.org).
We don't support Leap 42 and below due to the Qt version. Please use AppImage or build it yourself.
### Arch Linux
VNote on Arch Linux can be installed from the AUR as [vnote](https://aur.archlinux.org/packages/vnote/):
```shell
git clone https://aur.archlinux.org/vnote.git
cd vnote
makepkg -sic
```
There is also a development version that tracks the latest master [vnote-git](https://aur.archlinux.org/packages/vnote-git/).
## MacOS
[![Build Status](https://travis-ci.org/tamlok/vnote.svg?branch=master)](https://travis-ci.org/tamlok/vnote)
- [Github releases](https://github.com/tamlok/vnote/releases)
- Latest builds on master: [ ![Download](https://api.bintray.com/packages/tamlok/vnote/vnote/images/download.svg) ](https://bintray.com/tamlok/vnote/vnote/_latestVersion)
You can also install VNote using homebrew, through the cask tap:
```shell
brew cask install vnote
```
# Description
**VNote** is a Qt-based, free and open source note-taking application, focusing on Markdown. VNote is designed to provide comfortable edit experience, especially for programmers.
VNote is **NOT** just a simple editor for Markdown. By providing notes management, VNote makes taking notes in Markdown simpler and more pleasant.
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.
Utilizing Qt, VNote could run on **Linux**, **Windows**, and **macOS**.
![VNote Main Interface](screenshots/_vnotemaini_1525154456_1561295841.png)
![Main](pics/main.png)
# Supports
- [Github issues](https://github.com/tamlok/vnote/issues);
- Email: tamlokveer at gmail.com;
- WeChat Public Account: VNote笔记 (vnote_md);
![VNote WeChat](screenshots/vnote_md.jpg)
![Main2](pics/main2.png)
# Highlights
- Powerful **full-text search**;
- **Universal Entry** to reach anything just by typing;
- Inserting images directly from clipboard;
- Syntax highlights of fenced code blocks in both **edit** and **read** mode;
- Powerful **In-Place Preview** for images, diagrams, and formulas;
- Side-by-side live preview for diagrams;
- Outline in both edit and read mode;
- Custom styles in both edit and read mode;
- Vim mode and a set of powerful shortcuts;
- Infinite levels of folders;
- Multiple tabs and splitting windows;
- [Mermaid](http://knsv.github.io/mermaid/), [Flowchart.js](http://flowchart.js.org/), [MathJax](https://www.mathjax.org/), [PlantUML](http://plantuml.com/), and [Graphviz](http://www.graphviz.org/);
- Supports HiDPI;
- Attachments of notes;
- Themes and dark mode;
- Rich and extensible export, such as HTML, PDF, PDF (All In One), and images;
## Downloads
Continuous builds on `master` branch could be found at the [Continuous Build](https://github.com/vnotex/vnote/releases/tag/continuous-build) release.
# Donate
You could help VNote's development in many ways.
Latest stable builds could be found at the [latest release](https://github.com/vnotex/vnote/releases/latest). Alternative download services are available:
- Keep monitoring VNote and sending feedback for improvement.
- Spread and promote VNote to your friends. Popularity is a strong power to drive developers.
- Participate in the development of VNote and send PullRequest to make VNote perfect.
- Last, really appreciate your donate to VNote if you think VNote really helps you and you want to help VNote.
- PayPal: [PayPal.Me/vnotemd](https://www.paypal.me/vnotemd)
- Alipay: `tamlokveer@gmail.com`
![Alipay](screenshots/alipay.png)
- WeChat
![WeChat Pay](screenshots/wechat_pay.png)
* [Tianyi Netdisk](https://cloud.189.cn/t/Av67NvmEJVBv)
* [Baidu Netdisk](https://pan.baidu.com/s/1lX69oMBw8XuJshQDN3HiHw?pwd=f8fk)
Thanks very much to [them](https://github.com/tamlok/vnote/wiki/Donate-List) who donated to VNote!
## Supports
* [GitHub Issues](https://github.com/vnotex/vnote/issues);
* Email: `tamlokveer at gmail.com`;
* [Telegram](https://t.me/vnotex);
* WeChat Public Account: vnotex;
# Why VNote
## Markdown Editor & Notes Management
VNote tries to be a powerful Markdown editor with notes management, or a note-taking application with pleasant Markdown support. If you are a fan of Markdown and enjoy writing Markdown notes for study, work, and life, VNote is the right tool for you.
Thank [users who donated to VNote](https://github.com/vnotex/vnote/wiki/Donate-List)!
## Pleasant Markdown Experience
### Insights About Markdown
Markdown, as a simple mark language, unlike rich text, was born with a **gap between edit and read**. There are about three ways to handle this gap:
1. As one extreme, some editors just treat Markdown as **plain text**. Users may lose themselves in the messy black characters. It is hard to keep track of the information of the note.
2. Most Markdown editors use two panels to **edit and preview Markdown notes simultaneously**. It makes things easier since users could see a pleasant typesetting and layout while editing the text. However, two panels may occupy the whole screen and users keep moving eyes left and right which will be a big distraction.
3. As another extreme, some editors convert the Markdown elements in place immediately after the typing, which makes editing Markdown just like editing rich text document in Word.
Since most editors choose the second way to handle the gap, people always think of preview when it comes to Markdown. It may be a misunderstanding about Markdown. Designed as a simple mark language, Markdown is intended to help to keep track of the information of the text when editing and provide a beautiful typesetting when reading after being converted to HTML.
### Tradeoff: VNote's Way
VNote tries to minimize the gap and provide the best-effort *WYSIWYG* for Markdown via tuned **syntax highlights** and some other features. By helping to keep track of the content, there is no need to preview or alter the text immediately after being typed.
# Features
## Notebook-Based Notes Management
VNote uses **notebooks** to hold your notes. Like OneNote, a notebook can be hosted on any location on 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 (called the *Root Folder* of the notebook) 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 folders. VNote supports copying or moving folders or notes within or between notebooks.
## 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.
## 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 edit mode in Markdown, which is **superior** than almost all current Markdown editors.
![Syntax Highlight](screenshots/_1513485266_1616037517.png)
## In-Place Preview
VNote supports powerful **in-place preview** for images, diagrams, and formulas in edit mode.
![In-Place Preview](screenshots/_inplacepre_1525155248_405615820.png)
## Pleasant Image Experience
Just paste your image into the Markdown note, VNote will manage all other stuffs. VNote stores images in a specified folder in the same folder with the note. VNote will pop up a window to preview the image when you insert an image. Furthermore, VNote will delete the useless image files automatically after you remove the image links.
![Pleasant Image Experience](screenshots/_1513485753_394180887.png)
## Universal Entry & Full-Text Search
VNote has powerful built-in full-text search with **Regular Expression** and **Fuzzy Search** support. The search could be executed wihtin all notebooks, current notebook, or current folder, targeted at name or content.
![Full-Text Search](screenshots/_1522894671_1711734243.png)
Like the `CtrlP` in Vim, VNote supports **Universal Entry** to reach anything by typing in a simple input.
![Universal Entry](screenshots/_universale_1522894821_465772669.png)
## Interactive Outline Viewer In Read & Edit 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.
## Powerful Shortcuts
VNote supports many pleasant and powerful shortcuts which facilitate your editing, including **Vim Mode**, **Captain Mode**, and **Navigation Mode** which enable you to work without the mouse.
Please refer to the [shortcuts help](src/resources/docs/shortcuts_en.md) in the help menu for more details.
## 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.
# Dependencies
- [Qt 5.9](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)
- [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote) (MIT License)
- [markdown-it-sub](https://github.com/markdown-it/markdown-it-sub) (MIT License)
- [markdown-it-sup](https://github.com/markdown-it/markdown-it-sup) (MIT License)
- [markdown-it-front-matter](https://github.com/craigdmckenna/markdown-it-front-matter) (MIT License)
- [markdown-it-imsize](https://github.com/tatsy/markdown-it-imsize) (Unknown) (Thanks @Kinka for help)
- [markdown-it-emoji](https://github.com/markdown-it/markdown-it-emoji) (MIT License)
- [markdown-it-texmath](https://github.com/goessner/markdown-it-texmath) (MIT License)
- [mermaid 7.0.0](https://github.com/knsv/mermaid) (MIT License)
- [MathJax](https://www.mathjax.org/) (Apache-2.0)
- [showdown](https://github.com/showdownjs/showdown) (Unknown)
- [flowchart.js](https://github.com/adrai/flowchart.js) (MIT License)
- [PlantUML](http://plantuml.com/) (MIT License)
- [dom-to-image](https://github.com/tsayen/dom-to-image) (MIT License)
- [turndown](https://github.com/domchristie/turndown) (MIT License)
# License
VNote is licensed under the [MIT license](http://opensource.org/licenses/MIT).
## License
VNote is licensed under [GNU LGPLv3](https://opensource.org/licenses/LGPL-3.0). Code base of VNote could be used freely by VNoteX.

View File

@ -1,211 +0,0 @@
# VNote
- [英文 English](./README.md)
- [VNote主页](https://tamlok.github.io/vnote)
- [文档](http://vnote.readthedocs.io/en/latest/)
- [使用截图](https://tamlok.github.io/vnote/gallery.html)
- [相关文章](https://github.com/tamlok/vnote-posts)
**VNote** 是一个受Vim启发开发的专门为 **Markdown** 而优化、设计的笔记软件。VNote是一个更了解程序员和Markdown的笔记软件。
![VNote](screenshots/vnote.png)
# 下载
国内的用户可以尝试在[百度云盘](http://pan.baidu.com/s/1jI5HROq)下载VNote的最新发行版本。
## Windows
![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/tamlok/vnote?svg=true)
- [Github releases](https://github.com/tamlok/vnote/releases)
- master分支的最新构建[ ![Download](https://api.bintray.com/packages/tamlok/vnote/vnote/images/download.svg) ](https://bintray.com/tamlok/vnote/vnote/_latestVersion)
VNote不支持**XP**因为QtWebEngineProcess无法在XP上运行。
## Linux
### AppImage
[![Build Status](https://travis-ci.org/tamlok/vnote.svg?branch=master)](https://travis-ci.org/tamlok/vnote)
VNote当前为主要Linux发行版提供了一个AppImage格式的独立可执行文件。希望了解Linux系统下打包发布的开发人员能提供这方面进一步的帮助
- [Github releases](https://github.com/tamlok/vnote/releases)
- master分支的最新构建[ ![Download](https://api.bintray.com/packages/tamlok/vnote/vnote/images/download.svg) ](https://bintray.com/tamlok/vnote/vnote/_latestVersion)
### openSUSE
目前 openSUSE Tumbleweed 可以通过 OBS 上的 `home:opensuse_zh` 源直接安装。您可以直接执行以下命令:
```shell
sudo zypper ar https://download.opensuse.org/repositories/home:/opensuse_zh/openSUSE_Tumbleweed/ home:opensuse_zh
sudo zypper ref
sudo zypper in vnote
```
其他架构请直接在 [software.opensuse.org](https://software.opensuse.org) 搜索 `vnote`
由于 Leap 42 及以下版本的 Qt 版本过低,我们无法在 OBS 上进行打包。请使用 AppImage 或自行构建。
### Arch Linux
Arch Linux可以通过AUR中的 [vnote](https://aur.archlinux.org/packages/vnote/) 进行安装:
```shell
git clone https://aur.archlinux.org/vnote.git
cd vnote
makepkg -sic
```
AUR也提供一个和最新master分支同步的开发版本 [vnote-git](https://aur.archlinux.org/packages/vnote-git/) 。
## MacOS
[![Build Status](https://travis-ci.org/tamlok/vnote.svg?branch=master)](https://travis-ci.org/tamlok/vnote)
- [Github releases](https://github.com/tamlok/vnote/releases)
- master分支的最新构建[ ![Download](https://api.bintray.com/packages/tamlok/vnote/vnote/images/download.svg) ](https://bintray.com/tamlok/vnote/vnote/_latestVersion)
也可以通过 homebrew cask 进行安装:
```shell
brew cask install vnote
```
# 简介
**VNote**是一个基于Qt框架的、免费的开源笔记软件。VNote专注于Markdown的编辑与阅读以提供舒适的编辑体验为设计目标。
VNote不是一个简单的Markdown编辑器。通过提供笔记管理功能VNote使得编写Markdown笔记更简单和舒适
基于Qt框架VNote能够在主流操作系统上运行包括 **Linux**, **Windows** 以及 **macOS**
![VNote Main Interface](screenshots/_vnotemaini_1525154456_1561295841.png)
# 支持
- [Github issues](https://github.com/tamlok/vnote/issues)
- 邮箱: tamlokveer at gmail.com
- 微信公众号: VNote笔记vnote_md
![VNote WeChat](screenshots/vnote_md.jpg)
# 亮点
- 强大的**全文搜索**
- **通用入口**,通过按键操控一切;
- 直接从剪切板插入图片;
- 编辑和阅读模式下代码块的语法高亮;
- 强大的**原地预览**,包括图片、图表和公式;
- 针对图表的两边实时预览;
- 编辑和阅读模式下的大纲;
- 自定义编辑和阅读模式的样式;
- Vim模式以及一系列强大的快捷键
- 无限层级的文件夹;
- 多个标签页和窗口分割;
- [Mermaid](http://knsv.github.io/mermaid/)、 [Flowchart.js](http://flowchart.js.org/)、 [MathJax](https://www.mathjax.org/)、 [PlantUML](http://plantuml.com/) 和 [Graphviz](http://www.graphviz.org/)
- 支持高分辨率;
- 笔记附件;
- 主题以及深色模式;
- 丰富、可扩展的导出包括HTML、PDF、PDF多合一和图片
# 捐赠
您可以通过很多途径帮助VNote的开发。
- 持续关注VNote并反馈。
- 向您的朋友们推广和传播VNote。普及度是驱动开发者的一股强大力量。
- 参与到VNote的开发中发送PullRequest来帮助VNote变得更完美。
- 最后如果您觉得VNote真的帮助到您并且想回馈VNote非常感谢您的捐赠。
- PayPal: [PayPal.Me/vnotemd](https://www.paypal.me/vnotemd)
- 支付宝: `tamlokveer@gmail.com`
![Alipay](screenshots/alipay.png)
- 微信
![WeChat Pay](screenshots/wechat_pay.png)
非常感谢这些对VNote的 [捐赠者](https://github.com/tamlok/vnote/wiki/Donate-List) !
# 开发VNote的动机
## Markdown编辑器与笔记管理
VNote设计为带有笔记管理功能的Markdown编辑器或者有良好Markdown支持的笔记软件。如果您喜欢Markdown并经常在学习、工作和生活中使用Markdown记录笔记那么VNote就是一个适合您的工具。
## 舒适的Markdown体验
### Markdown的本质
Markdown作为一个简单标记语言不像富文本它的编辑和阅读有着与生俱来的隔阂。一般目前大概有三类方法来处理这个隔阂
1. 作为一个极端一些编辑器只是将Markdown作为无格式的纯文本处理。用户很容易在密密麻麻的黑漆漆的一片文字中找不着方向。
2. 大部分编辑器使用两个面板来同时编辑和预览Markdown笔记。从而用户可以在编辑的同时看到优美的排版和布局。但是两个面板基本会占据了整个屏幕而用户的目光焦点左右频繁移动往往也会使得用户无法专注编辑。
3. 作为另一个极端一些编辑器在用户输入文本后立即将Markdown的标记转换为HTML元素使得编写Markdown如同在Word文档里面编写富文本一样。
由于几乎所有的编辑器都选择第二种方法来处理隔阂一提到Markdown人们往往会想起预览。这可能是对Markdown的一个最大的误解了。设计为一个简单的标记语言Markdown的设计初衷就是为了在编辑的时候方便帮助跟踪文本的信息而又能在阅读的时候被转换为HTML为发布提供美观的排版输出。所以Markdown本身就应该在编辑的时候能够方便地跟踪和掌控文本的信息和脉络而不需要通过预览这种接近饮鸩止渴的方法来方便编辑。
### 折中VNote的方案
VNote尝试通过精心调配的**语法高亮**和其他一些特性来最大程度地减小Markdown的这种割裂感尽可能地提供一个*所见即所得*的编辑体验。用户在编辑的时候就能有效第把握内容脉络也就没有必要进行预览或者强制更改文本为HTML元素了。
# 功能
## 基于笔记本的管理
VNote使用 **笔记本** 来管理笔记。类似于OneNote一个笔记本可以保存在系统上的任意位置。一个笔记本对应于一个账户的概念。例如您可以在本地文件系统上有一个笔记本另外在某台OwnCloud服务器上保存另一个笔记本。当不同的笔记有不同的保密要求时独立的笔记本就非常适用了。
一个笔记本对应于文件系统上的一个独立完整的文件夹(称为笔记本的 **根目录** 。您可以将该文件夹拷贝到其他位置或者另一台计算机上然后将其导入到VNote中。
VNote支持一个笔记本中包含无限层级的文件夹。VNote支持在笔记本内或笔记本间拷贝或剪切文件夹和笔记。
## 直观的笔记管理
所有笔记被保存为纯文本而且通过纯文本的配置文件进行管理。即使没有VNote您也能方便访问您的数据。这样您也可以使用第三方的文件同步服务来同步您的笔记并在另一台计算机上导入到VNote中。
VNote支持Markdown和富文本笔记其中Markdown笔记必须以`md`为后缀名。
## 语法高亮
VNote支持精确的Markdown语法高亮。通过精心调试的高亮样式VNote使得您能够轻松跟踪和阅读您的文档。
VNote还支持Markdown编辑模式中代码块的语法高亮。目前的Markdown编辑器中绝大部分都尚不支持该特性。
![Syntax Highlight](screenshots/_1513485266_1616037517.png)
## 原地预览
VNote支持在编辑时原地预览图片、图表和公式。
![In-Place Preview](screenshots/_inplacepre_1525155248_405615820.png)
## 良好的图片体验
编辑时支持像其他富文本编辑器一样直接粘贴插入图片VNote会帮您管理所插入的图片。VNote将这些图片保存在和笔记同一目录下的一个指定目录中。插入图片时VNote会弹出一个窗口预览即将要插入的图片。另外当您移除笔记中的图片链接时VNote会自动删除对应的图片文件。
![Pleasant Image Experience](screenshots/_1513485753_394180887.png)
## 通用入口和全文搜索
VNote内置强大的全文搜索支持**正则表达式**和**模糊搜索**。搜索可以指定范围,包括全部笔记本、当前笔记本和当前文件夹,也可以指定目标,如名字或内容。
![Full-Text Search](screenshots/_1522894671_1711734243.png)
类似于Vim中的`CtrlP`VNote支持**通用入口**,可以在一个输入框中进行搜索或跳转。
![Universal Entry](screenshots/_universale_1522894821_465772669.png)
## 编辑和阅读模式中的交互式大纲视图
VNote为编辑和预览模式都提供了一个用户友好的大纲视图。该大纲视图是一个项目树而不是简单地插入一段HTML。
## 强大的快捷键
VNote提供很多快捷键从而提供一个愉悦的编辑体验。其中包括 **Vim模式**、**舰长模式** 和 **导航模式**,它们能让您完全摆脱鼠标进行操作。
更多细节请参考帮助菜单中的[快捷键帮助](src/resources/docs/shortcuts_zh.md)。
## 高度可定制
VNote中几乎一切都是可以定制的例如背景颜色、字体以及Markdown样式等。VNote使用一个纯文本文件来记录您的所有配置因此通过拷贝该文件就能够很快地在另一台电脑上初始化一个新的VNote。
# 依赖
- [Qt 5.9](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)
- [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote) (MIT License)
- [markdown-it-sub](https://github.com/markdown-it/markdown-it-sub) (MIT License)
- [markdown-it-sup](https://github.com/markdown-it/markdown-it-sup) (MIT License)
- [markdown-it-front-matter](https://github.com/craigdmckenna/markdown-it-front-matter) (MIT License)
- [markdown-it-imsize](https://github.com/tatsy/markdown-it-imsize) (Unknown) (Thanks @Kinka for help)
- [markdown-it-emoji](https://github.com/markdown-it/markdown-it-emoji) (MIT License)
- [markdown-it-texmath](https://github.com/goessner/markdown-it-texmath) (MIT License)
- [mermaid 7.0.0](https://github.com/knsv/mermaid) (MIT License)
- [MathJax](https://www.mathjax.org/) (Apache-2.0)
- [showdown](https://github.com/showdownjs/showdown) (Unknown)
- [flowchart.js](https://github.com/adrai/flowchart.js) (MIT License)
- [PlantUML](http://plantuml.com/) (MIT License)
- [dom-to-image](https://github.com/tsayen/dom-to-image) (MIT License)
- [turndown](https://github.com/domchristie/turndown) (MIT License)
# 代码许可
VNote使用[MIT许可](http://opensource.org/licenses/MIT)。

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,78 +0,0 @@
image: Visual Studio 2015
version: 1.22.{build}
branches:
only:
- master
environment:
COMPILER: msvc
VSVER: 14
matrix:
- QT: C:\Qt\5.9\msvc2015_64
PLATFORM: amd64
- QT: C:\Qt\5.9\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
- qmake --version
- mkdir build
- cd build
- if "%PLATFORM%" EQU "X64" (qmake -r -spec win32-msvc CONFIG+=x86_64 CONFIG-=debug CONFIG+=release ../VNote.pro)
- if "%PLATFORM%" EQU "x86" (qmake -r -spec win32-msvc 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.22
# Clone OpenSSL DLLs
- git clone https://github.com/tamlok/openssl-utils.git openssl-utils.git
- 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"
- copy "distrib\VNote\VNote.exe" "distrib\VNote_win_%PLATFORM%.exe"
# Delete translations\qt_*.qm
- del /F /Q "distrib\VNote\translations\qt_*.qm"
# Copy OpenSSL DLLs
- if "%PLATFORM%" EQU "X64" (xcopy "openssl-utils.git\win64\*.dll" "distrib\VNote")
- if "%PLATFORM%" EQU "x86" (xcopy "openssl-utils.git\win32\*.dll" "distrib\VNote")
- 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
- path: build\distrib\VNote_win_%PLATFORM%.exe
name: exe_only
deploy:
- provider: BinTray
username: tamlok
api_key:
secure: YJqzsVDlC2NYH2RgzbUMtjZWbSXOdWUiiENOIqImo31hOfeiB0MiVGmBLmKPAHEg
subject: tamlok
repo: vnote
package: vnote
version: 1.22
publish: true
override: true
artifact: portable

View File

@ -1,264 +1,256 @@
# Changes History
## v1.22
- Editor
- Support parsting HTML as converted Markdown text;
- Improve performance of in-place preview;
- Be aware of links, images, and in-place preview in edit mode (visit or copy);
- Support exporting and copying PlantUML and Graphviz diagram in edit mode;
- Support middle click to close a tab;
- Support searching files via multiple tags, such as "vnote && markdown";
# Changes
## v3.19.2
* Codesign MacOS Bundle
* Fix toolbar expansion button style
* Support hot-reloading of theme via --watch-themes option
## v1.21
- Improve performance of editor (now could process 10K lines);
- Support `<mark>vnote</mark>` highlight in edit mode;
- Support **completion** in edit mode by `Ctrl+N/P`;
- Support building a notebook from external directory recursively;
- Update Flowchart.js to 1.11.3;
## v3.19.1
* Fix toolbar button in Qt 6.8
## v1.20
- More efficient and accurate Markdown parser and highlighter;
- MathJax: get rid of escaping;
- Draw background for **hrule** in edit mode;
- Support specifying the expanded level of outline;
- Support drag&drop a directory to Explorer to open it;
- `Ctrl+;` to insert inline code and `Ctrl+J/K` to scroll page in edit mode;
- Support YAML front matter in edit mode;
- Support searching Explorer root directory;
## v3.19.0
* Add VSCode-sytle editor shortcuts
## v1.19
- Support tags for notes;
- UniversalEntry: support searching tags;
- WebView: click an image or diagram to view it in read mode;
- Add test buttons for PlantUML and Graphviz in settings dialog;
- CaptainMode: Y to focus to the edit area;
## v3.18.1
* Fix crash caused by Qt6 change
* Fix XSS protection exemption
* Check link before open
## v1.18
- Explorer: fix the crash when no root entry is set;
- New dark theme **v_detorte** from a Vim *detorte* theme;
- Support maximizing split or distributing splits;
- Refine styles and HiDPI support;
## 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==`
## v1.17
- Add **History** to browse history;
- Add **Explorer** to browse external files;
- Support view order in note list;
- Support relative path for notebook;
- UniversalEntry
- Fix input method issue on macOS;
- Add `j` for listing and searching History;
- Support customized zoom delta of editor;
- Add cache for in-place preview;
- Better support for hiDPI;
- Lazy initialization;
- Support stay-on-top;
## 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
## v1.16
- Markdown-it: supports specifying image size, emoji, and YAML metadata;
- Bug fixes;
## 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
## v1.15
- Support **PlantUML** and **Graphviz**;
- **In-Place Preview** for MathJax, PlantUML, Graphviz, and Flowchart.js;
- **Live Preview** for diagrams via `Ctrl+E I`;
- Restore cursor position when recovering pages at startup;
- UniversalEntry
- Ctrl+I to expand/collapse current item;
- Ctrl+L to go to current item's parent item;
- Markdown-it: aware of YAML format metadata in notes;
- Show hovered link in status line in read mode;
- Export: support embedding images as data URI into HTML pages;
## v3.15.1
* Add two themes
* Bug fixes
## v1.14
- Support **Universal Entry** by `Ctrl+G`;
- Single click a note in note list to open it in a new tab by default;
- Translate `Ctrl` in default shortcuts to `Meta` on macOS;
- Do not copy files when import if they locate in current folder;
## 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
## v1.13
- Replace **v_white** theme with **v_native**, which behaves more like native applications;
- Support **full-text search**;
- Support `&&` and `||` logics (space-separated keywords are treated as AND);
- Enhanced export;
- Support MHTML format;
- Support All-In-One PDF via tool *wkhtmltopdf*;
- Support *pandoc* and random tool for custom export;
- Support **Word Count** information in both read and edit mode;
- Support SavePage action in read mode;
- Support *back reference* in replace text via `\1`, `\2`, and so on;
- Support sorting in Cart;
- Support sorting notes and folders via name or modification date;
- Support both `flow` and `flowchart` as the language of *flowchart.js* diagram;
- Add PasteAsBlockQuote menu action to paste text as block quote from clipboard;
- Add options for Markdown-it to support subscript and superscript;
- Better support for 4K display;
## v3.14.0
* Theme: support custom icons
* Theme: refine icons
* NavigationMode: fix issue for input method
## v1.12
- Combine `EditNote` and `SaveExitNote` as `EditReadNote` (`Ctrl+T`);
- Support exporting notes as Markdown, HTML, and PDF;
- Support simple search in directory tree, file list, and outline;
- Support copying selected text as HTML in edit mode;
- Support copying text to Evernote, OneNote, Word, WeChat Public Account editor and so on;
- Support auto-save;
- Support fullscreen mode and hiding menu bar;
- Support `Ctrl+H/W/U` to delete text in most line edits;
- Support zooming in/out in edit mode;
- Support MathJax in fenced code block with language `mathjax` specified;
- More shortcuts;
- Add **Cart** to collect notes for further processing;
- Output built-in themes on start of VNote;
- `Esc` to exit edit mode when Vim mode is disabled;
- Support Vim command line for search in read mode;
- Support printing;
- Single click in file list to open file in current tab, double clicks to open in a new tab;
## v3.13.1
* Shortcuts for Copy/Paste/Properties in node explorer
* Global shortcut to call out main window
* UnitedEntry: bug fix for macOS
## v1.11.1
- Refine copy function in read mode. Better support for copying and pasting into OneNote or WeChat editor;
- Do not highlight code blocks without language specified by default;
- Refine themes and styles;
- Support foreground for selected/searched word in MDHL style;
- Support shortcuts for external programs;
- Support resetting VNote;
- Cover more scenarios for Chinese translations;
## v3.13.0
* United Entry: migration of Universal Entry
## v1.11
- Support themes;
- Three built-in mordern themes;
- One dark mode theme;
- Vim mode
- Support block cursor in Normal/Visual mode;
- `=` to auto-indent selected lines as the first line;
- Support custom external editors to open notes;
- Enable `Ctrl+C`/`Ctrl+V` in Vim mode to copy/paste;
- Support Flash Page to record ideas quickly;
- Support previewing inline images;
## 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
## v1.10
- Migrate to Qt 5.9.1;
- Support Compact mode in main window;
- Update icons;
- Support custom startup pages;
- Remove obsolete title marker when inserting new one;
- Support Magic Words;
- Vim mode
- Share registers among all tabs;
- Support `Ctrl+O` in Insert mode;
- Add "Code Block", "Insert Link", and "Insert Image" tool bar buttons;
- Support `Ctrl+Shift+T` to recover last closed tabs;
- Support view read-only files in edit mode;
- Refactor editor for speed;
- Support templates when creating notes;
- Support snippets;
- Support file change check;
- Support backup file (save changes automatically);
## 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
## v1.9
- Support attachments of notes.
- Add recycle bin to notebook to hold deleted files.
- Refine Vim mode:
- Support J and gJ to join line;
- Support S, {, and };
- <leader>w to save note;
- Fix Y and D actions in Visual mode.
- Support AppImage package for Linux.
- More responsive and efficient syntax highlight and image preview.
- More pleasant line distance.
- More natural interaction of folder and note management.
- Support inserting note name as title.
- Support custom default mode to open a note.
- Support auto heading sequence.
- Support color column in fenced code block in edit mode.
- Support line number in code block in both read and edit mode.
- Support created time and modified time of notes, folders, and notebooks.
- Support custom Markdown-it options, such as auto line break.
- Confirm when cleaning up unused images.
- Support custom Mathjax location.
- Support custom style for code block highlights in read mode.
- Double click on a tab to close it.
## 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
## v1.8
- Support editing external files. VNote could open files from command line.
- Support drag-and-drop to open external files.
- Refine tab context menu.
- Support system tray icon.
- Refine Vim mode.
- Make all tool buttons always visible and smaller.
- Support custom file type suffix.
- Make the name of notebook/folder/note case-insensitive.
- Support links to internal notes in notes.
## v3.10.1
* MarkdownEditor: fix view mode issue
* Support print
* Refine icons
## v1.7
- ATTENTION: please add font-size option to the "editor" section of your custom MDHL style.
- Refine Vim mode (more functions, please refer to the shortcuts help).
- Support Find in Vim mode.
- Refine tab context menu.
- Support Flowchart.js for flowchart.
- Add toolbar for common text edit functions.
- Support line number (both absolute and relative) in edit mode.
- Support custom shortcuts.
- Support [[, ]], [], ][, [{, ]} to navigate through titles in both edit and read mode.
- Many minor bug fixes.
## v3.10.0
* MarkdownEditor
* Support side-by-side edit with preview
* Support config for highlighting whitespace
* Tag: fix input method issue on macOS
## v1.6
- Support simple but powerful **Vim mode**.
- Change the shortcut of ExitAndRead from `Ctrl+R` to `Ctrl+T`.
- Add a edit status indicator in the status bar.
- Dragging mouse with Ctrl and left button pressed to scroll in read and edit mode.
- Refine highlighting cursor line.
- Support subscript, superscript and footnote in markdown-it renderer.
- Refactor outline logics to not show extra [EMPTY] headers.
- Handle HTML comments correctly.
- Provide a default root folder when adding notebooks.
- Support check for updates.
- Redraw app icons.
- Many minor bug fixes.
## 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
## v1.5
- Support logging in release mode.
- Fix Chinese font matching in mdhl.
- Fix VimagePreviewer to support optional title.
- Refactor local image folder logics.
- Support custom local image folder for both notebook scope and global scope.
- Support constraining the width of images in read mode.
- Fix and refine default style.
- Centering the images and display the alt text as caption in read mode.
- Support exporting a single note as PDF file.
- Add "Open File Location" menu item in folder tree and note list.
- Support highlighting trailing space.
## 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
## 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.
## 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
## 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.6.0
* Support **Image Host**: GitHub and Gitee
* Add config page for Vi
## 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.5.1
* LocationList: fix recently introduced regression when highlighting segments of text
## 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.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

6
debian/changelog vendored
View File

@ -1,6 +0,0 @@
vnote (1.8-0ubuntu1) zesty; urgency=medium
* Initial release
* Adjusted the Makefile to fix $(DESTDIR) problems.
-- Le Tan <tamlokveer@gmail.com> Sun, 20 Aug 2017 09:32:22 +0800

1
debian/compat vendored
View File

@ -1 +0,0 @@
9

17
debian/control vendored
View File

@ -1,17 +0,0 @@
Source: vnote
Section: editors
Priority: optional
Maintainer: Le Tan <tamlokveer@gmail.com>
Build-Depends: debhelper (>=9), qt5-default (>= 5.7.1), libqt5svg5-dev, qtwebengine5-dev, libqt5webchannel5-dev, qtpositioning5-dev
Standards-Version: 3.9.6
Homepage: https://tamlok.github.io/vnote
Vcs-Browser: https://github.com/tamlok/vnote.git
Package: vnote
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libQt5WebEngineWidgets (>= 5.7.1), libQt5WebEngineCore, libQt5PrintSupport, libQt5Widgets, libQt5Gui, libQt5WebChannel, libQt5Network, libQt5Core
Suggests: libssl
Description: A Vim-inspired note-taking application for Markdown.
VNote is a cross-platform, free note-taking application, designed especially
for Markdown. VNote provides both simple note management and pleasant Markdown
edit experience.

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)

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

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,133 +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_FENCEDCODEBLOCK, /**< Fenced code block */
pmh_NOTE, /**< Note */
pmh_STRIKE, /**< Strike-through */
pmh_FRONTMATTER, /**< Front matter */
pmh_DISPLAYFORMULA, /**< Math display formula */
pmh_INLINEEQUATION, /**< Math inline equation */
pmh_MARK, /**< HTML <mark> tag content */
// 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 36
/**
* \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 */
pmh_EXT_FRONTMATTER = (1 << 2), /**< YAML meta data */
pmh_EXT_MATH = (1 << 3), /**< Math */
pmh_EXT_MARK = (1 << 4), /**< HTML <mark> tag content */
};
#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,937 +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)
{
raw_attribute *pattr = NULL;
if (cur->name != NULL) free(cur->name);
if (cur->value != NULL) free(cur->value);
pattr = cur;
cur = cur->next;
free(pattr);
}
}
static void report_error(style_parser_data *p_data,
int line_number, char *str, ...)
{
va_list argptr;
if (p_data->error_callback == NULL)
return;
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;
ret->strikeout = 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 *pattr = cur;
cur = cur->next;
free(pattr);
}
}
#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 *pvalue = cur;
multi_value *next_cur = cur->next;
free(pvalue->value);
free(pvalue);
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 if (EQUALS(standardized_value, "strikeout"))
attr->value->font_styles->strikeout = 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 *pblock = cur;
block *next = pblock->next;
free_multi_value(pblock->lines);
free(pblock);
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)
{
raw_attribute *attributes_head = NULL;
raw_attribute *attributes_tail = 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);
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,149 +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;
bool strikeout;
} 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

View File

Before

Width:  |  Height:  |  Size: 29 KiB

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

View File

Before

Width:  |  Height:  |  Size: 44 KiB

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: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 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