{"id":13837396,"url":"https://github.com/schmidt/literate_maruku","last_synced_at":"2025-04-13T13:17:05.222Z","repository":{"id":737257,"uuid":"387517","full_name":"schmidt/literate_maruku","owner":"schmidt","description":"Literate Maruku is a literate programming libary for Ruby based on the Markdown libary Maruku.","archived":false,"fork":false,"pushed_at":"2022-10-16T18:38:24.000Z","size":60,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T13:16:44.208Z","etag":null,"topics":["hacktoberfest","literate-programming","markdown","ruby"],"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/schmidt.png","metadata":{"files":{"readme":"README.rdoc","changelog":"History.rdoc","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":"2009-11-27T14:37:24.000Z","updated_at":"2022-10-16T18:41:16.000Z","dependencies_parsed_at":"2022-07-07T18:30:25.217Z","dependency_job_id":null,"html_url":"https://github.com/schmidt/literate_maruku","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fliterate_maruku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fliterate_maruku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fliterate_maruku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fliterate_maruku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schmidt","download_url":"https://codeload.github.com/schmidt/literate_maruku/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717237,"owners_count":21150389,"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":["hacktoberfest","literate-programming","markdown","ruby"],"created_at":"2024-08-04T15:01:08.026Z","updated_at":"2025-04-13T13:17:05.180Z","avatar_url":"https://github.com/schmidt.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"= Literate Maruku\n\nLiterate Maruku is a literate programming libary for ruby based on the markdown\nlibary maruku. This is basically what the name say, isn't it?\n\n== The Basics\n\nThere are two possible accesses to the libary. A programming API and a command\nline interface. The first may be used to write better documented tests,\nfor example. Just write a little bit of code in your test_helper and call\nLiterate Maruku there and your markdown formatted tests will be executed.\n\nThe command line interface may the be used inside of a rake task, e.g. to\ngenerate some html files out of your test files demonstrating their usage.\nWe have used this approach in ContextR, so have a look there to get some input.\n\n\n== Demonstration of Use\n\n=== The Markdown Syntax\n\nLiterate Maruku simply extends the functionality of Maruku and adds some\nmethods to make standard use cases easier. You may find detailed information\nabout maruku at {their project page}[http://maruku.rubyforge.org/]. They added\nsome nice features to {Markdown\nformatting}[http://daringfireball.net/projects/markdown/syntax], esp. the {meta\ndata syntax}[http://maruku.rubyforge.org/proposal.html] which made implementing\nliterate maruku a charm.\n\nWanna see examples? Okay, here they are:\n\n==== Markdown\n\n  This is a normal paragraph, followed by a plain old code block\n\n      literate_maruku == maruku + ruby\n\n  And the following code block will not only be rendered, but also executed.\n\n      def echo_block(string)\n        (0...(text.size)).map{|i| text[0..i]}.reverse.join(\" ... \")\n      end\n  {: execute}\n\n  And, finally, the following block will be executed and its output will be\n  rendered as well.\n\n      echo_block(\"hallo\")\n  {: execute attach_output}\n\n\n==== HTML\n\nThis is a normal paragraph, followed by a plain old code block\n\n  literate_maruku == maruku + ruby\n\nAnd the following code block will not only be rendered, but also executed.\n\n  def echo_block(string)\n    (0...(text.size)).map{|i| text[0..i]}.reverse.join(\" ... \")\n  end\n\nAnd, finally, the following block will be executed and its output will be\nrendered as well.\n\n  echo_block(\"hallo\")\n  \u003e\u003e \"hello ... hell ... hel ... he ... h\"\n\n\n== The Command Line Interface\n\nSimply call \u003ctt\u003eliterate_maruku filename.mkd\u003c/tt\u003e to load your markdown\nformatted ruby files. This will execute the code but not generate any output.\nIt basically works like a simpe \u003ctt\u003eruby filename.rb\u003c/tt\u003e call, but without all\nthe command line parameters the +ruby+ command supports.\n\nIf you like to generate some html files, append an additional parameter, which\ntells literate_maruku where to put the output.\n\u003ctt\u003eliterate_maruku --output_path=test filename.mkd\u003c/tt\u003e would file the output\nof \u003ctt\u003efilename.mkd\u003c/tt\u003e to \u003ctt\u003etest/filename.html\u003c/tt\u003e. That's all, folks.\n\n== The Programming Interface\n\nTo use Literate Maruku in your own special way simply use the\n\u003ctt\u003eLiterateMaruku#require\u003c/tt\u003e method.\n\n  require 'literate_maruku'\n\n  LiterateMaruku.require('filename.mkd') # or\n  LiterateMaruku.require('filename.mkd', :output =\u003e \"test\")\n\nThese will have the same result as the command line examples.\n\nIf you are unhappy with these little possibilities, no problem: You may still\nuse the standard maruku interface to do with your markdown string, what you like\nafter require'ing literate_maruku the maruku code base is extended for the\nliterate programming style.\n\n\n== Installing \u0026 Compatibility\n\n  gem install literate_maruku\n\nLiterate Maruku is currently only tested and known to work with\n\n* Ruby 2.7, 3.0, 3.1\n\n\n== Additional Resources\n\n* {Project's website}[http://github.com/schmidt/literate_maruku/]\n* {Introductory Talk about literate_maruku}[http://www.slideshare.net/schmidt/literate-maruku] (contains outdated URLs)\n* {API doc}[http://rdoc.info/projects/schmidt/literate_maruku]\n* {Build Status on GitHub Actions}[https://github.com/schmidt/literate_maruku/actions]\n\n\n== How to submit patches\n\nIn order to submit patches, please fork the repository on GitHub, add your\npatches to your own copy and send a \"Pull Request\" afterwards. I will then try\nto add your submissions as soon as possible. Patches containing corresponding\ntests are always welcome.\n\nBug reports or general feature requests should be added using GitHub Issues.\n\n\n== License\n\nThis code is free to use under the terms of the MIT license.\n\n  :include: License.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschmidt%2Fliterate_maruku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschmidt%2Fliterate_maruku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschmidt%2Fliterate_maruku/lists"}