{"id":16241280,"url":"https://github.com/dtex/lexify","last_synced_at":"2025-04-08T09:52:44.503Z","repository":{"id":66259144,"uuid":"175028462","full_name":"dtex/lexify","owner":"dtex","description":"Converts lexicon md files to HTML and JSONLD","archived":false,"fork":false,"pushed_at":"2019-06-23T21:52:08.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T10:17:09.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/dtex.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-11T15:23:40.000Z","updated_at":"2019-06-23T21:52:10.000Z","dependencies_parsed_at":"2023-02-20T20:01:02.809Z","dependency_job_id":null,"html_url":"https://github.com/dtex/lexify","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/dtex%2Flexify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Flexify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Flexify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Flexify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtex","download_url":"https://codeload.github.com/dtex/lexify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819946,"owners_count":21001394,"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-10T14:06:55.706Z","updated_at":"2025-04-08T09:52:44.480Z","avatar_url":"https://github.com/dtex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lexify\nConverts lexicon md files to HTML and JSONLD. Lexicon md files are compact format definition lists and the generated HTML will include RDFa microformatting and the JSONLD will be valid based on specs from schema.org.\n\n## Usage\nlexify is intended to be run via npx in a properly prepared directory.\n\n````bash\nnpx lexify [src] [dest] [template]\n````\n```[src]``` is a directory or markdown file. If a directory is passed all md files in the directory will be parsed (default ```./src```)\n\n```[dest]``` is a destination directory (default ```./docs```)\n\n```[template]``` is the mustache template for the HTML page (default ```./template/lexicon.mustache```)\n\nEverything in the ```dest``` folder is generated by lexify, just make sure the folder exists.\n\nA properly formatted src file is a compact format definition list with one term per line. You can add HTML into either the term or definition. It has a markdown extension so that it is nice and readable in github, but it's really just HTML. Here is a properly formatted src file:\n\n````html\n\u003cdl\u003eBaseball Pitching Terms\n\u003cdt\u003e\u003ca href=\"https://authoritativeSource.com\"\u003eFastball\u003c/a\u003e\u003cdd\u003eA pitch thrown at or near maximum speed\n\u003cdt\u003eChange Up\u003cdd\u003eA pitch that mimics a fastball's mechanics, but is held deeper in the hand so that it arrives more slowly and throws off the batters timing.\n\u003cdt\u003eCurve Ball\u003cdd\u003eA pitch thrown with forward rotation that causes it to dive before reaching the batter.\n````\n\nlexify uses the Mustache templating language. Since Mustache is \"logic-less\" we can't just pass in the json-ld as the view (Boo!). We have to pass in a view that fits the following format. Don't worry, this is done behind the scenes, it's provided here as a reference for your own Mustache template:\n\n````js\nlexica: [\n  {\n    termset: [{\n      \"@type\":[String],\n      \"@id\":String,\n      \"name\":String\n    }],\n    terms: [{\n      \"@type\": String,\n      \"@id\": String,\n      \"name\": String,\n      \"description\": String,\n      \"inDefinedTermSet\": String\n    },\n    ...\n    ]\n  }\n]\n````\nIf there are multiple lexicon markdown files, they will be concatentated into one view and passed to the Mustache template as additional elements in the lexica array.\n\nYou will need a ```template/lexicon.mustache``` file that is used to render the HTML. Here's a starting point, but feel free to make it yours:\n\n````html\n\u003ch1\u003eMy Awesome List of Terms\u003c/h1\u003e\n\n{{#lexica}}\n  \u003cdl vocab=\"http://schema.org/\"\u003e\n  {{#termset}}\n    \u003cdiv typeof=\"{{@type}}\"\u003e\n      \u003ch2\u003e\n        \u003ca property=\"itemid\" href=\"{{\u0026 @id}}\"\u003e\u003cspan property=\"name\"\u003e{{name}}\u003c/span\u003e\u003c/a\u003e\n      \u003c/h2\u003e\n    \u003c/div\u003e\n  {{/termset}}\n  {{#terms}}\n    \u003cdiv typeof=\"DefinedTerm\"\u003e\n      \u003clink property=\"url\" href=\"{{\u0026 @id}}\"/\u003e\n      \u003cdt property=\"name\"\u003e{{name}}\u003c/dt\u003e\n      \u003cdd property=\"description\"\u003e{{description}}\u003c/dd\u003e\n      \u003clink property=\"inDefinedTermSet\" href=\"{{#termset}}{{\u0026 @id}}{{/termset}}\" /\u003e\n    \u003c/div\u003e\n  {{/terms}}\n  \u003c/dl\u003e\n{{/lexica}}\n````","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtex%2Flexify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtex%2Flexify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtex%2Flexify/lists"}