Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax highlighting. #20

Open
stebanos opened this issue Feb 19, 2018 · 9 comments
Open

Add syntax highlighting. #20

stebanos opened this issue Feb 19, 2018 · 9 comments

Comments

@stebanos
Copy link
Member

Currently it can be quite cumbersome to spot mistakes. Syntax highlighting will help a lot, but this depends on #19.

@kunal-mohta
Copy link
Contributor

I think CodeMirror has its own predefined syntax-highlighting for particular languages, and apart from that it only has a default mode, as can be seen here in runmode/colorize.js under the addons heading

@kunal-mohta
Copy link
Contributor

I read more and found out that we can provide CodeMirror a list of keywords that have a particular syntax highlighting.

@fdb
Copy link
Member

fdb commented Feb 23, 2018

CodeMirror is now integrated but we need to write our own mode for the Seed syntax. Seed itself doesn't have very many keywords, it's more a base structure of a block identifier (ends with a colon), phrase (starts with - ), phrase continuation line (starts with " ")...

Inside of each phrase we could use a HTML mixed-mode highlighter that higlights HTML and inline CSS.

@stebanos
Copy link
Member Author

Suggestion:

syntax

@fdb
Copy link
Member

fdb commented Feb 24, 2018

Looking good! 👍

@fdb
Copy link
Member

fdb commented Feb 24, 2018

Here's some info on writing a custom mode in CodeMirror:

http://codemirror.net/doc/manual.html#modeapi

@fdb
Copy link
Member

fdb commented Feb 24, 2018

Perhaps the simple mode is enough: http://codemirror.net/demo/simplemode.html

@dhruvramdev
Copy link

@fdb I would like to work.

@dhruvramdev
Copy link

dhruvramdev commented Mar 13, 2018

I was able to write a basic set of rules. But I couldn't find more colours to highlight text as described in picture even though they have different rules.

Screenshots
screenshot_20180314_011521
screenshot_20180314_010934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants