{"id":15406475,"url":"https://github.com/odlp/redcarpet-render-seeing_is_believing","last_synced_at":"2025-03-28T02:24:41.904Z","repository":{"id":56891414,"uuid":"116605686","full_name":"odlp/redcarpet-render-seeing_is_believing","owner":"odlp","description":"Evaluates Ruby code in your markdown, for awesome examples","archived":false,"fork":false,"pushed_at":"2018-04-04T16:21:15.000Z","size":133,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-02T03:43:09.215Z","etag":null,"topics":["markdown","redcarpet","syntax-highlighting"],"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/odlp.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}},"created_at":"2018-01-07T22:58:11.000Z","updated_at":"2021-11-11T21:43:14.000Z","dependencies_parsed_at":"2022-08-21T00:20:53.669Z","dependency_job_id":null,"html_url":"https://github.com/odlp/redcarpet-render-seeing_is_believing","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/odlp%2Fredcarpet-render-seeing_is_believing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odlp%2Fredcarpet-render-seeing_is_believing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odlp%2Fredcarpet-render-seeing_is_believing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odlp%2Fredcarpet-render-seeing_is_believing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odlp","download_url":"https://codeload.github.com/odlp/redcarpet-render-seeing_is_believing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245956148,"owners_count":20700042,"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":["markdown","redcarpet","syntax-highlighting"],"created_at":"2024-10-01T16:23:11.195Z","updated_at":"2025-03-28T02:24:41.872Z","avatar_url":"https://github.com/odlp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redcarpet::Render::SeeingIsBelieving\n\n[![Build Status](https://travis-ci.org/odlp/redcarpet-render-seeing_is_believing.svg?branch=master)](https://travis-ci.org/odlp/redcarpet-render-seeing_is_believing)\n\nPowerup the Ruby examples in your markdown. Combines the excellent\n[Redcarpet][redcarpet] (a markdown parser) with [Seeing Is Believing][sib],\nwhich shows the evaluated result from each line of code.\n\nIf your markdown includes a fenced code block with `ruby+` specified as the\nlanguage:\n\n\u003cpre\u003e\u003ccode\u003e```ruby+\n  animals = [\"Aardvark\", \"Butterfly\", \"Camel\"]\n  animals.map(\u0026:upcase)\n```\u003c/code\u003e\u003c/pre\u003e\n\nThen you'll see the result of each line of code:\n\n![Example HTML](example_app/example.png)\n\n## Usage\n\nAdd the following line to your `Gemfile` and `bundle install`:\n\n```ruby\ngem \"redcarpet-render-seeing_is_believing\"\n```\n\nThen `prepend` the module in your renderer:\n\n```ruby\nrequire \"redcarpet/render/seeing_is_believing\"\nrequire \"redcarpet\"\n\nclass MyCustomHtmlRenderer \u003c Redcarpet::Render::HTML\n  prepend Redcarpet::Render::SeeingIsBelieving\n\n  def block_code(code, language)\n    \"\u003cpre\u003e\u003ccode\u003e#{code}\u003c/code\u003e\u003c/pre\u003e\"\n  end\nend\n\nRedcarpet::Markdown.new(MyCustomHtmlRenderer, fenced_code_blocks: true).\n  render(\"some markdown!\")\n```\n\nor combine with [Rouge][rouge] syntax highlighter:\n\n[rouge]: https://github.com/jneen/rouge\n\n```ruby\nrequire \"redcarpet/render/seeing_is_believing\"\nrequire \"redcarpet\"\nrequire \"rouge\"\nrequire \"rouge/plugins/redcarpet\"\n\nclass MyCustomHtmlRenderer \u003c Redcarpet::Render::HTML\n  include Rouge::Plugins::Redcarpet\n  prepend Redcarpet::Render::SeeingIsBelieving\nend\n\nRedcarpet::Markdown.new(MyCustomHtmlRenderer, fenced_code_blocks: true).\n  render(\"some markdown!\")\n```\n\n[redcarpet]: https://github.com/vmg/redcarpet\n[sib]: https://github.com/JoshCheek/seeing_is_believing\n\n## Options\n\nYou can pass additional options after the `ruby+` language hint:\n\n- `ruby+e`: Hints exceptions are expected, and should be displayed. Exceptions\n  are hidden by default.\n\n## TODO\n\n- Allow comments to be scoped to specific lines\n- Wrap comments to the following line when the overall length is greater than\n  80 chars\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodlp%2Fredcarpet-render-seeing_is_believing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodlp%2Fredcarpet-render-seeing_is_believing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodlp%2Fredcarpet-render-seeing_is_believing/lists"}