{"id":13558148,"url":"https://github.com/bradgessler/formdown","last_synced_at":"2025-05-07T23:02:42.160Z","repository":{"id":19303402,"uuid":"22540973","full_name":"bradgessler/formdown","owner":"bradgessler","description":"A Markdown-like syntax for web forms.","archived":false,"fork":false,"pushed_at":"2014-12-04T20:04:14.000Z","size":280,"stargazers_count":38,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T10:21:27.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bradgessler.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}},"created_at":"2014-08-02T06:53:21.000Z","updated_at":"2024-11-03T11:53:20.000Z","dependencies_parsed_at":"2022-08-03T15:10:11.046Z","dependency_job_id":null,"html_url":"https://github.com/bradgessler/formdown","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgessler%2Fformdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgessler%2Fformdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgessler%2Fformdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgessler%2Fformdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradgessler","download_url":"https://codeload.github.com/bradgessler/formdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968102,"owners_count":21833251,"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-08-01T12:04:46.669Z","updated_at":"2025-05-07T23:02:42.132Z","avatar_url":"https://github.com/bradgessler.png","language":"Ruby","funding_links":[],"categories":["Ruby","others"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/bradgessler/formdown.svg?branch=master)](https://travis-ci.org/bradgessler/formdown)\n\n# Formdown\n\nFormdown is a way to create documents that need form elements such as contracts, tax filings, sign-up pages, business forms, etc. Based on [Markdown](http://daringfireball.net/projects/markdown/), it puts an emphasis on readability and ease of authoring by humans in a plain text format that can be saved as a file and tracked by a version control system or easily shared. The content-focused nature of Formdown forces a separation of presentation that makes the resulting HTML web forms more accessible and responsive to a wider number of people with different disabilities or devices.\n\n## Example\n\nThe Formdown document:\n\n```\nHi _________(Name)\n\nHow are you doing today? () Good () Ok () Bad\n\nCould I have your email address? __________@(Email)\n\nWrite a few lines that describe your mood: ____________///(Mood)\n\n[ Submit your feelings ]\n```\n\nGenerates the following HTML:\n\n```html\n\u003cp\u003eHi   \u003cinput type=\"text\" placeholder=\"Name\" name=\"Name\" size=\"9\"\u003e\u003c/input\u003e\n\u003c/p\u003e\n\n\u003cp\u003eHow are you doing today?   \u003cinput type=\"radio\"\u003e\u003c/input\u003e\n Good   \u003cinput type=\"radio\"\u003e\u003c/input\u003e\n Ok   \u003cinput type=\"radio\"\u003e\u003c/input\u003e\n Bad\u003c/p\u003e\n\n\u003cp\u003eCould I have your email address?   \u003cinput type=\"email\" placeholder=\"Email\" name=\"Email\" size=\"10\"\u003e\u003c/input\u003e\n\u003c/p\u003e\n\n\u003cp\u003eWrite a few lines that describe your mood:   \u003ctextarea placeholder=\"Mood\" name=\"Mood\" cols=\"12\" rows=\"3\"\u003e\u003c/textarea\u003e\n\u003c/p\u003e\n\n\u003cp\u003e  \u003cinput type=\"submit\" value=\"Submit your feelings\"\u003e\u003c/input\u003e\n\u003c/p\u003e\n```\n\nA more extensive reference of Formdown in action may be found in the [kitchen sink](./spec/fixtures/kitchen_sink.fmd) fmd file. As this gem matures more extensive syntax documentation will be created for version 1.0.\n\n## Installation \u0026 Usage\n\nFormdown works in most popular Ruby web frameworks, the command lin, and of course plain 'ol Ruby.\n\n### Rails\n\nIn the rails Gemfile, include the formdown gem via:\n\n```ruby\ngem \"formdown\", require: \"formdown/rails\"\n```\n\nRails will pick up files with the extension `.fmd` and render them as HTML. For example, `app/views/user/my_form.html.fmd` would render the formdown document.\n\nIts recommended to use a layout around the Formdown file to handle the form submission action and surrounding HTML content.\n\n**Note**: There's currently no simple way of mapping Formdown fields to ActiveRecord model attributes.\n\n### Sinatra\n\nIn the Gemfile, include the formdown gem via:\n\n```ruby\ngem \"formdown\", require: \"sinatra/formdown\"\n```\n\nPlace your Formdown file in the [Sinatra](http://www.sinatrarb.com/) `./views` directory (e.g. `views/my_form.html.fmd`), then add the following route to your Sinatra app:\n\n```ruby\nget '/my_form' do\n  formdown :my_form\nend\n```\n\nand the form will render at `/my_form`.\n\n### Middleman\n\nIn the Gemfile, include the formdown gem via:\n\n```ruby\ngem \"formdown\", require: \"middleman/formdown\"\n```\n\nPlace your Formdown file in the [Middleman](http://middlemanapp.com/) `./source` directory and the form will render (e.g. `source/my_form.html.fmd` will render the form at `/my_form.html`)\n\n### Command line\n\nInstall the gem:\n\n    $ gem install formdown\n\nThe quickest way to render Formdown is via the command line. Just cat your file into the render and you'll get HTML:\n\n```sh\n$ cat my_form.fmd | formdown render \u003e my_form.html\n```\n\nNow open `my_form.html` and enjoy all of that HTML goodness.\n\n### Ruby\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'formdown'\n```\n\nAnd then execute:\n\n    $ bundle\n\nWrite the following code in your Ruby application to compile the Formdown:\n\n```ruby\ntext = \"What is your email address? _________@(Email)\"\nformdown = Formdown::Renderer.new(text)\nformdown.to_html # =\u003e \"\u003cp\u003eWhat is your email address?   \u003cinput type=\\\"email\\\" placeholder=\\\"Email\\\" name=\\\"Email\\\" size=\\\"9\\\"\u003e\u003c/input\u003e\\n\u003c/p\u003e\\n\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/bradgessler/formdown/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%2Fbradgessler%2Fformdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradgessler%2Fformdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradgessler%2Fformdown/lists"}