215 Commits

Author SHA1 Message Date
Le Tan
de44760cf3 use virtual destructor in VEditOperations
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-02 22:16:56 +08:00
Le Tan
2bbffb9002 change icons from png to svg
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-02 22:09:31 +08:00
Le Tan
435d47bb74 support downloading image from URL
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-01 22:58:19 +08:00
Le Tan
047c26b598 support pasting image in markdown
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-31 22:43:59 +08:00
Le Tan
ec7850685e update a more friendly toolbar
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-30 22:43:30 +08:00
Le Tan
a6774fdf49 handle nokebook renaming correctly
We do not allow modifying the path of an existing notebook.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-30 18:02:41 +08:00
Le Tan
49020d9fb2 do not inherit QListWidget in VFileList
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-30 17:44:21 +08:00
Le Tan
35f8d7350c VEdit set the modified to false when saving file
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-30 17:19:02 +08:00
Le Tan
53bce98db6 support changing rendering background color
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-28 21:06:26 +08:00
Le Tan
0c3fc3b006 support changing background color of editor
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-27 22:41:41 +08:00
Le Tan
8960358feb expand tab to spaces
Add configuration "tab_stop_width" and "is_expand_tab". Expand tab to
tab_stop_width spaces if is_expand_tab is true.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-27 10:23:38 +08:00
Le Tan
2bd3194af6 clear the [notebooks] section first before storing new one
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-26 21:50:38 +08:00
Le Tan
1f80fb8583 add VFileListPanel as a wrapper of VFileList
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-26 18:09:07 +08:00
Le Tan
5409ce9769 refactor directory and file related logics
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-25 22:25:34 +08:00
Le Tan
51d0eedcb2 fix HGMarkdownHighlighter regular expression
Change the default markdown.css.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-25 10:21:31 +08:00
Le Tan
6a3fdf63a2 implement dirInfoBtn logics
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-23 22:11:17 +08:00
Le Tan
30766f5738 remove "name" parameter in directory config file
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-23 19:49:21 +08:00
Le Tan
be625f561c implement notebookInfoBtn logics
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-23 18:07:05 +08:00
Le Tan
b85bf8bdc7 add menus and toolbars
1. Add menu item "Converter" to choose markdown converter;
2. Add menu item "About" and "About Qt";
3. Change all QMessageBox's parent to "this";

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-23 13:12:32 +08:00
Le Tan
f06be44496 update hoedown.pro to make it work on Windows
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-23 11:03:37 +08:00
Le Tan
a983026552 add Hoedown for markdown convertion
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-23 10:35:31 +08:00
Le Tan
5fa07864a1 move source stuff into src subdir
Make it convenient to add third-party libraries.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-22 14:11:33 +08:00
Le Tan
c7e631fa02 update forcely in VFileList to repaint
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-21 21:24:29 +08:00
Le Tan
6b59886847 handle note deletion and creation friendly
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-21 14:41:35 +08:00
Le Tan
2dd84bdc93 add Ctrl+S to save file
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-20 22:19:16 +08:00
Le Tan
17c136f11d modify the heading highlight in default.mdhl
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-20 21:58:26 +08:00
Le Tan
7d77002c53 change the policy of resizing the buffer when highlighting
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-20 21:54:56 +08:00
Le Tan
29609f0b65 change HGMarkdownHighlighter to use QSyntaxHighlighter
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-19 22:49:45 +08:00
Le Tan
4a1c5e0a91 fix markdown.css
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-17 23:01:13 +08:00
Le Tan
a73090b6d7 support importing notes from files
Add menu action importNoteAct to import notes from files. Currently only
HTML and Markdown files are supported. Importing other files (such as
txt) may not work correctly.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-17 22:53:26 +08:00
Le Tan
359f886732 small fix
1. Use `Dir::homePath()` when creating QFileDialog;
2. Add `overflow:auto` to `pre` in markdown.css;

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-17 21:33:48 +08:00
Le Tan
f31272966e support deleting notebook
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-17 21:17:52 +08:00
Le Tan
5506cec07b adjust QTextEdit property in VEdit
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-17 21:15:02 +08:00
Le Tan
4323797602 fix markdown.css to wrap text in code block
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-17 13:19:46 +08:00
Le Tan
4d9946bfe1 support creating new notebook
Thanks to [benjsperry](https://github.com/driftyco/ionicons) for the
icons.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-17 11:28:37 +08:00
Le Tan
8d9278f491 use VConfigManager to hanlde configurations
Move config related stuff to VConfigManager. For a config value,
VConfigManager will first try to look it up in the user-scoped vnote.ini
config file, if it is empty, then try to look it up in the default
vnote.ini.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-16 14:47:57 +08:00
Le Tan
c8d9745253 highlight code block using regular expression
peg-markdown-highlight can't hanlde code blocks with "#" correctly. Use
regular expression to fix it to avoid mis-interpret the "#" line as a
heading.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-15 21:15:54 +08:00
Le Tan
2adbd7c409 support font family settings in editor style
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-14 11:56:47 +08:00
Le Tan
eb5b6a6276 support font family style in markdown highlighting
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-13 23:07:06 +08:00
Le Tan
88633d22da change the layout of the directory panel
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-13 21:15:20 +08:00
Le Tan
1b220efb64 change default markdown highlight styles
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-13 21:03:30 +08:00
Le Tan
d22f0124d3 add VStyleParser as a wrapper of pmh_styleparser
Use VStyleParser to read .mdhl style file for markdown highlighting.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-13 17:08:39 +08:00
Le Tan
33f62915e1 clean up HGMarkdownHighlighter
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-12 21:05:41 +08:00
Le Tan
22bf96c6e3 add peg-markdown-highlight for markdown editing highlight
[peg-markdown-highlight](https://github.com/ali-rantakari/peg-markdown-highlight.git)

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-11 23:23:11 +08:00
Le Tan
772e0e95c8 speed up html displaying
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-11 22:17:51 +08:00
Le Tan
1cd8a9740d modify markdown html CSS
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-11 21:24:29 +08:00
Le Tan
96dffa3a8c fix template.html
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-11 09:42:11 +08:00
Le Tan
8e3e78622a utilize highlight.js to highlight code blocks
Use [Highlight.js](https://github.com/isagalaev/highlight.js.git) to
highlight code blocks.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-10 22:51:19 +08:00
Le Tan
daeed51f94 add TOC support to marked
Use `[TOC]` in markdown to generate a table of content.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-10 22:07:54 +08:00
Le Tan
e1c2204733 Set TextCodec to UTF8
For now QTextEdit seems handle the Chinese correctly.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-10 17:04:27 +08:00