Code highlighting in browser (codemirror)

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Code highlighting in browser (codemirror)

#51 Post by chromo23 » 30 Jun 2022, 23:16

in case anyone is interested in building espeasy with codehighlighting can do this here:
https://github.com/chromoxdor/ESPEasy/tree/powercolor
(i initally used it for my plugs with integrated power-meters therefore the strange name)

what else is different:
-custom css
-includes js and css files in custom 1m builds (for using devices without internet)

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Code highlighting in browser (codemirror)

#52 Post by chromo23 » 18 Jul 2022, 22:21

I made some updates which makes it even more nicer to write rules:

- auto-activation of hinting through typing
- comments are now excluded from hinting
- minor sorting and highlighting issues fixed

have fun!

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Code highlighting in browser (codemirror)

#53 Post by chromo23 » 26 Jul 2022, 11:03

More small updates:
- minor color changes
- added System Variables and Standard Conversions to the word list
- Taskvariables in [] are now being also suggested
hint2.png
hint2.png (22.38 KiB) Viewed 896 times
hint1.png
hint1.png (21.57 KiB) Viewed 896 times

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Code highlighting in browser (codemirror)

#54 Post by chromo23 » 01 Aug 2022, 21:46

I added more stuff:

- "On"+enter, "Do"+enter or "If"+enter will result in autocompletion.
- "Logentry" + Enter adds quotation marks
- Autoclose brackets
- You can now search and replace in rules.
- hex numbers like in [p116] colorcodes or numbers prefixed with "0x" are now marked as numbers
- Now softabs are beeing used
- Longtouch on mobile devices opens search and replace dialog (hopefully)

Here some useful shortcuts:
Ctrl-F / Cmd-F -> Start searching
Ctrl-G / Cmd-G -> Find next
Shift-Ctrl-G / Shift-Cmd-G -> Find previous
Shift-Ctrl-F / Cmd-Option-F -> Replace
Shift-Ctrl-R / Shift-Cmd-Option-F -> Replace all
Tab -> softtab
Select then Tab -> indent selection
Shift-Tab -> dedent
Select then Shift-Tab -> dedent selection
esprules.gif
esprules.gif (417.58 KiB) Viewed 852 times
espcolor_search.gif
espcolor_search.gif (566.32 KiB) Viewed 852 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Code highlighting in browser (codemirror)

#55 Post by TD-er » 01 Aug 2022, 21:58

This is soooo cool ;)

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Code highlighting in browser (codemirror)

#56 Post by chromo23 » 29 Aug 2022, 21:10

Before i went to vacation i "renovated" the espeasy colorcode test site a bit..it was more playing around without thinking if it could be useful.
Now i am back from vacation and i finished it anyway.
So if you are interested in an "ESPEasy online rules editor" with shortcut hints and a side by side rules documentation window than give it a try..
Only here, with the round edges and with the iconic two round helperbuttons that made ESPEasy so famous. :D

https://raw.githack.com/chromoxdor/Easy ... rcode.html

Bildschirmaufnahme 2022-08-29 um 20.40.52.gif
Bildschirmaufnahme 2022-08-29 um 20.40.52.gif (1.36 MiB) Viewed 744 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Code highlighting in browser (codemirror)

#57 Post by TD-er » 29 Aug 2022, 22:59

Tried and it is working remarkable well!

Code: Select all

On Rules#Timer=1 Do
  LogEntry,'This is so cool![int#1]oneoneeleven'
  let,1,10*[int#1]+1
Endon

On System#Boot Do
  LoopTimerSet,1,1000
  let,1,1
Endon

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 24 guests