Code Monkey home page Code Monkey logo

codemirror-mode-tiddlywiki5's Introduction

CodeMirror-Mode-TiddlyWiki5

This project is deprecated, the new repo is here.

这是一个旧项目,不再更新, 新的项目工程在这里.

Adds Syntax Highlighting for TiddlyWiki5 tiddlers (text/vnd.tiddlywiki) to the CodeMirror, along with some other useful editor addon (wikilink hint, macro hint, etc.). Now is under development.

为 TiddlyWiki 的 CodeMirror 编辑器添加 TiddlyWiki5(text/vnd.tiddlywiki)语法高亮,同时还有其他有用的编辑器扩展(如 Wiki 链接自动提示、宏提示等),以及可以打开的链接。现在正在开发中。

> English Readme <


插件说明

增加 CodeMirror 对 TiddlyWiki5 语法高亮的支持,所有 MIME 类型留空或者为text/vnd.tiddlywiki的 tiddler 都会有高亮。同时支持像VSCode那样在打字时实时进行代码补全提示+预览(目前仅实现了 WikiLink 补全),且不需要Ctrl+Space激活。

插件还在开发中,如有任何建议或者 bug 请直接提 Issue。

安装&编译

请首先安装最新版CodeMirror主插件和CodeMirror Autocomplete子插件(不然会报错)。

直接去Release下载CodeMirrorModeTiddlyWiki5-X.X.X.json,然后将其拖拽到你的 TiddlyWiki 中,或者在 TiddlyWiki 中导入之。

如果插件报错了,不必惊慌,因为插件不会对 TiddlyWiki 本体内容做修改,所以只需要卸载就能够消除问题,但保险起见还是建议先备份再安装

如果想 DIY 和编译,请直接运行make或者make build。请注意,被打包的是那几个xxx.min.jsxxx.min.css

功能介绍

高亮TiddlyWiki5语法,支持内嵌代码块和LaTeX的语法高亮

Default: default

Ayu-Dark: ayu-dark

TiddlyWiki: tiddlywiki

注意:这些主题有些是我自己装的,如感兴趣换主题,请阅读 TiddlyWiki 的 CodeMirror 的 README。

WikiLink实时补全提示+预览

wikilink-hint

在预览打开的情况下:

hint-preview

可点击的链接

wikilink-hint

  • 对于 macOS 用户,cmd + 鼠标左键 可以打开 tiddler 或者外部 url。
  • 对于非 macOS 用户,ctrl + 鼠标左键 可以打开 tiddler 或者外部 url。

其他功能正在开发中。

开发感想

在使用 TiddlyWiki 之后,一直苦于 TiddlyWiki5 语法没有高亮支持,写作体验不是很好。之前有也在网上找到一些相关的解决办法,例如在Google Group上面有人建议用 TiddlyWiki2 的语法进行 Hack,但是这种方法并不完美。

也有人编写了一个可用的 CodeMirror 的扩展版本TW5-CodeMirror-Plus,虽然是可用的,但是有两个问题:一个是语法高亮的内容有限,另一个是该插件直接基于 theme 而非 mode 进行开发,这就导致如果想要用 TW5 的高亮就必须舍弃其他语法高亮,并且无法自定义主题。所以最终还是打算自己写一个 :D

本插件一开始也是基于TW5-CodeMirror-Plus开发的,只不过魔改了很多,现在基本上是两个不同的插件了。

TODO List

  • 代码块内的语法高亮与缩进。
  • LaTeX 公式高亮与缩进。
  • 自动补全内部链接的 tiddler 名称。
  • 可点击的URL与WikiLink。
  • 补全提示的预览框。
  • 其他代码提示。
  • 代码错误检查。
  • 鼠标悬在 LaTeX 代码上方能够进行公式预览。

codemirror-mode-tiddlywiki5's People

Contributors

gk0wk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zhangaz1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.