https://github.com/comfreek/mmteditor
https://github.com/comfreek/mmteditor
formal-methods language-tools logic
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/comfreek/mmteditor
- Owner: ComFreek
- License: mit
- Created: 2020-10-12T11:01:58.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-06-17T03:25:25.000Z (about 1 year ago)
- Last Synced: 2025-06-17T04:26:26.810Z (about 1 year ago)
- Topics: formal-methods, language-tools, logic
- Language: JavaScript
- Homepage: https://comfreek.github.io/mmteditor
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MMT Online Tools (mmteditor)
Online tools for the [MMT language and ecosystem](https://uniformal.github.io/).
See in action at .
- 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 )
You can also use the bare editor as a "reusable component" on external sites:
include an `` on your site,
and then via JS call [postMessage()](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) on the [iframe's contentWindow property](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/contentWindow) with the following event data:
```json
{
"command": "set-content",
"content": "the content you want the editor to display"
}
```
For example, the [SyntaxPresenterServer within the MMT API](https://github.com/UniFormal/MMT/tree/devel/src/mmt-api/src/main/info/kwarc/mmt/api/web/SyntaxPresenterServer.scala) uses the bare editor this way.
## Development Notes
### Testing locally
1. Get an HTTP server, e.g. [*http-server* from NPM](https://www.npmjs.com/package/http-server): `npm i http-server -g`.
2. Run the HTTP server, e.g. `http-server .`.
3. Go to and 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.
### Updating MMT's abbreviation map
Regularly update the raw abbreviation data in `abbreviations.js` by copying everything from .
Detailed instructions can be found in `abbreviations.js`.
### Updating CodeMirror
Suppose CodeMirror releases a new version X.Y.Z. Hopefully, [Renovate](https://github.com/renovatebot/renovate) already filed a pull request.
Then do:
1. Hopefully the [codemirror/CodeMirror repository on GitHub](https://github.com/codemirror/CodeMirror) contains a corresponding tag `X.Y.Z`.
2. From within this repository, `cd codemirror` and do:
1. `git remote add upstream https://github.com/codemirror/CodeMirror.git` (if not already existing)
2. `git remote set-url origin --push git@github.com:ComFreek/CodeMirror.git` (if not already done)
3. `git fetch upstream --tags`
4. `git merge X.Y.Z`
5. `git commit -m "..."` (in case of merge conflicts) and `git push origin`
3. In case Renovate filed a pull request, do `git fetch` and `git merge origin/renovate/codemirror-x.y`.
Confirm that in both files `index.html` and `bare.html`, the URIs referencing CodeMirror resources (`` 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.
4. Test whether things work locally (see above under *Testing locally*).
5. `git add --all`, `git commit -m "Update CodeMirror to X.Y.Z"`, `git push`