{"id":19474621,"url":"https://github.com/tomasc/simple_form_wysihtml","last_synced_at":"2026-06-15T11:32:36.929Z","repository":{"id":18452453,"uuid":"21645975","full_name":"tomasc/simple_form_wysihtml","owner":"tomasc","description":"Integrates Wysihtml5 editor with Rails and Simple Form.","archived":false,"fork":false,"pushed_at":"2015-03-25T10:40:58.000Z","size":500,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-23T20:33:28.492Z","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":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-09T09:03:03.000Z","updated_at":"2015-03-25T10:40:58.000Z","dependencies_parsed_at":"2022-08-21T01:50:19.883Z","dependency_job_id":null,"html_url":"https://github.com/tomasc/simple_form_wysihtml","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tomasc/simple_form_wysihtml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_wysihtml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_wysihtml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_wysihtml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_wysihtml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasc","download_url":"https://codeload.github.com/tomasc/simple_form_wysihtml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fsimple_form_wysihtml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34358763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","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:53.358Z","updated_at":"2026-06-15T11:32:36.913Z","avatar_url":"https://github.com/tomasc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Form Wysihtml\n\n[![Gem Version](https://badge.fury.io/rb/simple_form_wysihtml.svg)](http://badge.fury.io/rb/simple_form_wysihtml)\n\nIntegrates [Wysihtml5](http://xing.github.io/wysihtml5) editor (resp. [this branch](https://github.com/Edicy/wysihtml5) of it) with Rails and [Simple Form](https://github.com/plataformatec/simple_form).\n\n## Installation\n\nAdd the gem to your Gemfile:\n\n    gem 'simple_form_wysihtml'\n\nAnd execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install simple_form_wysihtml\n\nTo make it work you need to require the javascripts in `application.js`:\n\n    //= require simple_form_wysihtml\n\nOptionally you can add the (very minimal) default styling in `application.css`:\n\n    *= require simple_form_wysihtml\n\n## Usage\n\nUse in forms:\n\n    = form.input :body, as: :wysihtml\n\n## Styling\n\nSee [simple_form_wysihtml.css.scss](https://github.com/tomasc/simple_form_wysihtml/blob/master/lib/assets/stylesheets/simple_form_wysihtml.css.scss) for how to style the editor.\n\n## Configuration\n\n### The toolbar\n\nYou can override the defaults by specifying the toolbar in an initializer:\n\n```Ruby\n# config/initializers/simple_form_wysihtml.rb\n\nSimpleFormWysihtml::WysihtmlInput.configure do |c|\n  c.commands = [\n    { bold: { label: 'Bold' }, italic: { label: 'Italic' } },\n    { createLink:  { label: 'Create Link' } },\n    { insertOrderedList: nil, insertUnorderedList: nil }\n  ]\nend\n```\n\nAlternatively, you can configure individual input fields in the form:\n\n```Slim\n= f.input :body, as: :wysihtml, commands: [{ bold: { label: 'B' } }, { italic: { label: 'I' } }]\n```\n\nSee the [list of available commands](https://github.com/Edicy/wysihtml5/tree/master/src/commands).\n\n### Parser rules\n\nThe parser rules are defined as a javascript variable, containing a hash of rules (see [Wysihtml5x](https://github.com/Edicy/wysihtml5/tree/master/parser_rules).\n\nAdd a javascript file with your own parser rules (namespaced for example like this):\n\n```js\n// app/assets/javascripts/parser_rules.js\n\nYourCoolNameSpace = (function(){\n\n  var YourCoolNameSpace = {\n    parserRules: {\n      tags: {\n        i: {\n          rename_tag: 'em'\n        },\n\n        a: {\n          set_attributes: {\n            target: \"_self\"\n          }\n        }\n      }\n    }\n  }\n\n  return YourCoolNameSpace;\n})();\n```\n\nThen in your initializer assign the `parser_rules` to the name of your JS variable:\n\n```Ruby\n# config/initializers/simple_form_wysihtml.rb\n\nSimpleFormWysihtml::WysihtmlInput.configure do |c|\n  c.parser_rules = 'YourCoolNameSpace.parserRules'\nend\n```\n\n## TODO\n\n### Add remaining commands from wysihtml5:\n\n* addTableCells\n* bgColorStyle\n* removeLink\n* createTable\n* deleteTableCells\n* fontSizeStyle\n* foreColorStyle\n* justifyFull\n* mergeTableCells\n\nReference: [wysihtml5 wiki](https://github.com/edicy/wysihtml5/wiki/Supported-Commands).\n\n### Testing\n\nHow to do it?\n\n## Contributing\n\n1. Fork it ( https://github.com/tomasc/simple_form_wysihtml/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%2Fsimple_form_wysihtml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasc%2Fsimple_form_wysihtml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fsimple_form_wysihtml/lists"}