{"id":19474590,"url":"https://github.com/tomasc/simple_form_markdown_editor","last_synced_at":"2025-08-19T06:38:01.100Z","repository":{"id":26903709,"uuid":"30365424","full_name":"tomasc/simple_form_markdown_editor","owner":"tomasc","description":"Extension for SimpleForm textarea with Markdown preview.","archived":false,"fork":false,"pushed_at":"2019-01-04T09:28:34.000Z","size":268,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-27T21:00:53.746Z","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":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-05T16:24:40.000Z","updated_at":"2018-11-07T16:25:15.000Z","dependencies_parsed_at":"2022-08-21T01:50:20.447Z","dependency_job_id":null,"html_url":"https://github.com/tomasc/simple_form_markdown_editor","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tomasc/simple_form_markdown_editor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_markdown_editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_markdown_editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_markdown_editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_markdown_editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasc","download_url":"https://codeload.github.com/tomasc/simple_form_markdown_editor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_markdown_editor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271113769,"owners_count":24701613,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:45.075Z","updated_at":"2025-08-19T06:38:01.067Z","avatar_url":"https://github.com/tomasc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleForm Markdown Editor\n\nA simple [Markdown](http://daringfireball.net/projects/markdown/) editor inspired by [gollum_editor](https://github.com/samknight/gollum_editor), the editor used for Github's wiki pages.\n\n[Markdown](http://daringfireball.net/projects/markdown/) rendering is handled by [Redcarpet](https://github.com/vmg/redcarpet).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'simple_form_markdown_editor'\n```\n\nAnd then execute:\n\n```sh\n$ bundle\n```\n\nOr install it yourself as:\n\n```sh\n$ gem install simple_form_markdown_editor\n```\n\n## Usage\n\nRequire the javascripts in `application.js`:\n\n```jsx\n//= require simple_form_markdown_editor\n```\n\nAnd require the stylesheets in `application.css`:\n\n```css\n*= require simple_form_markdown_editor\n```\n\nFinally mount the engine in your routes:\n\n```ruby\nmount SimpleFormMarkdownEditor::Engine =\u003e \"/\"\n```\n\nUse in forms:\n\n```slim\n= form.input :markdown, as: :markdown_editor\n```\n\n## Configuration\n\nConfiguration is possible app-wide (using an initializer) and per input.\n\nRefer to [redcarpet](https://github.com/vmg/redcarpet) for a list of available [extensions](https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use) and [render](https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch) options.\n\n### Global\n\n```ruby\n# config/initializers/simple_form_markdown_editor.rb\n\nSimpleFormMarkdownEditor::MarkdownEditorInput.configure do |c|\n  c.buttons = [%w(h1 h2 h3), %w(strong em), %w(a img)]\n  c.button_definitions = { strong: '**%{str}**' }\n  c.help = { enabled: true, visible: false }\n  c.extensions = {\n    footnotes: true,\n    smartypants: true,\n    lax_spacing: true,\n    escape_html: false\n  }\n  c.render_class = CustomRenderClass\n  c.render_options = {\n    no_images: true,\n    no_links: true\n  }\n  c.route = '/custom/preview'\nend\n```\n\n### Input\n\n```ruby\n= f.input :markdown, as: :markdown_editor, buttons: [ %w(h1 h2), %w(a img) ], help: { enabled: true, visible: false }, extensions: { footnotes: true }, render_class: CustomRenderClass, render_options: { no_images: true }, route: '/custom/preview'\n```\n\n## Internationalization\n\nAll strings (buttons, help etc.) are defined in a `I18n` `YAML` file along with buttons and tabs. This can easily be overridden and extended to other languages:\n\n```YAML\n# simple_form_markdown_editor.en.yml\n\nen:\n  simple_form_markdown_editor:\n    tabs:\n      edit: Write\n      preview: Sneak peek\n    buttons:\n      h1: Header 1\n      h2: Header 2\n      h3: Header 3\n      a: Link\n      img: Image\n    help:\n      block_elements:\n        title: Blocks\n        elements:\n          headers:\n            title: # Headers\n            text: A very good explanation\n```\n\n\n## Testing\n\nThe gem includes a rails app for easy testing, simply `cd test/dummy`, `bundle install` and `bundle exec bin/rails s`, then direct your browser to `127.0.0.1:3000` to see the editor in action.\n\n## Todo\n\n* How to make it possible to plug in other render engines?\n* Highlighting trailing spaces (for linebreaks)?\n* Implement keyboard shortcuts\n* Implement Ctrl+z\n* Implement install task (create YML and config)?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fsimple_form_markdown_editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasc%2Fsimple_form_markdown_editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fsimple_form_markdown_editor/lists"}