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

Outputs json converted *.md files no *.json or wont compile into single *. json? #28

Open
shawn-sandy opened this issue Jul 10, 2018 · 3 comments

Comments

@shawn-sandy
Copy link

The gulp task returns *.md no *.json output the code is below,

Thanks for your help

const gulp = require('gulp')
const marked = require('marked')
const listStream = require('list-stream');

marked.setOptions({
  pedantic: true,
  smartypants: true
})


gulp.task('markdown-json', () => {
  gulp.src([
      './src/packages/**/**/*.md',
      '!./src/packages/**/node_modules/**/*.md'
    ])
    .pipe(jsonMarkdown(marked))
    .pipe(gulp.dest('dist/docs/json/'))
})

single output file task/config

gulp.task('markdown-json', () => {
  gulp.src([
      './src/packages/**/**/*.md',
      '!./src/packages/**/node_modules/**/*.md'
    ])
    .pipe(listStream.obj())
    .pipe(jsonMarkdown(marked))
    .pipe(gulp.dest('dist/docs/json/'))
})
@gerardkeane
Copy link

I have the same issue. Everything works correctly but the file extension of the output file is .md rather than .json.

@gerardkeane
Copy link

I forgot to say, the gulp-rename package can probably help here:

https://www.npmjs.com/package/gulp-rename

var rename = require('gulp-rename')

gulp.task('markdown-json', () => {
  gulp.src([
      './src/packages/**/**/*.md',
      '!./src/packages/**/node_modules/**/*.md'
    ])
    .pipe(jsonMarkdown(marked))
    .pipe(rename({ extname: '.json' }))
    .pipe(gulp.dest('dist/docs/json/'))
})

I'm using it for something else but it should be a simple solution.

@mildrenben
Copy link

Appears this bug was introduced in v1.1.0. Going back to v1.0.3 fixes this. (gulp-rename is also a solution)

mildrenben added a commit to mildrenben/react-super-select that referenced this issue Oct 1, 2019
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

3 participants