Giter Site home page Giter Site logo

textx-playground's Introduction

textX Playground

This project represents a playground for textX language. Users can define a new language by specifying its grammar using textX. They can also create a program that should follow the grammar of the defined language.

Some parts of the code are taken from the following projects:

The project is deployed and you can create and validate your new language using textX at textx.github.io/textx-playground.

Functionalities

This is a web application with only one page, containing a header and two code editors.

One editor is used for specifying language grammar and the second for defining a model (program) using newly defined language. Each editor contains the status bar, which has one of the following states:

  • loading - until textX server is started
  • error - shows error in grammar/model with message and position (row, column)
  • valid - grammar/model is valid

The header contains textX logo, toggler between light and dark theme, and links to documentation and GitHub repository.

Grammar and model content can be shared via link by clicking the share icon in the top right corner. Their content is shortened using LZ compression and embedded into the URL link as a query parameter. When this link is opened, the editors' content is restored from the query parameter.

Basic syntax highlighting is implemented. Grammar and model keywords and comments are highlighted.

Development

After cloning the repo and installing dependencies with npm i command, the project is started by running:

npm run dev -- --port 3000

The project is built with:

npm run build

textx-playground's People

Contributors

airmix avatar

Stargazers

Satyam Tiwary avatar Jonas Hartmann avatar

Watchers

Igor Dejanović avatar  avatar

textx-playground's Issues

Can't reshare - URL too long

I was playing today with the new examples and visualization functionality and noticed one bug. It's maybe a nit picking but I noticed that if I create a share link and go to it I can't reshare.

For example, if I get a link from someone and do a few changes and want to create a new one. Clicking on share button reports that sharing is not possible as the URL is too long. I guess that the share action tries to tackle a new grammar/model on the existing link which already has one. Maybe there is a way to replace the existing query parameters if they are grammar/model.

Other then this little issue the playground really looks and works great!
Excellent work @AirmiX !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.