[Qt-creator] QtCreator Markdown Plugin

ahmet erdinc yilmaz ahmeterdincyilmaz at gmail.com
Mon Apr 12 17:51:44 CEST 2021


I'm very glad to hear that you liked the plugin, thank you!

As discussed in https://forum.qt.io/topic/124822/qtcreator-markdown-plugin,
I really want that it is included QtCreator by default, but I don't know
whether it is possible or not for the following reasons:

- Plugin depends on qtwebengine and qtwebchannel modules which do not ship
with the QtCreator by default.
- Plugin uses javascript for parsing markdown.

Also I really did not want to add these dependencies. As Cristian mentioned
the c++ alternatives, I tried c++ markdown parsers at first. I played with "
https://github.com/progsource/maddy" but at the very first examples they
failed. I did not find any c++ parser that maintained properly. Then I find
"https://github.com/markedjs/marked" (js markdown parser) which is  highly
maintained and used. It has many tests which are actively developed. Then I
realized that it is not an easy task. Markedjs is being maintained by 126
developers and used by 603k clients. Also has 24.8k stars. This library is
really mature (By the way, I hate javascript). Then, I quit my C++ markdown
parser dream. Therefore, I forked markedjs (
https://github.com/erdinc09/marked) and added line number data to the
rendered html nodes as html attribute in order to use it in synchronization
of the editor and preview. If I followed other options than the plugin
would be useless. I also used "highlightjs" for code syntax highlighting in
preview. It is also as mature as markedjs. As a bonus, If I have any
parsing or highlighting bug I can get it fixed very easily.

And another advantage that comes with webengie, since the parsing is in the
engine process you don't need to code for extra parsing thread and
synchronization of data. Less code, less headache I think.

As litehtml html rendering option there are following problems (IMHO):
 - It is not a javascript engine, therefore we cannot use markedjs,
highlightjs and  we can not use javascipt DOM API to synch the preview and
editor.
 - It is not fully compatible with HTML/CSS standards.
 - If I understand correctly, for drawing texts, images, fonts we need
other libraries.


 In my professional coding time (to earn money :-( ), I use IDEs Intellij
and vscode mainly since I am a JVM (java, kotlin, xtext...) developer (by
the way, my favorite is C++, Qt and QtCreator. Really!). All these IDEs
have these features, developers like them. I felt uncomfortable when I used
my plugin without any feature that I mentioned. For example, without scroll
synchronization after your md file gets bigger, you start to get angry.

I like Qt and Qt Community, I will be so happy if I can help them. I really
want to upstream plugin but I know that it is not an easy decision when it
comes to dependencies. As I explained, I really tried  not to add them but
I can not find any other useful and maintainable option. It is your
decision and which decision is made, I want to help QtCreator become more
beautiful! Yes, she is very beautiful :-).

 If your decision is not to upstream, then I want your ideas about
automatic downloading dependencies. Then it will be more useful.

 Best regards,

 //Erdinç



On Mon, Apr 12, 2021 at 3:36 PM Cristian Adam <cristian.adam at qt.io> wrote:

> Hi,
>
> This plugin has a dependency on QtWebEngine, not because it needs to
> display html text, but because of the javascript libraries that are used to
> convert from markdown to html.
>
> A simple websearch after markdown and c++ pointed me to:
> https://stackoverflow.com/questions/889434/markdown-implementations-for-c-c
> I would love to have such a plugin in Qt Creator, since now
> https://github.com/cloose/CuteMarkEd to edit markdown files outside Qt
> Creator.
>
> I think litehtml should suffice to display the html rendered by a markdown
> parser.
> Cheers,
> Cristian.
>
> On 19/03/2021 09:17, ahmet erdinc yilmaz wrote:
>
> Hi all,
>
> I have been developing a markdown plugin for QtCreator. I think it is time
> to announce :-). You can reach from
> https://github.com/erdinc09/MarkdownEditView.
>
> I also published releases
> <https://github.com/erdinc09/MarkdownEditView/releases> for all three
> platforms. I hope you like it.
>
> *Features:*
>
>    - Syntax highlighting in editor
>    - Html preview
>    - Code highlighting in preview
>    - Theme aware preview and editor
>    - Bidirectional vertical scroll synchronization between editor and
>    preview
>
>
> *Dark Theme:*
>
> [image: dark.jpg]
>
> *Classic Theme:*
>
> [image: classic.jpg]
> I have already announced it on the forum.qt.io
> <https://forum.qt.io/topic/124822/qtcreator-markdown-plugin>.
>
> Best regards,
>
> // Erdinç
>
> _______________________________________________
> Qt-creator mailing listQt-creator at qt-project.orghttps://lists.qt-project.org/listinfo/qt-creator
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20210412/8a4acec2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dark.jpg
Type: image/jpeg
Size: 662485 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20210412/8a4acec2/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: classic.jpg
Type: image/jpeg
Size: 721919 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20210412/8a4acec2/attachment-0003.jpg>


More information about the Qt-creator mailing list