GSoC/2019/StatusReports/SonGeon: Difference between revisions

From KDE Community Wiki
< GSoC‎ | 2019‎ | StatusReports
(add songeon gsoc 2019)
 
(final report)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Title of your project ==
== kmarkdown-qtview with WYSIWYG markdown editor ==
kmarkdown-qtview with WYSIWYG markdown editor
 
Details about your project
==Details about project==
 
[https://jen6.github.io/2019/05/hi-kde-hi-gsoc2019.html kmarkdown-qtview project detail]
[https://jen6.github.io/2019/05/hi-kde-hi-gsoc2019.html kmarkdown-qtview project detail]
First, most markdown editors are using webview based renderer. But webview based editors have the lack of printing options. Because Markdown is aiming to make a good looking document with simple text notations on the web environment. In a single webpage, It doesn’t have pagination for printing.
So webview based renders have the same problems. For example, document elements are printed across multiple pages and the document’s paragraphs, word spacing, and line spacing are slightly different compared to the screen. If the markdown editor support the preview of the paging, better text rendering with the layout of printing, It will be more powerfull like word processors.
Second, the KDE project already has the markdown renderer kmarkdownWebview. Currently, It has a forked third-party javascript library for markdown rendering. I want to minimize the dependencies. And It use the Qt’s QWebEngine and QWebChannel. Those are used to run a JS library and It brings a lot of overhead.
I think writing new renderer using Qt API and C++ without a third-party library is a lighter approach. So I choose to make parser with the Boost Spirit. It’s the PEG parser generator implemented in the boost library and It’s super fast.
== Final Progress ==
1. Parsing Part
* Done : basic emphasizes (bold, cancle.. ETC), header, link, blockquote
* ToDo : list, refactoring the ast to regenerate string
<br>
2. Viewer Part
* Done : emphasize, header, link, blockquote, wsiwyg for emphasizes
* ToDo : find effective way to regenerate string, html insertion, stylesheet
<br>
3. ReadWrite Part
* Done : viewer, editing
* ToDo : save
== Source Code ==
[https://cgit.kde.org/scratch/songeon/kmarkdownparser.git go to cgit.kde.org]
== Dependency ==
* Qt5
* Boost > 1.69
* KParts
== How To Use ==
1. git clone git://anongit.kde.org/scratch/songeon/kmarkdownparser.git
2. cmake ./
3. make; mv libkmarkdownparserpart.so shellexample/
4. cd shellexample
== Work report ==
== Work report ==
2019-08-22 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?h=readwritepart&id=e37b672b62c33ba84ea43f7fea5332a15d8bcb75 change string generation from ast]
2019-08-21 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?h=readwritepart&id=4cd8b68a07958eb03ed4c16a19d33901a59adab3 change emphasize string generation part.]
2019-08-20 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?h=readwritepart&id=3bc9a920296d500302436f69a9c4f13c70f4fc58 add wiswyg features for ephasizes]
2019-08-18 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?h=readwritepart&id=590106a2aac6500ee6570f4f9c1328df5573da36 split the link to hyperlink and image link. and make ast::string to include the ast::emphasizeString to reduce the redundant codes.]
2019-08-16 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?h=readwritepart&id=4e30c95dc4fe3977ee5a5acd1ace17eb4a58e9b5 refactor the code and change the attribute rendering to insert the html code]
2019-08-15 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?h=readwritepart&id=c5bcfcf48aaa087fb02caea558dcd2000629886c add link]
2019-08-10 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=b67ef5136f8dc23ece2c255619baf5388c8b9296 add concurrent parsing]
2019-08-7 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=2dac008ed8e194026ce47cd4523e670d4e1dc2aa change the document's rendering working not include the tokens]
2019-07-25 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=b10bcb670b4a09904ac72f807ede30934f9caa32 add blockquote add attribute types for the tokens]
2019-07-25 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=5add3db1451977084529178ec0f39c9628d269a0 change postagging to use c++ 2017 auto template and constexpr]
2019-07-23 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=1f5568dbd81dd91ee9d8d4c3a9b868bbdd91accb add position tag in the token]
2019-07-22 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=f721c47fdbafb2a0b227ea4f82ded08d9df28eaa add cancleline and change code to use tokens]
2019-07-16 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=90bd0b07c40e46c160f0a258a9e75fdece696126 make simple shell program. Thanks to Eike]
2019-07-16 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=4532cd8c937d6dc0a90168bdd761e54597fba4a8 add kpart implementation]
2019-07-09 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=9798087c2acc546db02e846abf7cd9aa60d5dd10 refactor ast structure]
2019-06-29  Make Header view
2019-06-25  start make a qt view
2019-06-20  Make Idea about new structure
2019-06-10 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=3efa23f8cfba25e25725221c6ecd2d5c3a71aab3 add licensing header on source code]
2019-06-05 [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=0346a973623e516fc4ed5958a3ee4ef6aad1d3cb add EmphasizedString for parsing text with emphasize tokens]
2019-06-05    [https://cgit.kde.org/scratch/songeon/kmarkdownparser.git/commit/?id=227e12918cbe4f7ccbccfade4f82fac54a54ae07 basic project structure]


== Links to Blogs and other writing ==
== Links to Blogs and other writing ==
[https://jen6.github.io jen6.github.io]
My Blog link : [https://jen6.github.io jen6.github.io]
 
 
1. [https://jen6.github.io/2019/05/hi-kde-hi-gsoc2019.html First GSOC Project Introduction]
 
On this summer I’m working with the KDE community by participating the “Google Summer of Code” Program.
My main goal during GSOC period is making a markdown view, WYSIWIG editor using C++ and Qt.
There were two reasons that I started to make a new markdown view.
First, most markdown editors are using webview based renderer. But webview based editors have the lack of printing options. Because Markdown is aiming to make a good looking document with simple text notations on the web environment. In a single webpage, It doesn’t have pagination for printing. ...
 
2. [https://jen6.github.io/2019/06/first-week-of-gsoc-piece-table-implement.html First week of GSOC, Piece Table Implement]
 
first, I started to make the markdown parser using the Boost Spirit X3.
Spirit makes easy to express grammar using the PEG. But it’s templet based library so it was hard to find out which part is wrong. Also documentation of spirit was limited.
So I had a lots of trial and error to get compilable source code....

Latest revision as of 11:24, 24 August 2019

kmarkdown-qtview with WYSIWYG markdown editor

Details about project

kmarkdown-qtview project detail

First, most markdown editors are using webview based renderer. But webview based editors have the lack of printing options. Because Markdown is aiming to make a good looking document with simple text notations on the web environment. In a single webpage, It doesn’t have pagination for printing.

So webview based renders have the same problems. For example, document elements are printed across multiple pages and the document’s paragraphs, word spacing, and line spacing are slightly different compared to the screen. If the markdown editor support the preview of the paging, better text rendering with the layout of printing, It will be more powerfull like word processors.

Second, the KDE project already has the markdown renderer kmarkdownWebview. Currently, It has a forked third-party javascript library for markdown rendering. I want to minimize the dependencies. And It use the Qt’s QWebEngine and QWebChannel. Those are used to run a JS library and It brings a lot of overhead.

I think writing new renderer using Qt API and C++ without a third-party library is a lighter approach. So I choose to make parser with the Boost Spirit. It’s the PEG parser generator implemented in the boost library and It’s super fast.

Final Progress

1. Parsing Part

  • Done : basic emphasizes (bold, cancle.. ETC), header, link, blockquote
  • ToDo : list, refactoring the ast to regenerate string


2. Viewer Part

  • Done : emphasize, header, link, blockquote, wsiwyg for emphasizes
  • ToDo : find effective way to regenerate string, html insertion, stylesheet


3. ReadWrite Part

  • Done : viewer, editing
  • ToDo : save

Source Code

go to cgit.kde.org

Dependency

  • Qt5
  • Boost > 1.69
  • KParts

How To Use

1. git clone git://anongit.kde.org/scratch/songeon/kmarkdownparser.git

2. cmake ./

3. make; mv libkmarkdownparserpart.so shellexample/

4. cd shellexample

Work report

2019-08-22 change string generation from ast

2019-08-21 change emphasize string generation part.

2019-08-20 add wiswyg features for ephasizes

2019-08-18 split the link to hyperlink and image link. and make ast::string to include the ast::emphasizeString to reduce the redundant codes.

2019-08-16 refactor the code and change the attribute rendering to insert the html code

2019-08-15 add link

2019-08-10 add concurrent parsing

2019-08-7 change the document's rendering working not include the tokens

2019-07-25 add blockquote add attribute types for the tokens

2019-07-25 change postagging to use c++ 2017 auto template and constexpr

2019-07-23 add position tag in the token

2019-07-22 add cancleline and change code to use tokens

2019-07-16 make simple shell program. Thanks to Eike

2019-07-16 add kpart implementation

2019-07-09 refactor ast structure

2019-06-29 Make Header view

2019-06-25 start make a qt view

2019-06-20 Make Idea about new structure

2019-06-10 add licensing header on source code

2019-06-05 add EmphasizedString for parsing text with emphasize tokens

2019-06-05 basic project structure

Links to Blogs and other writing

My Blog link : jen6.github.io


1. First GSOC Project Introduction

On this summer I’m working with the KDE community by participating the “Google Summer of Code” Program. My main goal during GSOC period is making a markdown view, WYSIWIG editor using C++ and Qt. There were two reasons that I started to make a new markdown view. First, most markdown editors are using webview based renderer. But webview based editors have the lack of printing options. Because Markdown is aiming to make a good looking document with simple text notations on the web environment. In a single webpage, It doesn’t have pagination for printing. ...

2. First week of GSOC, Piece Table Implement

first, I started to make the markdown parser using the Boost Spirit X3. Spirit makes easy to express grammar using the PEG. But it’s templet based library so it was hard to find out which part is wrong. Also documentation of spirit was limited. So I had a lots of trial and error to get compilable source code....