TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: JavaScript based editor with predefined grammar

2 pointsby 100-xyzover 5 years ago
Hi,<p>I am creating a Flash replacement - a web based animation editor. https:&#x2F;&#x2F;its-near.me&#x2F;flash2&#x2F;editor<p>The animation will be controlled by simple text like:<p>At time 0 cowboy walks to point A.<p>Then cowboy jumps.<p>Then cowboy walks to point C.<p>The grammar is predefined: [time] [object] [verb] [?subject]<p>Where time can be &quot;At time XX&quot; or &quot;Then&quot;<p>object can be any of the images in the animation<p>verb can be any of the movements that the image sprite supports eg: &quot;walk&quot;, &quot;run&quot;, &quot;slide&quot;, &quot;die&quot;<p>and so on.<p>The editor should prompt the possible values that the user can enter. eg: in the beginning, the choices would be &quot;At time&quot; and &quot;Then&quot;<p>I have searched online and in particular github with no luck. Anyone here know of any?<p>Hopefully, I have explained clearly. If not, please ask for clarification.<p>Thanks.

2 comments

Yottaover 5 years ago
Take a look at Codemirror (<a href="https:&#x2F;&#x2F;codemirror.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;codemirror.net&#x2F;</a>). It has support for autocompletion, although I haven&#x27;t tested this myself.<p>You can also define syntax highlighting for your grammar.
sprobertsonover 5 years ago
Customization around Draft.js should support this, tricky to learn but quite powerful once you do.