Skip to content

downson-lang/downson

Repository files navigation

Downson

markDOWN Object Notation

Downson is now open source! Read the announcement!

Downson makes it possible to embed typed and structured data into Markdown documents.

Specification

Read the specification here: SPECIFICATION.md.

Examples

  • The classic "Hello, World!" example:
    • downson
      My favorite **.greeting** [](right) is "[Hello, world!](string)".
    • JSON
      {
        "greeting": "Hello, World!"
      }
  • Configuring available and default languages:
    • downson
      The available **.languages** [](right) are the following:
      
        1. [Hungarian](string "hun"),
        1. [English](string "eng"),
        1. [German](string "ger").
      
      The **.default language** [](right "default") is set to [Hungarian](string "hun").
    • JSON
      {
        "languages": [
          "hun",
          "eng",
          "ger"
        ],
        "default": "hun"
      }
  • Describing your PC to your friend:
    • downson
        - Let me show you this **.bad boy** [](right:object "configuration")! It has [8](int) **.cores** [](left) and [16](int) gigs of **.memory** [](left)! []($) **.Impressive** [](right "isImpressive"), huh?
        - [Of course](boolean, "true"), bro!
    • JSON
      {
        "configuration": {
          "cores": 8,
          "memory": 16
        },
        "isImpressive": true
      }
  • Type parameters and custom types:
    • downson
      My **.favorite color** [](right "favorite") is [aquamarine](rgb:mode=string), but I also **.like** [](right) [#FFFFFF](rgb:mode=hex).
    • JSON
      {
        "favorite": {
          "r": 127,
          "g": 255,
          "b": 212
        },
        "like": {
          "r": 255,
          "g": 255,
          "b": 255
        }
      }

Larger examples can be found in the examples directory.

Goals and non-goals

  • Downson aims to be easily read by humans and easily written by humans.
  • Downson is NOT a data exchange format. It is best suited for configuration and other read-only data files.

Test Suite

This repository contains a test suite that can be used to exercise downson implementations. The description of the test cases can be found in the TESTS.md downson file.

Implementations

Project Description Language
downson-js A downson parser library based on marked. JavaScript
downson-js-cli A command-line downson-to-JSON converter. JavaScript

Contributing

Check out CONTRIBUTING.md for infos about contributing!

Acknowledgments

Thanks to all the awesome people (Robi, Bence, Dávid, Ádám, Marin, Zsolt, Lajos, Nándi, Tibor, Péter), who took the time to review the early drafts of this specification!

License

The contents of this repository are licensed under the MIT License – see LICENSE.

About

markDOWN Object Notation - Typed and structured data embedded straight into Markdown documents.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published