sparkartgroup / gulp-markdown-to-json

Parse Markdown and YAML → compile Markdown to HTML → wrap it all up in JSON
MIT License
75 stars 14 forks source link

A question about having an array in consolidated output #17

Closed levsthings closed 8 years ago

levsthings commented 8 years ago

I have a quick question, it'd be awesome if you could take a look.

For demonstration purposes, let's say I have two Markdown files that I want to wrap in JSON and I'm using the consolidated output method. Files are called post1.md and post2.md.

The result of the output looks like this:


{
    "md": {
        "post1": {
            "slug": "/cupcake-ipsum",
            "title": "Sugar plum gummi bears danish cake powder dessert!",
            "updatedAt": "2016-10-20T17:28:05.852Z"
        },
        "post2": {
            "slug": "/hipster-ipsum",
            "title": "Meditation everyday carry etsy put a bird on it small batch heirloom.",
            "updatedAt": "2016-10-20T17:28:10.508Z"
        }
    }
}

The markdown are now objects under the 'md' object. My question is, how could I configure the output so that I have an array containing my markdown objects instead of them being nested in the 'md' object ?

levsthings commented 8 years ago

No longer an issue as I've changed how I use the output.