{"id":17717734,"url":"https://github.com/mununki/rust_front_matter_parser","last_synced_at":"2025-03-14T02:31:15.148Z","repository":{"id":143922256,"uuid":"175041368","full_name":"mununki/rust_front_matter_parser","owner":"mununki","description":"A parser of the front matter in markdown files built with Rust","archived":false,"fork":false,"pushed_at":"2019-09-07T09:35:45.000Z","size":29,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-24T03:22:05.833Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mununki.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-11T16:32:52.000Z","updated_at":"2024-03-24T20:38:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"69d4275a-a020-46db-9bf1-b6eb0547013c","html_url":"https://github.com/mununki/rust_front_matter_parser","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/mununki%2Frust_front_matter_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frust_front_matter_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frust_front_matter_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frust_front_matter_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mununki","download_url":"https://codeload.github.com/mununki/rust_front_matter_parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243511657,"owners_count":20302593,"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-10-25T14:29:49.713Z","updated_at":"2025-03-14T02:31:15.136Z","avatar_url":"https://github.com/mununki.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Markdown front-matter parser\n\nThis is a front matter in markdown file(`*.md`, `*.mdx`) parser built with Rust.\n\n## What is front-matter?\n\nThe front matter is the metadata of markdown content. It stays on top of markdown content and contains the metadata of itself.\n\n```json\n---\ntitle: First Post\ncreatedAt: 2018-08-24\ncategory: [\"devlogs\"]\nkeyword: [\"first\", \"post\"]\n---\n\n// markdown body content...\n```\n\n## Features\n\n- Parsing the front matter in markdown file\n- Blazing fast\n- Creating `*.json` or `*.js` file from all markdown files in target directory\n- CLI tool\n\n## Build\n\n\u003e Cargo is required.\n\n```shell\n$ git clone https://github.com/mattdamon108/rust_front_matter_parser.git\n$ cd rust_front_matter_parser\n$ cargo build --release\n$ cargo install --path .\n```\n\n## How to use\n\n```shell\n$ mdfmp -h\nMarkdown front-matter parser 0.1.0\nmoondaddi \u003cwoonki.moon@gmail.com\u003e\nParse the front-matter data from '*.md' or '*.mdx' files\n\nUSAGE:\n\t\tmdfmp [OPTIONS] --filename \u003cFILE\u003e --type \u003cTYPE\u003e\n\nFLAGS:\n\t\t-h, --help       Prints help information\n\t\t-V, --version    Prints version information\n\nOPTIONS:\n\t\t-f, --filename \u003cFILE\u003e    Set the filename of output\n\t\t-s, --src \u003cdirectory\u003e    Set the source directory [default: .]\n\t\t-t, --type \u003cTYPE\u003e        Set the type of output [possible values: js, json]\n```\n\n```shell\n$ mdfmp -t js -f postList -s test\n```\n\n### Options\n\n- -t : (required) enum OutputType { `json`, `js` }\n- -f : (required) filename of output\n- -s : (default: `.`) target directory\n\n### Output\n\nJSON\n\n```json\n{\n  \"postList\": [\n    {\n      \"title\": \"Kill the process using port\",\n      \"createdAt\": \"2019-03-05\",\n      \"category\": [\"devlogs\"],\n      \"keyword\": [\"macos\", \"kill\", \"port\"]\n    },\n    {\n      \"title\": \"First Post\",\n      \"createdAt\": \"2018-08-24\",\n      \"category\": [\"devlogs\"],\n      \"keyword\": [\"first\", \"post\"]\n    }\n  ]\n}\n```\n\nJS\n\n```js\nconst postList = [\n  {\n    title: 'Kill the process using port',\n    createdAt: '2019-03-05',\n    category: ['devlogs'],\n    keyword: ['macos', 'kill', 'port'],\n  },\n  {\n    title: 'First Post',\n    createdAt: '2018-08-24',\n    category: ['devlogs'],\n    keyword: ['first', 'post'],\n  },\n];\n\nexport default postList;\n```\n\n### Next to do\n\n- [x] Write the output to file\n- [x] Parse only md, mdx files\n- [x] CLI message\n- [x] Optional CLI args with Clap\n- [x] Error Handling (!important)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Frust_front_matter_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmununki%2Frust_front_matter_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Frust_front_matter_parser/lists"}