Online tools for the MMT language and ecosystem.
See in action at https://comfreek.github.io/mmteditor/.
-
MMT QuickEditor: Editor with syntax highlighting and abbreviation autocompletion.
-
"How do I type X?": Find out how to type things you encountered.
-
Abbreviation Search: Find out the abbreviation whose name you only partly remember.
-
Bare Editor: A bare full-screen MMT editor within your browser (available at https://comfreek.github.io/mmteditor/bare.html)
You can also use the bare editor as a "reusable component" on external sites: include an
<iframe src="https://comfreek.github.io/mmteditor/bare.html"></iframe>
on your site, and then via JS call postMessage() on the iframe's contentWindow property with the following event data:{ "command": "set-content", "content": "the content you want the editor to display" }
For example, the SyntaxPresenterServer within the MMT API uses the bare editor this way.
-
Get an HTTP server, e.g. http-server from NPM:
npm i http-server -g
. -
Run the HTTP server, e.g.
http-server .
. -
Go to http://127.0.0.1:8080/index.html and http://127.0.0.1:8080/bare.html and test things manually (type random (in)valid MMT syntax, test autocomplete).
It is strongly recommended to open the developer tools in your browser and deactivate caching in the network tab.
Regularly update the raw abbreviation data in abbreviations.js
by copying everything from https://github.com/UniFormal/MMT/blob/devel/src/mmt-api/resources/unicode/unicode-latex-map.
Detailed instructions can be found in abbreviations.js
.
Suppose CodeMirror releases a new version X.Y.Z. Hopefully, Renovate already filed a pull request. Then do:
-
Hopefully the codemirror/CodeMirror repository on GitHub contains a corresponding tag
X.Y.Z
. -
From within this repository,
cd codemirror
and do:git remote add upstream https://github.com/codemirror/CodeMirror.git
(if not already existing)git remote set-url origin --push [email protected]:ComFreek/CodeMirror.git
(if not already done)git fetch upstream --tags
git merge X.Y.Z
git commit -m "..."
(in case of merge conflicts) andgit push origin
-
In case Renovate filed a pull request, do
git fetch
andgit merge origin/renovate/codemirror-x.y
.Confirm that in both files
index.html
andbare.html
, the URIs referencing CodeMirror resources (<script src="...">
and<link href="...">
) really contain the updated version. If not or if Renovate did not file a pull request at all, update these versions in the URIs manually. -
Test whether things work locally (see above under Testing locally).
-
git add --all
,git commit -m "Update CodeMirror to X.Y.Z"
,git push