{"id":15449379,"url":"https://github.com/timelytree/showdown-classify","last_synced_at":"2025-03-29T15:21:29.795Z","repository":{"id":87251403,"uuid":"86761659","full_name":"timelytree/showdown-classify","owner":"timelytree","description":"Extension for ShowdownJS that wraps markdown input with syntax that outputs a \u003cdiv /\u003e with a class while still rendering the inner markdown formatting","archived":false,"fork":false,"pushed_at":"2017-04-01T00:51:42.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T16:15:50.549Z","etag":null,"topics":["javascript","showdown"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timelytree.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-03-31T00:30:50.000Z","updated_at":"2024-06-28T16:56:16.000Z","dependencies_parsed_at":"2023-05-27T02:45:36.885Z","dependency_job_id":null,"html_url":"https://github.com/timelytree/showdown-classify","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"61fab7a89d05620b8a384746881b685d2d64011e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelytree%2Fshowdown-classify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelytree%2Fshowdown-classify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelytree%2Fshowdown-classify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelytree%2Fshowdown-classify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timelytree","download_url":"https://codeload.github.com/timelytree/showdown-classify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246201154,"owners_count":20739707,"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":["javascript","showdown"],"created_at":"2024-10-01T20:53:38.567Z","updated_at":"2025-03-29T15:21:29.772Z","avatar_url":"https://github.com/timelytree.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### classify\n\nAlthough markdown is a fantastic markup language out-of-the-box, there are times when one needs to be able to target specific sections of markdown output via css classes, primarily for more fine-tuned styling. classify is an extension created for [ShowdownJS](https://github.com/showdownjs) - a fantastic open-source, javascript-based markdown parser - that gives you the ability to wrap markdown text in a `\u003cdiv\u003e` with a class while still being able to process markdown inside the `\u003cdiv\u003e`.\n\n### How to use\n\nBegin by including classify inside your website's `\u003chead\u003e` tag, after showdown.js\n\n```html\n\u003cscript type=\"text/javascript\" src=\"js/showdown.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"js/showdown-classify.js\"\u003e\u003c/script\u003e\n```\n\n### Enabling the extension\n\nOnce the extension is included, you can enable it when a new showdown Converter is initialized:\n\n```javascript\nvar converter = new showdown.Converter({\n  extensions: ['classify'],\n  // optionA: true,\n  // optionB: false\n});\n```\n\n### Example use case\n\nThis extension introduces a new piece of syntax to markdown itself. Using this will allow you to wrap markdown input inside a `\u003cdiv\u003e` with an identifying class of your choosing. The markdown inside the new tags _will be rendered as well_.\n\nThe syntax looks like this:\n\n```\n[tasty--]\n## Header\n1. Toast some bread\n2. Scrape fresh garlic onto bread\n3. Dip into olive oil\n[--tasty]\n```\n\nExample input:\n\n```javascript\nvar converter = new showdown.Converter({extensions: ['classify']}),\n    markdownInput = `\n\n      [tasty--]\n      ## Garlic Toast\n      1. Toast some bread\n      2. Scrape fresh garlic onto bread\n      3. Dip into olive oil\n      [--tasty]\n\n    `,\n    html = converter.makeHtml(markdownInput);\n```\n\nThis should output:\n\n```html\n\u003cdiv class=\"tasty\"\u003e\n  \u003ch2\u003eGarlic Toast\u003c/h2\u003e\n  \u003col\u003e\n    \u003cli\u003eToast some bread\u003c/li\u003e\n    \u003cli\u003eScrape fresh garlic onto bread\u003c/li\u003e\n    \u003cli\u003eDip into olive oil\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/div\u003e\n```\n\n## License\nYou are free to use, re-use, modify, integrate, incorporate, get angry at, ponder, or jump for joy at the thought of this code in any way you see fit :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimelytree%2Fshowdown-classify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimelytree%2Fshowdown-classify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimelytree%2Fshowdown-classify/lists"}