{"id":30107045,"url":"https://github.com/benignware/grunt-livemd","last_synced_at":"2025-08-10T01:33:00.980Z","repository":{"id":57255311,"uuid":"38578892","full_name":"benignware/grunt-livemd","owner":"benignware","description":"Generate live-samples from markdown files","archived":false,"fork":false,"pushed_at":"2016-04-28T14:43:10.000Z","size":36,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-13T22:29:12.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/benignware.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":"2015-07-05T18:13:54.000Z","updated_at":"2015-07-05T18:27:24.000Z","dependencies_parsed_at":"2022-09-04T13:10:16.742Z","dependency_job_id":null,"html_url":"https://github.com/benignware/grunt-livemd","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/benignware/grunt-livemd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fgrunt-livemd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fgrunt-livemd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fgrunt-livemd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fgrunt-livemd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benignware","download_url":"https://codeload.github.com/benignware/grunt-livemd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fgrunt-livemd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269663321,"owners_count":24455796,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"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":"2025-08-10T01:32:00.485Z","updated_at":"2025-08-10T01:33:00.946Z","avatar_url":"https://github.com/benignware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-livemd\n\n\u003e Generate live-samples from markdown files\n\nWith grunt-livemd you can easily generate runtime browser samples from corresponding code-blocks contained in markdown-files.\n\nSupported languages:\n\n* HTML\n* CSS\n* Javascript\n* Coffeescript\n* SCSS\n* Less\n* Haml\n\nIn addition to being a simple wrapper for [livemd](https://github.com/benignware/livemd), grunt-livemd also provides a preconfigured html-renderer.\nWhen rendered to html, you could either specify a custom lodash-template or use the bundled default one which is designed to resemble github presentation.\n\n[Demo](http://benignware.github.io/grunt-livemd)\n\n## Getting Started\nThis plugin requires Grunt `~0.4.5`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-livemd --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-livemd');\n```\n\n## The \"livemd\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `livemd` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  livemd: {\n    options: {\n      // Task-specific options go here.\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n    },\n  },\n});\n```\n\n### Options\n\n#### options.layout\nType: `String`\nDefault value: `'github'`\n\nPath to a custom template or a string identifier specifying a bundled layout. Pass in an object containing a `template`- and `data`-property to use custom variables inside the template. By default the template has access to the package.json stored in a key `pkg`.\n\n#### options.paths\nType: `Array`\nDefault value: `[]`\n\nProvide an array of include paths to pass to scss and less modules. Path to source is included by default.\n\n#### options.prefilter\nType: `Function`\nDefault value: `null`\n\nFilter the input markdown by providing a function taking the original string as argument and returning the modified string.\n\n#### options.title\nType: `String`\nDefault value: `''`\n\nSpecify the title of a rendered html page. Provide a function to set the title according to source file.\n\n#### options.wrap\nType: `String`\nDefault value: `'\u003cdiv class=\"highlight-example\"\u003e\u003c/div\u003e'`\n\nSpecify a wrapper for the generated live-samples.\n\n### Usage Examples\n\n#### Default Options\nIn this example, markdown as well as an html presentation containing live-samples is generated from a README.md-file.\n\n```js\ngrunt.initConfig({\n  livemd: {\n    options: {},\n    files: {\n      'dest/default_options/README.md': ['src/README.md'],\n      'dest/default_options/README.html': ['src/README.md']\n    },\n  },\n});\n```\n\n#### Custom Options\nIn this example, an html presentation containing live-samples is generated from a markdown-file with custom template and wrapper.\n\n```js\ngrunt.initConfig({\n  livemd: {\n    options: {\n      wrap: '\u003cdiv class=\"live-example\"\u003e\u003c/div\u003e',\n      layout: {\n        template: 'layout.html',\n        data: {\n          test: 'This example demonstrates how to use grunt-livemd with a custom template'\n        }\n      },\n      title: function(src) {\n        return \"Title of \" + src;\n      }\n    },\n    files: {\n      'dest/custom_options/README.html': ['src/README.md']\n    },\n  },\n});\n```\n\n#### Advanced Options\nThis example demonstrates how to strip off unwanted links by making use of a prefilter.\n\n```js\ngrunt.initConfig({\n  livemd: {\n    options: {\n      options: {\n        prefilter: function(string) {\n          return string.replace(grunt.config().pkg \u0026\u0026 grunt.config().pkg.homepage \u0026\u0026 new RegExp(\"\\\\[.*\\\\]\\\\(\" + grunt.config().pkg.homepage.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$\u0026\") + \"\\\\)\", \"gi\"), \"\");\n        }\n      }\n    },\n    files: {\n      'dest/advanced_options/README.html': ['src/README.md']\n    },\n  },\n});\n```\n\n## Demo Projects\n\n* [visualist](http://benignware.github.io/visualist/)\n* [jquery-findus](http://benignware.github.io/jquery-findus/)\n* [jquery-placepicker](http://benignware.github.io/jquery-placepicker/)\n* [jquery-vgrd](http://benignware.github.io/jquery-vgrd/)\n* [jquery-checkview](http://benignware.github.io/jquery-checkview/)\n* [jquery-countimator](http://benignware.github.io/jquery-countimator/)\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n\n* v0.0.6 - Fixed entities in inline code blocks\n* v0.0.5 - Fixed marked parsing links within html comments\n* v0.0.4 - Fixed incompatible pygments style\n* v0.0.3 - Updated `livemd` to v0.0.6\n* v0.0.2 - Updated `livemd` to v0.0.3, updated samples and tests, added demo site\n* v0.0.1 - Initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenignware%2Fgrunt-livemd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenignware%2Fgrunt-livemd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenignware%2Fgrunt-livemd/lists"}