{"id":19474573,"url":"https://github.com/tomasc/mongoid_markdown_extension","last_synced_at":"2025-04-25T12:31:53.236Z","repository":{"id":18426726,"uuid":"21609164","full_name":"tomasc/mongoid_markdown_extension","owner":"tomasc","description":"Custom field type for Mongoid that handles Markdown conversion via Redcarpet gem.","archived":false,"fork":false,"pushed_at":"2023-11-17T13:44:35.000Z","size":54,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T15:18:22.043Z","etag":null,"topics":[],"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/tomasc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2014-07-08T10:46:27.000Z","updated_at":"2023-02-14T10:14:19.000Z","dependencies_parsed_at":"2023-11-17T14:42:26.781Z","dependency_job_id":"f118fd7e-2824-49be-a291-70a5cd77b2e5","html_url":"https://github.com/tomasc/mongoid_markdown_extension","commit_stats":{"total_commits":81,"total_committers":6,"mean_commits":13.5,"dds":0.3580246913580247,"last_synced_commit":"3db57fd42f784edfe237e5cca69cf99fe731ee94"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fmongoid_markdown_extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fmongoid_markdown_extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fmongoid_markdown_extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fmongoid_markdown_extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasc","download_url":"https://codeload.github.com/tomasc/mongoid_markdown_extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250817806,"owners_count":21492226,"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-11-10T19:25:42.457Z","updated_at":"2025-04-25T12:31:52.872Z","avatar_url":"https://github.com/tomasc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mongoid Markdown Extension\n\n[![Build Status](https://travis-ci.org/tomasc/mongoid_markdown_extension.svg)](https://travis-ci.org/tomasc/mongoid_markdown_extension) [![Gem Version](https://badge.fury.io/rb/mongoid_markdown_extension.svg)](http://badge.fury.io/rb/mongoid_markdown_extension)\n\n[Mongoid](https://github.com/mongoid/mongoid) field extension that returns an object with `to_html` method returning the content converted from Markdown syntax to html. The Markdown conversion is done using the [Redcarpet](https://github.com/vmg/redcarpet) library.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'mongoid_markdown_extension'\n```\n\nAnd then execute:\n\n```sh\n$ bundle\n```\n\nOr install it yourself as:\n\n```sh\n$ gem install mongoid_markdown_extension\n```\n\n## Configuration\n\nThe defaults are as follows:\n\n```ruby\nextensions = {\n  autolink: true\n  footnotes: true\n  highlight: true\n  space_after_headers: true\n  strikethrough: true\n  superscript: true\n}\n\nrender_options = {}\n```\n\nThese can be overwritten with an initializer, for example `config/initializers/mongoid_markdown.rb`:\n\n```ruby\nMongoidMarkdownExtension::Markdown.configure do |c|\n  c.extensions = { autolink: true }\n  c.render_class = CustomRenderer\n  c.render_options = { filter_html: true }\nend\n```\n\nSee [Redcarpet documentation](https://github.com/vmg/redcarpet) for available extensions and render options.\n\n## Usage\n\nAdd to a Mongoid model:\n\n```ruby\nclass MyModel\n  include Mongoid::Document\n  field :text, type: MongoidMarkdownExtension::Markdown\nend\n```\n\nUse it:\n\n```Ruby\nmy_model.text = \"*foo*\"\n\nmy_model.text.to_html # =\u003e \u003cstrong\u003efoo\u003c/strong\u003e\nmy_model.text.to_s # =\u003e *foo*\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/tomasc/mongoid_markdown_extension/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 a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fmongoid_markdown_extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasc%2Fmongoid_markdown_extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fmongoid_markdown_extension/lists"}