gram/packages/playground
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-10 13:16:59 -10:00
..
dist fix: handle empty ingredient masses as zero and improve undefined mass checks in compiler metrics 2026-05-10 13:16:59 -10:00
src feat: implement unit resolution, add compiler options for mass normalization, and update relative ingredient quantity calculations. 2026-05-10 12:26:56 -10:00
build.js feat: playground : added repository link + version number 2026-01-18 12:05:51 +01:00
favicon.png refactor: Moved source code to new packages folder 2026-01-02 20:16:03 +01:00
index.html feat: implement unit resolution, add compiler options for mass normalization, and update relative ingredient quantity calculations. 2026-05-10 12:26:56 -10:00
package-lock.json refactor: Moved source code to new packages folder 2026-01-02 20:16:03 +01:00
package.json fix: Updated packages version tu reflect repo release version 2026-01-18 14:42:27 +01:00
README.md refactor: Moved source code to new packages folder 2026-01-02 20:16:03 +01:00

Gram Playground

This is the official browser-based playground for GRAM Language, allowing you to write recipes and see the parsed output in real-time.

Features

  • Real-time Parsing: Write your recipe in GRAM on the left, and see the result instantly on the right.
  • Multiple Views:
    • JSON (Text): The raw structure parsed from your recipe.
    • Tree View: An interactive, collapsible JSON explorer to navigate complex recipes.
    • Markdown: A generated, readable markdown version of your recipe.
    • Preview: A beautiful, rendered view of the final recipe card.
  • Syntax Highlighting: Basic syntax highlighting for the GRAM language editor.
  • Example Library: Load pre-made recipes (Pancakes, Spaghetti, etc.) to learn the syntax.
  • Dark/Light Mode: Toggle between themes to match your preference.
  • Clipboard Copy: Easily copy the resulting JSON or Markdown.

How to use

  1. Install Dependencies (if developing):

    npm install
    
  2. Run Locally: You can serve the playground directory with any static file server.

    npx serve playground
    

    Then open http://localhost:3000 in your browser.

Development

The project source code is located in src/. The build process bundles the parser, application logic, and CSS into the dist/ directory.

Prerequisite: The parser must be built first.

cd ../gram-parser
npm install
npm run build
cd ../playground

To rebuild the playground project after making changes to src/app.js or src/style.css:

npm install
npm run build