Skip to content

GreenWallows/gentleman

 
 

Repository files navigation

Gentleman - A lightweight web-based projectional editor generator

Build Status

Gentleman aims to to close the gap between models and domain experts.

Concept defintion Projection definition
Gentleman Screenshot Gentleman Screenshot

Projectional-editing

  1. No parser needed: the user manipulates the AST directly (through projections)
  2. Support of various notations: tables, math formulas, graphics...
  3. Composition of any language without introducing syntactic ambiguities

Workflow

  1. Language enginneer

    1. Define a model for your DSL concepts or import and Ecore model
    2. Create projections to interact with your DSL concepts
  2. Domain expert

    1. Use the generated editor to create the model instances
    2. Personnalize freely the presentation of your instance

Features

  • Platform agnostic: Gentleman target the web (no installation required)
  • Support textual and tabular notations and multimedia content
  • Offer specialized UI units for projection layout and fields
  • Integration with Ecore: Define an Ecore model and use it with Gentleman projections

👉 Demonstration

Take a look at the demonstration (MODELS 2020) and see the tool in action.

⭐⭐⭐ Play with it ⭐⭐⭐

Integration

Decorate an HTML Tag

<html>
    <body>
        ...
        <div data-gentleman></div>
        ...
        <script src="gentleman.js"></script>
    </body>
</html>

Create an instance in JS

const MODEL = {JSON};
const PROJECTION = {JSON}

var editor = Gentleman.createEdiotr();
editor.init(MODEL, PROJETION)

Installation

⚠️ Gentleman is currently in alpha. ⚠️

Building the Code

To build the code, follow these steps.

  1. Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
  2. From the project folder, execute the following command:
$ npm install

Documentation

Editor

The editor configuration is done through a JSON file.

{
    "name": EDITOR_NAME,
    "header": {
        "css": [HEADER_CSS_CLASS]
    },
    "body": {
        "css": [BODY_CSS_CLASS]
    },
    "menu": {
        "actions": [
            MENU_ACTION
                - name
                - handler?
                - content=name
                - visible=true
        ],
        "css": [BODY_CSS_CLASS]
    }
}

Header

Body

Menu

Projection

A projection is a representation of a concept that can be visualized and interacted with in the graphical user interface (GUI). Multiple projections may be defined for a single concept so as to allow different representation and level of granularity.

Example
Consider the concept Person with attributes such as name, age, height, shape, and type.
To manipulate a collection of Person, a Table is a highly efficient notation to make changes, but does not offer enough flexibility for viewing purposes. However, a List which is less rigid in both structure and presentation fit perfectly with this scenario.
Therefore, a good strategy would be to define a projection per use cases:
(1) Edit a Person and view all their attributes -> Table projection
(2) Enumerate all the defined Person showing only their name -> List projection

Every projection is a composition of layout, field and static elements; all rendered as HTML elements. They can be customized, individually or globally, directly with style rules or though external CSS.

Layout

A layout element is used to organize elements presented in the GUI. Predefined layouts:

  • Wrap
  • Stack
  • Cell

Field

A field element is used to receive and process input and output

  • Text
  • Binary
  • Choice
  • List
  • Table

Static

A static element is used to add element that do not accept any input and may only react to changes in the environment.

  • Text
  • Image
  • Link
  • HTML

Publication

[1] L-E Lafontant, E. Syriani. Gentleman: a light-weight web-based projectional editor generator PDF

Distribution

This distribution contains the following files and folders:

  • src: the source code
  • demo: contains some metamodels
  • doc: the source code documentation
  • assets: contains static files

License

The source code is licensed under a GNU GENERAL PUBLIC LICENSE 3 GNU GPL v3

About

Gentleman is a web-based projectional editor generator. It allows you to express and interact with your DSL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.5%
  • CSS 28.4%
  • HTML 2.1%