1889 Commits

Author SHA1 Message Date
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
Le Tan
321289c8e0 add VNote::editorAndBrowserFont for setting font in QTextEdit and QTextBrowser
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-09 22:37:45 +08:00
Le Tan
5ff4382f90 support for local image in markdown
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-09 22:06:55 +08:00
Le Tan
7bce2cb298 use QWebEngineView to display markdown files
Thanks to [marked JavaScript library](https://github.com/chjj/marked) by
Christopher Jeffrey. The
[style sheet](http://kevinburke.bitbucket.org/markdowncss/markdown.css)
was created by Kevin Burke.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-09 20:47:20 +08:00
Le Tan
4260962e23 add submodules marked from Christopher Jeffrey
Add submodules marked from https://github.com/chjj/marked.git.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-07 22:13:38 +08:00
Le Tan
e3e18d040c use QStackedWidget to hold QTextBrowser and VEdit
Use QTextBrowser to display file in read mode and VEdit to display file
in edit mode.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-07 21:55:30 +08:00
Le Tan
b55ebe8f91 use itemClicked signal instead of currentItemChanged to trigger opening a file
This will handle the corner case: when user open file "f" and close it,
this file is still current item, so if user want to re-open it by
clicking on it, it won't work.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-07 11:07:43 +08:00
Le Tan
3f8c87a325 add basic logics for handling html file
Add edit/read/save logics for html file.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-07 10:56:28 +08:00
Le Tan
504e3323cf display selected file in a QTabWidget
Add VTabWidget and VEdit to display content of files.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-06 22:33:55 +08:00
Le Tan
b47c9f3368 bug-fix: currentItemChanged() may have NULL pointer
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-06 13:30:42 +08:00
Le Tan
9dd22760fc add VFileList to browse the files in current directory
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-06 12:55:00 +08:00
Le Tan
0f7f433833 move config logics to VConfigManager
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-05 17:13:40 +08:00
Le Tan
5d08a6f93d implement delete directory action to VDirectoryTree
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-05 15:19:17 +08:00
Le Tan
09f6415536 implement VDirectoryTree logics
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-05 14:28:48 +08:00
Le Tan
d8c5114c1b read/write the info about notebooks
Use QSettings to store notebooks info in INI format.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-02 13:38:05 +08:00
Le Tan
811172ef8a initial commit for VNote
VNote is a Vim-Like Note for Markdown.

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