{"id":13878333,"url":"https://github.com/phlex-ruby/phlex-markdown","last_synced_at":"2025-06-20T11:07:32.659Z","repository":{"id":63728127,"uuid":"567217654","full_name":"phlex-ruby/phlex-markdown","owner":"phlex-ruby","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-05T09:16:21.000Z","size":23,"stargazers_count":28,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-10T21:02:11.869Z","etag":null,"topics":["markdown","phlex","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/phlex-ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["joeldrapper"]}},"created_at":"2022-11-17T10:22:51.000Z","updated_at":"2025-05-05T09:16:25.000Z","dependencies_parsed_at":"2023-01-31T17:15:49.232Z","dependency_job_id":"b5a8c9cf-721e-4e36-8f6e-0ccfd6e4c1a9","html_url":"https://github.com/phlex-ruby/phlex-markdown","commit_stats":null,"previous_names":["joeldrapper/phlex-markdown"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/phlex-ruby/phlex-markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlex-ruby%2Fphlex-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlex-ruby%2Fphlex-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlex-ruby%2Fphlex-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlex-ruby%2Fphlex-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phlex-ruby","download_url":"https://codeload.github.com/phlex-ruby/phlex-markdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlex-ruby%2Fphlex-markdown/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260933200,"owners_count":23084951,"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":["markdown","phlex","ruby"],"created_at":"2024-08-06T08:01:46.608Z","updated_at":"2025-06-20T11:07:27.643Z","avatar_url":"https://github.com/phlex-ruby.png","language":"Ruby","readme":"# `phlex-markdown`\n\n`Phlex::Markdown` is a [Phlex](https://phlex.fun) view that renders Markdown into HTML using Phlex. You could use it directly — it takes a String of markdown and renders it to safe HTML.\n\nAlternatively, you can define a sub-class and override various methods to customise the output.\n\nFor example, here we override `h1` and `ul`, adding some Tailwind classes to them.\n\n```ruby\nclass MyMarkdown \u003c Phlex::Markdown\n  def h1 = super(class: \"font-bold text-xl\")\n  def ul = super(class: \"ml-4 pt-2\")\nend\n```\n\nWhen we render the view.\n\n```ruby\ncontent = \u003c\u003c~MD\n  # Hello World\n\n  - A\n  - B\n  - C\nMD\n\noutput = MyMarkdown.new(content).call\n```\n\nThe `output` will use the attributes from our methods.\n\n```html\n\u003ch1 class=\"font-bold text-xl\"\u003eHello World\u003c/h1\u003e\n\u003cul class=\"ml-4 pt-2\"\u003e\n  \u003cli\u003eA\u003c/li\u003e\n  \u003cli\u003eB\u003c/li\u003e\n  \u003cli\u003eC\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nYou could also wrap the whole document in an `\u003carticle\u003e` element by overriding `template`.\n\n```ruby\nclass MyMarkdownArticle \u003c Phlex::Markdown\n  def template\n    article(class: \"prose\") { super }\n  end\nend\n```\n\n### Community 🙌\n\nEveryone interacting in Phlex codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/joeldrapper/phlex/blob/main/CODE_OF_CONDUCT.md).\n\n### Sponsorship 💖\n\nMaintaining a library is a lot of work. If your company benefits from this work or is likely to benefit from it in the future, please consider [sponsorship](https://github.com/sponsors/joeldrapper). Phlex is actively developed and maintained by **[Joel Drapper](https://github.com/sponsors/joeldrapper)**.\n\n### Security 🚨\n\nIf you’ve found a potential security issue, please email [security@phlex.fun](mailto:security@phlex.fun).\n","funding_links":["https://github.com/sponsors/joeldrapper","https://github.com/sponsors/joeldrapper)*"],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlex-ruby%2Fphlex-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphlex-ruby%2Fphlex-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlex-ruby%2Fphlex-markdown/lists"}