Skip to content

mikecargal/texttemplate-editor

 
 

Repository files navigation

Gitpod Ready-to-Code

texttemplate-monaco-editor

This project is based on the article Writing a browser based editor using Monaco and ANTLR, which shows how to integrate ANTLR with monaco.

The language supported here is TextTemplate, a new string interpolaton language that has which has been designed with the goal of creating a language that is :

(a) Concise, through the use of language constructs and default processing that eliminate unnecessary verbiage
(b) Readable, through the use of familiar syntax, properly-named methods, and flexible comments and whitespace
(c) Intuitive, through a highly generalized implementation such that once the basic concepts of the language are grasped for simple operations, performing more advanced operations should not require unique or specialized knowledge
(d) Consistent, through an implementation that avoids, wherever possible, special cases and restrictions
(e) Rich, through the anticipation and implementation of a wide range of methods and operators that perform typical as well as extraordinary manipulations
(f) Documented, through content that includes adequate examples to demonstrate the concepts
(g) Universal, through multiple implementations in a variety of computer languages, starting with JavaScript/Typescript, followed by Java, C# and others

The first version of the language has been completed and can be experienced in this project. The Monaco editor acts as a lanaguage playground, and the documentation is actually an interpolation of the language. The editor performs syntax checking and colorizing and can be used to develop and test templates.

Generating the lexer and the parser

./gradlew generateParser

Build everything and run the server

npm install
npm i -g webpack webpack-cli
chmod u+x run

./gradlew generateParser
tsc
webpack
npm start

The commands following the first three commands have been packaged in the "run" bash shell script. Once the first three commands have been run, navigate to the project and launch the git bash shell.

Compile and run using the command ./run

when the server starts, visit http://localhost:3000

The server can be stopped by typing CTRL-c

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 51.4%
  • ANTLR 31.2%
  • HTML 10.6%
  • JavaScript 6.6%
  • Other 0.2%