[DTK] 使用 Dtk 开发了一个 MarkDown 编辑器,欢迎大家试用
Tofloor
poster avatar
winee
deepin
2021-12-06 10:01
Author

项目地址:DMarked(github) & gitee地址

以前就有写 MarkDown 编辑器的想法,之前用的 typroa 收费了,那就搞一波。

目前设计使用传统双栏编辑,一边编辑,一边预览。支持数学公式,代码高亮,流程图(Mermaid)等扩展。

可以导出 pdf,html。而且通过命令行可以批量转换。

软件还在完善中,功能规划,欢迎来提建议。

主体界面

image.png

底部的信息栏可以切换 markdown 主题

模式分为:

阅读模式:只有右侧的预览窗口
编辑模式:只有左侧的编辑窗口
预览模式:一边编辑,一边预览
预览模式S,表示编辑窗口和预览窗口滑动时会自动同步(算法待改进
预览模式N,表示编辑窗口和预览窗口各自独立滑动

下图为阅读模式

image.png

菜单栏

image.png

image.png

设置

image.png

快捷键

image.png

暗色模式

image.png

命令行操作

rewine@rewine-PC:~$ dmarked -h
用法:dmarked [选项] source [destination]

选项:
  -h, --help                显示这个此帮助。
  -v, --version             显示版本信息。
  -w, --write         在 DMarked 中打开 markdown 文件
  -f, --format         把 markdown 文件转换为 pdf/html
  -L, --use-landscape       设置为横向,默认纵向
  -s, --page-size       设置页面大小为 A4,Letter 等
  -l, --margin-left <10>    设置左边距(pt)
  -t, --margin-top <10>     设置上边距(pt)
  -r, --margin-right <10>   设置右边距(pt)
  -b, --margin-bottom <10>  设置下边距(pt)
  -d, --max-depth <1>       批量转换时文件的最大深度

参数:
  source                    需要转换的文件或其所在目录
  [destination]             转换后文件的位置

设计命令行模式的初衷是为了完成批量的文件转换,目前基本达成目的

下面命令把 a.md 转换成 my.html

dmarked -f html a.md my.html

把当前目录以及2层子目录的所有 markdown 文件转换成 pdf 文件, -s 的具体选项可以在前面图形界面的下拉框里查看。主题是上次打开软件时使用的主题。

destination 不填的话,导出的 pdf 放在 md 文件同一路径下。

dmarked -f pdf -s A5 -t 20 -b 20 -d 3 .

把 content 目录下的所有 md 文件(不包括子目录里的)转换成 pdf 放进 content_pdf 文件夹里。

dmarked -f pdf content content_pdf

Reply Favorite View the author
All Replies
1 / 3
To page
guaguale
deepin
2021-12-06 16:20
#1

当年厨子开发了一款,可惜没有linux版本 希望可以fork一些功能或继续看看能不能维护

https://github.com/hemashushu/yu-writer.site

Reply View the author
神末shenmo
Moderator
Spark-App
2021-12-06 16:45
#2

放在github我这里不太能访问啊。。。

个人建议gitee

Reply View the author
神末shenmo
Moderator
Spark-App
2021-12-06 16:46
#3
Reply View the author
神末shenmo
Moderator
Spark-App
2021-12-06 16:52
#4

双栏编辑能否左右同步翻页呢?

Reply View the author
Superboo
deepin
2021-12-06 16:58
#5

支持一下

Reply View the author
babyfengfjx
Super Moderator
CQA
2021-12-06 17:06
#6

非常赞!agree

Reply View the author
公子独白
deepin
2021-12-06 17:06
#7

支持一下kissing_heart

Reply View the author
liwl
deepin
2021-12-06 17:24
#8

非常棒,希望能够后续更加完善

能够支持vim编辑模式,所见即所得,那付费我也愿意哈

joy

Reply View the author
灵兮之
deepin
2021-12-06 17:29
#9

txt文件右键无法打开,也无法在软件里面打开,拉文件进去也不行

编辑模式下左侧行号栏非常宽

Reply View the author
xjs951425301
deepin
2021-12-06 17:29
#10

希望支持planurl

Reply View the author
Comments
rewine
2021-12-07 01:02
这个可以有
忆往
deepin
2021-12-06 17:31
#11

Good JOB

Reply View the author
vivian_me
deepin testing team
2021-12-06 17:38
#12

给大佬打callapplaud

Reply View the author
sammy-621
deepin
2021-12-06 17:45
#13

厉害了,Linux生态越来越丰富!

Reply View the author
deepin-mq
deepin
2021-12-06 17:45
#14

感谢分享,推荐了

Reply View the author
zccrs
deepin
2021-12-06 17:55
#15

👍

Reply View the author
野山菌
deepin
2021-12-06 21:16
#16

DTK怎么用的啊,我装了qtreator没看到有dtk控件?

Reply View the author
Comments
rewine
2021-12-07 01:01
也可以看看这个博客 https://xmuli.tech
guaguale
2021-12-07 00:38
https://docs.deepin.org/
myml
Super Moderator
Developer
2021-12-06 21:51
#17

👍 非常赞,偷偷说句论坛用的markdown编辑器也支持mermaid哦

graph TB subgraph demo A --> B; A --> C; B --> D; C --> D; end
Reply View the author
deltacatxx
deepin beta test group
2021-12-06 22:08
#18

仿typora做了个很丑的icon(

image.pngdmarked.png

Reply View the author
Comments
rewine
2021-12-07 01:06
我确实不太会画图标,欢迎pr,不过这个太像typora担心侵权
winee
deepin
2021-12-07 00:42
#19
神末shenmo

放在github我这里不太能访问啊。。。

个人建议gitee

确实,已经加上 gitee 链接了

Reply View the author
winee
deepin
2021-12-07 00:44
#20
灵兮之

txt文件右键无法打开,也无法在软件里面打开,拉文件进去也不行

编辑模式下左侧行号栏非常宽

只有 markdown 文件(.md)才能右键打开,(话说需要设置txt文件也可以吗?)

Reply View the author
1 / 3
To page