Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated json doesn't have an array like in the README #26

Open
gldraphael opened this issue Jan 18, 2018 · 5 comments
Open

Generated json doesn't have an array like in the README #26

gldraphael opened this issue Jan 18, 2018 · 5 comments

Comments

@gldraphael
Copy link

Command used:

m2j -o index.json -w 0 ./path/*.md

Expected output:

{
  "files": [
    {
      "basename": "hey-there-delilah"
    }
  ]
}

Actual output:

{
  "hey-there-delilah": {
    "basename": "hey-there-delilah"
  }
}

Steps to reproduce:

git clone --branch content --depth 1 https://github.com/hymnsrepo/hymnsrepo-site.git
cd hymnsrepo-site
yarn add --dev markdown-to-json
./node_modules/.bin/m2j -o index.json -w 0 ./hymns/*.md
@scottstanfield
Copy link
Owner

scottstanfield commented Jan 18, 2018 via email

@gldraphael
Copy link
Author

An alternative would be to use an array as the root (in the output):

[
  {
    "basename": "hey-there-delilah"
  }
]

@scottstanfield
Copy link
Owner

I'm worried about making a breaking change. It would be easier for me to update the readme than change working code. Thoughts? I'd like to close this one out.

@gldraphael
Copy link
Author

I think an array would make more sense than the current output. However if you don't feel strongly about it, feel free to close this.

A breaking change would be a major version bump. If you get the time for a v1, do consider this then. (And let me know – I'd like to pitch in.)

@scottstanfield
Copy link
Owner

Good choice. Will fix on v6 over next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants