An unpopular coder โข christian โข husband โข dad โข front-end โข Made in ๐ง๐ท
- ๐ฆ Twitter: https://twitter.com/klaytonfaria
- ๐ LinkedIn: https://www.linkedin.com/in/klaytonfaria
- ๐ฌ Telegram: https://t.me/klaytonfaria
Markdown to json has yaml support and converts your markdown files to json so you can use them as a static api.
License: MIT License
An unpopular coder โข christian โข husband โข dad โข front-end โข Made in ๐ง๐ท
Instead of reading in files, would I be able to parse some strings with this and convert them to objects?
I use the resulting data files of metadata and content as sources for a single-page application. I would like to render the Markdown with my own (client-side) Markdown renderer.
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.
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):
npm view markdown-json version
)Sample folder with not working situation
markdown-json-files-not-processed.zip
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:
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.
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.
Use as a require module also
Describe the solution you'd like
Prevent generating output file if the settings property is false. Useful for tests.
Add http server to run api
Great utility library!
You may want to upgrade marked to >=4.0.10 as there are a couple vulnerabilities with the current version used.
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):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.