{"id":18256159,"url":"https://github.com/serapath/json-meta-marked","last_synced_at":"2025-04-08T22:27:07.356Z","repository":{"id":32175111,"uuid":"35748476","full_name":"serapath/json-meta-marked","owner":"serapath","description":"Convert markdown with json front matter to json object with metadata \u0026 html","archived":false,"fork":false,"pushed_at":"2016-02-20T01:17:04.000Z","size":40,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T17:42:10.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serapath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-17T02:22:10.000Z","updated_at":"2016-04-27T01:31:30.000Z","dependencies_parsed_at":"2022-08-24T17:22:06.115Z","dependency_job_id":null,"html_url":"https://github.com/serapath/json-meta-marked","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fjson-meta-marked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fjson-meta-marked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fjson-meta-marked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serapath%2Fjson-meta-marked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serapath","download_url":"https://codeload.github.com/serapath/json-meta-marked/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247937303,"owners_count":21021227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:20:13.419Z","updated_at":"2025-04-08T22:27:07.328Z","avatar_url":"https://github.com/serapath.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-meta-marked\nConvert markdown with json front matter to json object with metadata \u0026amp; html.  \nWorks in both directions.  \nWorks as `cli` and `required module`\n\n**special feature**  \nIf you include a custom `field` in the `json` front matter, you can include `{{field}}` or `[]({{field}})` in the markdown part and in the transformation process, those placeholders in the markdown will be replaced with the value of the custom `field` of the json front matter\n\n## example\n```md\n---\n{\n  \"foo\": \"bar\",\n  \"custom\": {\n    \"something\": \"world\",\n    \"beep\": \"boop\"\n  }\n}\n---\n\n# Hello {{something}}\n\nThis is an example, [{{beep}}]({{beep}})\n\n[//]: # (@TODO: this is a comment)\n\n* one\n* two\n* three\n\nyay, foobar :-)\n```\n\nwill be transformed to:\n\n```json\n{\n  \"foo\": \"bar\",\n  \"custom\": {\n    \"something\": \"world\",\n    \"beep\": \"boop\"\n  },\n  \"__content__\": \"\u003ch1 id=\\\"hello-something-\\\"\u003eHello world\u003c/h1\u003e\u003cp\u003eThis is an example, boop\u003c/p\u003e\u003cul\u003e\u003cli\u003eone\u003c/li\u003e\u003cli\u003etwo\u003c/li\u003e\u003cli\u003ethree\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eyay, foobar :-)\u003c/p\u003e\"\n}\n\n```\n\n## USAGE - When `required module` -- markdown2json\n\n### [jsonfront.md]\n\n```markdown\n---\n{\n  \"name\": \"Metadata\",\n  \"CONTENT\": [\n    \"pitch\",\n    \"news\",\n    \"requirements\",\n    \"program\",\n    \"schedule\",\n    \"support\",\n    \"contribute\",\n    \"about\"\n  ]\n}\n---\n\n# Metadata of content\n```\n### [markdown2json.js]\n\n```js\nvar jmm = require('json-meta-marked');\nvar fs  = require('fs');\nvar obj = jmm.parse(fs.readFileSync('jsonfront.md'));\nconsole.log(JSON.stringify(obj, null, 2));\n\n```\n#### `$\u003e node markdown2json.js`\n\n```bash\n{\n  \"name\": \"Metadata\",\n  \"CONTENT\": [\n    \"pitch\",\n    \"news\",\n    \"requirements\",\n    \"program\",\n    \"schedule\",\n    \"support\",\n    \"contribute\",\n    \"about\"\n  ],\n  \"__content__\": \"\u003ch1 id=\\\"metadata-of-content\\\"\u003eMetadata of content\u003c/h1\u003e\"\n}\n```\n## USAGE - When `required module` -- json2markdown\n\n### [htmlified.json]\n```bash\n{\n  \"name\": \"Metadata\",\n  \"CONTENT\": [\n    \"pitch\",\n    \"news\",\n    \"requirements\",\n    \"program\",\n    \"schedule\",\n    \"support\",\n    \"contribute\",\n    \"about\"\n  ],\n  \"__content__\": \"\u003ch1 id=\\\"metadata-of-content\\\"\u003eMetadata of content\u003c/h1\u003e\"\n}\n```\n### [json2markdown.js]\n\n```js\nvar jmm = require('json-meta-marked');\nvar fs  = require('fs');\nvar obj = JSON.parse(fs.readFileSync('htmlified.json'));\nconsole.log(jmm.serialize(obj));\n```\n#### `$\u003e node json2markdown.js`\n\n```markdown\n---\n{\n  \"name\": \"Metadata\",\n  \"CONTENT\": [\n    \"pitch\",\n    \"news\",\n    \"requirements\",\n    \"program\",\n    \"schedule\",\n    \"support\",\n    \"contribute\",\n    \"about\"\n  ]\n}\n---\n\n# Metadata of content\n```\n\n## USAGE - From `cli` - markdown2json\n\n### [jsonfront.md]\n\n```markdown\n---\n{\n  \"name\": \"Metadata\",\n  \"CONTENT\": [\n    \"pitch\",\n    \"news\",\n    \"requirements\",\n    \"program\",\n    \"schedule\",\n    \"support\",\n    \"contribute\",\n    \"about\"\n  ]\n}\n---\n\n# Metadata of content\n```\n### cli:\n\n`$\u003e node install -g json-meta-marked`\nThen you can do one of the following:\n* `$\u003e cat jsonfront.md | jmm`\n* `$\u003e cat jsonfront.md | jmm --parse`\n\nwhich will print the parsed output to the terminal\n\n* `$\u003e cat jsonfront.md | jmm \u003e htmlified.json`\n* `$\u003e cat jsonfront.md | jmm --parse \u003e htmlified.json`\n\n`$\u003e cat htmlified.json`\n\n```bash\n{\n  \"name\": \"Metadata\",\n  \"CONTENT\": [\n    \"pitch\",\n    \"news\",\n    \"requirements\",\n    \"program\",\n    \"schedule\",\n    \"support\",\n    \"contribute\",\n    \"about\"\n  ],\n  \"__content__\": \"\u003ch1 id=\\\"metadata-of-content\\\"\u003eMetadata of content\u003c/h1\u003e\"\n}\n```\n## USAGE - From `cli` - json2markdown\n\n### cli\n* `$\u003e cat jsonfront.md | jmm --serialize`\n\nwhich will print the serialized output to the terminal\n\n* `$\u003e cat jsonfront.md | jmm --serialize \u003e jsonfront.md`\n\n`$\u003e cat jsonfront.md`\n\n### [jsonfront.md]\n\n```markdown\n---\n{\n  \"name\": \"Metadata\",\n  \"CONTENT\": [\n    \"pitch\",\n    \"news\",\n    \"requirements\",\n    \"program\",\n    \"schedule\",\n    \"support\",\n    \"contribute\",\n    \"about\"\n  ]\n}\n---\n\n# Metadata of content\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserapath%2Fjson-meta-marked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserapath%2Fjson-meta-marked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserapath%2Fjson-meta-marked/lists"}