Code Monkey home page Code Monkey logo

markdown-json's Introduction

markdown-json's People

Contributors

dependabot[bot] avatar klaytonfaria avatar rosslh avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

markdown-json's Issues

Output to multiple files

The package works great, thanks for making this! I was wondering if it's possible to output multiple files based on the filePattern. It wasn't immediate clear if that was a possibility.

JSON being generated, but so is a build folder with HTML

When running markdown-json, I get the appropriate json file output, but I also see a build folder with html being generated.

notes-to-json.js

const markdownJson = require('markdown-json');

const settings = {
        name: 'notes-json',
      	cwd: './',
      	src: './src',
        filePattern: 'notes/*.md',
        ignore: "*(icon|input)*",
        dist: './src/data/notes.json',
        server: false,
        port: 3001
      };

markdownJson(settings).then((data) => {
  console.log('data:', data);
}).catch((err) => {
  console.log('error:', err);
})

Example Markdown file:

src/notes/tokyo-story.md

---
type: movie
title: Tokyo Story
creator: Yasujiro Ozu
date: 1953
image: tokyo-story.jpg
rating: 5
note-date: April 2, 2019
---

It's a simple story of parents visiting their grown up children. The pace is not hurried. The delivery from the actors is straightforward, not melodramatic. The camera moves in one shot, otherwise it stays still. Yet, in this calm, the movie elicits deeply intense feelings.

Ozu captures the relationship between parents and their children in a way I've never seen or felt before. It hits hard. The movie has aged amazingly well over 60 years and the issues of generational differences and familial relationships it tackles are still present.
This goes straight into my favorite movies of all-time list! Which is rare from a first viewing.

JSON output works. But I also see the following folders and html file being generated:
image

Is this expected behavior? Any way to disable?

Thanks ahead of time and for the work on this project, and let me know if you need any other context.

Only processing files in single directory fails

Describe the bug
I want to process only the Markdown files in the root folder, 0 files processed.

To Reproduce
Steps to reproduce the behavior:

Create settings.json:

{
    "name": "markdown-json",
    "cwd": "./",
    "src": ".",
    "filePattern": "*.md",
    "ignore": "*(icon|input)*",
    "dist": "data/output.json",
    "display": true,
    "metadata": true,
    "server": false,
    "port": 3001,
    "deterministicOrder": false
}

Execute command:

markdown-json

Output:

INFO: Path: C:\testfolder
INFO: Pattern: *.md
INFO: Ignored: *(icon|input)*
INFO: Metadata: true
INFO: Total files: 0
INFO: Output file created on: data/output.json
OK: Markdown to json process has been finished!

Expected behavior
Markdown files in root of folder should have been processed.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 1.6.1 (npm view markdown-json version)

Sample folder with not working situation
markdown-json-files-not-processed.zip

Q: What is the `display` config option?

The documentation says it's a boolean and it enables display mode. But what is display mode? I tried true and false but the output appears the same. What exactly am I looking for? Thanks.

Why is there a strange folder created after the conversion?

Describe the bug

Why is there a strange file created after the conversion is completed?

To Reproduce

For example:

const settings = {
        name: 'markdown-json',
      	cwd: './',
      	src: 'mock/',
        filePattern: '**/*.md',
        ignore: "*(icon|input)*",
        dist: 'mock/output.json',
        metadata: true,
        server: false,
        port: 3001,
        deterministicOrder: false
      };

Then in my existing mock folder will get a mock folder and it is empty inside.

Expected behavior

This mock folder shouldn't be created inside the existing mock folder

Desktop (please complete the following information):

  • Ubuntu

skip file output generation

Describe the solution you'd like
Prevent generating output file if the settings property is false. Useful for tests.

Upgrade marked dependency

Great utility library!

You may want to upgrade marked to >=4.0.10 as there are a couple vulnerabilities with the current version used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.