GithubHelp home page GithubHelp logo

yoav-lavi / august Goto Github PK

View Code? Open in Web Editor NEW
47.0 3.0 0.0 45 KB

An Emmet-like language that produces JSON, TOML, or YAML

License: Apache License 2.0

Nix 16.47% Rust 83.53%
emmet json rust rust-lang serde toml yaml

august's Introduction

.august:true

August is an Emmet-like language that produces JSON, TOML, or YAML from a single-line concise selector-like syntax.

If you aren't familiar with Emmet, think of August as a snippet or shortcut to quickly typing or editing a document in any of the target languages.

August is currently in very early stages. The repository currently contains a CLI under crates/cli, which will soon be published in various forms. Editor extensions and a playground will be supported later on.

Please feel free to open issues with syntax suggestions / general suggestions if you want to become involved!

Features

  • Values that are alphanumeric (may be expanded) do not need to be quoted
  • Familiar JSON-like operators (., ,, :)
  • Easy to type (close to the home row) operators (^ being the current exception, may change)
  • Context aware: .true:true becomes { "true": true }
  • Supports exiting a context (object or list) via ^ to the parent scope
  • More document types can be added in the future
  • Other features TBD!

Examples (syntax not final)

Prettier-esque

.semi:true,trailingComma:all,singleQuote:true,printwidth:120,tabwidth:2,ignored:.hello:world

JSON Output

{
  "ignored": {
    "hello": "world"
  },
  "tabwidth": "2",
  "trailingComma": "all",
  "singleQuote": "true",
  "semi": "true",
  "printwidth": "120"
}

TOML Output

tabwidth = "2"
trailingComma = "all"
singleQuote = "true"
semi = "true"
printwidth = "120"

[ignored]
hello = "world"

YAML Output

ignored:
  hello: world
tabwidth: '2'
trailingComma: all
singleQuote: 'true'
semi: 'true'
printwidth: '120'

Deeply Nested

.this:.is:.deeply:.nested:.indeed:.how:odd

JSON Output

{
  "this": {
    "is": {
      "deeply": {
        "nested": {
          "indeed": {
            "how": "odd"
          }
        }
      }
    }
  }
}

TOML Output

[this.is.deeply.nested.indeed]
how = "odd"

YAML Output

this:
  is:
    deeply:
      nested:
        indeed:
          how: odd

Syntax (current)

  • . - opens a new object (similar to { in JSON)
  • : - sets a value for a key
  • > - opens a new list (similar to [ in JSON)
  • ^ - climb up to the parent scope (object or list)
  • identifier - an unquoted string, can be used for keys and values
  • "this is my identifier" - a quoted string, can be used for keys and values
  • true, false, null - similar to JSON counterparts
  • \ - escapes a character within a quoted string (e.g. \")

CLI Usage (CLI command TBD)

ag -o / --output [OUTPUT] (json|toml|yaml) [INPUT]

august's People

Contributors

yoav-lavi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.