{"_id":"hof-middleware-markdown","_rev":"60-da301dc579f87b3f7b0216ce5c3f9a06","name":"hof-middleware-markdown","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"hof-middleware-markdown","version":"1.0.0","author":{"name":"Leonard Martin","email":"hello@lennym.co.uk"},"license":"MIT","_id":"hof-middleware-markdown@1.0.0","maintainers":[{"name":"lennym","email":"leonard.martin@gmail.com"}],"homepage":"https://github.com/UKHomeOfficeForms/hof-middleware-markdown#readme","bugs":{"url":"https://github.com/UKHomeOfficeForms/hof-middleware-markdown/issues"},"dist":{"shasum":"4f69b69c08f916f62f04ef966c258ddbdf4cfb81","tarball":"https://registry.npmjs.org/hof-middleware-markdown/-/hof-middleware-markdown-1.0.0.tgz","integrity":"sha512-O9b2Qx5lToYygUt7yosvR9C21RZtbP8tekes6EkSbLsa28TV0JbmeNrrl0Ep/HgsJGX9BRYEbL+TYGQEskuZWg==","signatures":[{"sig":"MEQCIAqeSSTpYQq1uI5tB4XJRMCBMjG/MTBGbRBfrYhPkXW5AiBfKBMD96Y2l9rk0u8f+3Xj/iMMfid2nOKU+tuIMF7bsg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"4f69b69c08f916f62f04ef966c258ddbdf4cfb81","gitHead":"428d09d8a20ce3b8ebdb2fb736d7c1888f9c66e6","scripts":{"test":"npm run test:lint && npm run test:unit","test:lint":"eslint .","test:unit":"mocha"},"_npmUser":{"name":"lennym","email":"leonard.martin@gmail.com"},"deprecated":"DEPRECATED, hof-middleware-markdown is built into hof v19 <(^_^)> & should not be installed separately","repository":{"url":"git+https://github.com/UKHomeOfficeForms/hof-middleware-markdown.git","type":"git"},"_npmVersion":"4.1.2","description":"i18n-compatible markdown rendering for static content","directories":{},"_nodeVersion":"6.9.4","dependencies":{"lodash":"^4.17.4","markdown":"^0.5.0"},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","sinon":"^1.17.7","eslint":"^3.16.1","reqres":"^1.2.2","sinon-chai":"^2.8.0","eslint-config-homeoffice":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/hof-middleware-markdown-1.0.0.tgz_1488560330984_0.2716616808902472","host":"packages-12-west.internal.npmjs.com"}},"2.0.0":{"name":"hof-middleware-markdown","version":"2.0.0","author":{"name":"Leonard Martin","email":"hello@lennym.co.uk"},"license":"MIT","_id":"hof-middleware-markdown@2.0.0","maintainers":[{"name":"lennym","email":"leonard.martin@gmail.com"},{"name":"joefitter","email":"hello@joefitter.com"},{"name":"josephchapman","email":"info@josephchapman.com"},{"name":"easternbloc","email":"ben@marvell-consulting.com"}],"homepage":"https://github.com/UKHomeOfficeForms/hof-middleware-markdown#readme","bugs":{"url":"https://github.com/UKHomeOfficeForms/hof-middleware-markdown/issues"},"dist":{"shasum":"291f2523b50bf40113ae84aaa480634c314d4732","tarball":"https://registry.npmjs.org/hof-middleware-markdown/-/hof-middleware-markdown-2.0.0.tgz","integrity":"sha512-knnnyTrcqhahj+9pYjXG2x2y/ZODr/9V74l/PJvDfB3o3/4rCSVKORu79tfkjTydnFChDyiQmTGZ0z1SkSy5xg==","signatures":[{"sig":"MEYCIQCOMm1U5IRgj9403gFJObtFZUCewSOWzyQiIjwlxXGYEAIhAIva645yuAAqDWWG3RNlE12wbDHUyugf4O0WSganXbjh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"64d4fbef5f6f8278fb2110972bf7cf4ec20685fd","scripts":{"test":"npm run test:lint && npm run test:unit","test:lint":"eslint .","test:unit":"mocha"},"_npmUser":{"name":"josephchapman","email":"info@josephchapman.com"},"deprecated":"DEPRECATED, hof-middleware-markdown is built into hof v19 <(^_^)> & should not be installed separately","repository":{"url":"git+https://github.com/UKHomeOfficeForms/hof-middleware-markdown.git","type":"git"},"_npmVersion":"5.3.0","description":"i18n-compatible markdown rendering for static content","directories":{},"_nodeVersion":"6.10.0","dependencies":{"lodash":"^4.17.4","showdown":"^1.8.2"},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","sinon":"^1.17.7","eslint":"^3.16.1","reqres":"^1.2.2","sinon-chai":"^2.8.0","eslint-config-homeoffice":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/hof-middleware-markdown-2.0.0.tgz_1511448756697_0.11779134254902601","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-03-03T16:58:52.789Z","modified":"2026-09-21T15:12:50.952Z","1.0.0":"2017-03-03T16:58:52.789Z","2.0.0":"2017-11-23T14:52:37.830Z"},"bugs":{"url":"https://github.com/UKHomeOfficeForms/hof-middleware-markdown/issues"},"author":{"name":"Leonard Martin","email":"hello@lennym.co.uk"},"license":"MIT","homepage":"https://github.com/UKHomeOfficeForms/hof-middleware-markdown#readme","repository":{"url":"git+https://github.com/UKHomeOfficeForms/hof-middleware-markdown.git","type":"git"},"description":"i18n-compatible markdown rendering for static content","maintainers":[{"email":"aaron.russell@digital.homeoffice.gov.uk","name":"aaronrussellho"},{"email":"sas-hof-test@digital.homeoffice.gov.uk","name":"hof-bot-user"},{"email":"dk4g.blob@gmail.com","name":"dk4g"},{"email":"gregory.wolverson@digital.homeoffice.gov.uk","name":"greg_wolverson_ho"},{"email":"vinodha.samiyappan@digital.homeoffice.gov.uk","name":"vinodha.s"},{"email":"megan.john@digital.homeoffice.gov.uk","name":"meganjohn"},{"email":"nese.zorba@digital.homeoffice.gov.uk","name":"nzorba"},{"email":"rayhannur.rohman@digital.homeoffice.gov.uk","name":"rayhannurrohmanho"},{"email":"vivek.kumar1@digital.homeoffice.gov.uk","name":"vivekkumar-ho"},{"email":"leonard.martin@gmail.com","name":"lennym"}],"readme":"# hof-middleware-markdown\ni18n-compatible markdown rendering for static content into templates\n\n## Usage\n\nFirst, mount the middleware in your app.\n\n```js\nconst markdown = require('hof-middleware-markdown');\napp.use(markdown());\n```\n\nThen you can embed static markdown snippets in your templates as follows.\n\n```\n{{#markdown}}file-name{{//markdown}}\n```\n\nSnippets will be loaded from within `content` directories inside your express `views` directories. So if you have your express `views` set to `/path/to/my/views` then the markdown snippets will be looked for in `/path/to/my/views/content`.\n\n## i18n\n\nIf `req.lang` is set (and it will be in hof-bootstrap apps) then content will be loaded first in directories corresponding to the request langauge.\n\nSo if `req.lang` is set to `['en-US', 'en']` then the content will be loaded first from `/path/to/my/views/content/en-us` then `/path/to/my/views/content/en` and finally `/path/to/my/views/content`.\n\nNote: language codes are *always* lower case when mapped to directories.\n\n## Configuration\n\nThe markdown middleware can be configured by passing options at initialisation.\n\n```js\nconst markdown = require('hof-middleware-markdown');\napp.use(markdown(options));\n```\n\n### Options\n\n* `method` - Default: `markdown` - sets the name of the method exposed to templates.\n* `ext` - Default: `md` - sets the file extension of content files.\n* `dir` - Default: `content` - sets the subdirectory of `views` in which to find content snippets.\n* `fallbackLang` - Default: [''] - sets the directories in which to look for content if no matching language specific directory exists.\n","readmeFilename":"README.md"}