{"id":15511174,"url":"https://github.com/zarqman/markdown_views","last_synced_at":"2025-07-08T01:31:44.729Z","repository":{"id":55879443,"uuid":"96577844","full_name":"zarqman/markdown_views","owner":"zarqman","description":"Makes Rails handle .md templates, with optional preprocessing of ERB, HAML, etc. Easily configurable; uses CommonMarker \u0026 Rouge.","archived":false,"fork":false,"pushed_at":"2025-01-18T21:17:46.000Z","size":76,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T17:35:37.127Z","etag":null,"topics":["gem","markdown","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/zarqman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2017-07-07T21:28:10.000Z","updated_at":"2025-07-02T19:15:59.000Z","dependencies_parsed_at":"2023-12-26T04:31:21.315Z","dependency_job_id":"2383e42b-7146-420d-8bb4-299ef789f393","html_url":"https://github.com/zarqman/markdown_views","commit_stats":{"total_commits":47,"total_committers":5,"mean_commits":9.4,"dds":0.08510638297872342,"last_synced_commit":"c33c68a232043eed8f9839b0c23605099d2639d6"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/zarqman/markdown_views","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fmarkdown_views","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fmarkdown_views/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fmarkdown_views/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fmarkdown_views/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zarqman","download_url":"https://codeload.github.com/zarqman/markdown_views/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fmarkdown_views/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264175374,"owners_count":23568451,"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":["gem","markdown","rails","ruby"],"created_at":"2024-10-02T09:52:52.387Z","updated_at":"2025-07-08T01:31:44.703Z","avatar_url":"https://github.com/zarqman.png","language":"CSS","readme":"# MarkdownViews\n\nMarkdownViews enables Rails to process .md templates as part of `app/views/`, with optional preprocessing of ERB, HAML, etc. A `markdown()` helper is also provided for when you need Markdown for only part of a view.\n\nIt uses CommonMarker for markdown processing and Rouge for syntax highlighting.\n\n\n## Usage: Views\n\nJust create views as `some_action.html.md` instead of `some_action.html.erb` and write them with Markdown instead of HTML. You can still use ERB (or HAML, etc -- see below).\n\n    # My page title\n\n    Hello, **\u003c%= current_user.first_name %\u003e**.\n\n    ```ruby\n    def syntax_highlighting\n      'works too!'\n    end\n    ```\n\n\n## Usage: Helper\n\nMarkdownViews also includes a simple Markdown rendering helper.\n\n    \u003c%= markdown('## Some markdown text') %\u003e\n\n    \u003c%= markdown do %\u003e\n    ## Some markdown text\n    \u003c% end %\u003e\n\n\n## Configuration\n\nBy default, all HTML comments are stripped from the output. Occasionally this can cause issues with inline Javascript or otherwise be undesired. To disable, add the following to an initializer:\n\n    MarkdownViews.strip_comments = false\n\nBy default, all .md files are preprocessed with ERB (making them effectively .md.erb files). This can be changed or disabled by setting a different template handler or setting to nil, respectively.\n\n    MarkdownViews.preprocessor = :erb\n    MarkdownViews.preprocessor = nil\n\nCommonMarker's rendering can also be configured. See [CommonMarker's documentation](https://github.com/gjtorikian/commonmarker#options-and-plugins) for available options.\n\n    MarkdownViews.parsing_opts.merge! smart: false\n\n    MarkdownViews.rendering_opts.merge! unsafe: false\n\n    MarkdownViews.extensions.merge! tasklist: true\n\nLikewise, Rouge can be configured:\n\n    # Use inline formatting:\n    MarkdownViews.rouge_opts.merge! formatter: Rouge::Formatters::HTMLInline.new('monokai')\n\n    # Enable line numbers:\n    MarkdownViews.rouge_opts.merge!(\n      formatter: Rouge::Formatters::HTMLTable.new(Rouge::Formatters::HTML.new, code_class: 'rouge-highlight'),\n      wrap: false\n    )\n\nThe standard CSS themes from Rouge are available via the asset pipeline. To use one, add it to your `application.css`:\n\n    *= require rouge.monokai\n\nSee `app/assets/stylesheets/` for the complete list.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'markdown_views'\n\nAnd then execute:\n\n    $ bundle\n\n\n## Gem versions\n\nThe 3.x series uses CommonMarker 1.x or 2.x and Rouge. It is compatible with Rails 6.1-8+.\nThe 2.x series uses CommonMarker 0.x and Rouge. It is compatible with Rails 5.0-8.0.\n\n#### Upgrading from 2.x to 3.x\n\nCommonMarker 1.x swapped out the underlying parser. While the rendered markdown output is very similar, the configuration flags were reworked. This gem's defaults are roughly the same as before. However, if your configuration was previously customized, it will need to be updated.\n\nCommonMarker 1's new syntax highlighting is not used, with preference instead given to Rouge. This preserves rendering compatibility, including existing stylesheets.\n\nThe stylesheets were refreshed from Rouge 4.4 which corrects a few missing CSS selectors. The github stylesheet was also renamed from `rouge.github` to `rouge.github.light`.\n\n\n## Contributing\n\n1. Fork it ( http://github.com/zarqman/markdown_views/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n\n## License\n\nMIT\n","funding_links":[],"categories":["CSS"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarqman%2Fmarkdown_views","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzarqman%2Fmarkdown_views","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarqman%2Fmarkdown_views/lists"}