{"id":16948306,"url":"https://github.com/technicalpickles/has_markup","last_synced_at":"2025-09-20T17:33:14.775Z","repository":{"id":411920,"uuid":"31171","full_name":"technicalpickles/has_markup","owner":"technicalpickles","description":"Manage markup close to home... right in the model! Caching, validation, etc","archived":false,"fork":false,"pushed_at":"2010-03-08T03:32:03.000Z","size":272,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-11T15:58:58.711Z","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/technicalpickles.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-07-04T04:55:36.000Z","updated_at":"2019-08-13T13:28:21.000Z","dependencies_parsed_at":"2022-07-18T03:16:50.789Z","dependency_job_id":null,"html_url":"https://github.com/technicalpickles/has_markup","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_markup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_markup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_markup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_markup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technicalpickles","download_url":"https://codeload.github.com/technicalpickles/has_markup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233679491,"owners_count":18713093,"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-10-13T21:50:17.414Z","updated_at":"2025-09-20T17:33:09.439Z","avatar_url":"https://github.com/technicalpickles.png","language":"Ruby","readme":"= HasMarkup\n\nI don't know about you, but I'm not too much of a fan of writing out raw HTML when I'm trying to belt out some blog posts. Keeping track of those pesky closing tags, escaping entities, and so on, can really get in the way of your creativity.\n\nAs a result, most blogs provide a simplified markup or some sort of editor. For technicalpickles.com[http://technicalpickles.com], I went with markdown[http://daringfireball.net/projects/markdown/].\n\nI extracted this markup magic out of my blog, and this plugin is the result. It lets you:\n\n * Specify a column contains markup\n * Specify the syntax (markdown and textile, with markdown being the default)\n * Specify if the markup column is required\n * Generate a helper for generating the HTML\n * Specify if the HTML should be cached in the database\n * ... all using only one line\n\n== Example\n\nIn your model:\n\n  class Post\n    has_markup :content, :syntax =\u003e :markdown, :required =\u003e true, :cache_html =\u003e true\n  end\n  \nNow post will have a 'content_html' method for generating the\n\nSo, you can use it in your view:\n\n  \u003ch2\u003e\u003c%= h @post.title %\u003e\u003c/h2\u003e\n  \u003cdiv\u003e\n    \u003c%= @post.cached_content_html %\u003e\n  \u003c/div\u003e\n\nAnd you can test it easily using Shoulda:\n\n  require 'has_markup/shoulda'\n  class PostTest \u003c Test::Unit::TestCase\n    should_have_markup :content, :syntax =\u003e :markdown, :required =\u003e true, :cache_html =\u003e true\n  end\n\n== License\n\nCopyright (c) 2008 Josh Nichols, released under the MIT license\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Fhas_markup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnicalpickles%2Fhas_markup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Fhas_markup/lists"}