Now with Partition Management

    mobiledoc-pretty-json-renderer

    2.0.1 • Public • Published

    mobiledoc-pretty-json-renderer

    A pretty JSON formatter for Mobiledoc documents.

    Because of all the nested arrays, a dumb JSON pretty-printer gives something pretty difficult to read:

    {
      "version": "0.3.0",
      "atoms": [],
      "markups": [],
      "cards": [],
      "sections": [
        [
          1,
          "H2",
          [
            [
              0,
              [],
              0,
              "Hello World"
            ]
          ]
        ],
        [
          1,
          "p",
          [
            [
              0,
              [],
              0,
              "This is Mobiledoc-kit."
            ]
          ]
        ]
      ]
    }

    This formatter produces a nicer structure:

    {
      "version": "0.3.0",
      "markups": [],
      "atoms": [],
      "cards": [],
      "sections": [
        [1, "H2", [
          [0, [], 0, "Hello World"]
        ]],
        [1, "p", [
          [0, [], 0, "This is Mobiledoc-kit."]
        ]]
      ]
    }

    Usage

    • npm install -S mobiledoc-pretty-json-renderer
    var formatMobiledoc = require('mobiledoc-pretty-json-renderer');
    console.log(formatMobiledoc(someMobiledoc));

    Install

    npm i mobiledoc-pretty-json-renderer

    DownloadsWeekly Downloads

    6

    Version

    2.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar