{"id":19607867,"url":"https://github.com/mkdoc/mkpage","last_synced_at":"2025-04-27T20:32:28.522Z","repository":{"id":57298942,"uuid":"56307369","full_name":"mkdoc/mkpage","owner":"mkdoc","description":"Create an HTML page","archived":true,"fork":false,"pushed_at":"2016-05-19T03:24:32.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T13:44:05.469Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkdoc.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":"2016-04-15T09:15:06.000Z","updated_at":"2024-12-11T22:13:08.000Z","dependencies_parsed_at":"2022-08-26T18:12:38.428Z","dependency_job_id":null,"html_url":"https://github.com/mkdoc/mkpage","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkpage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkpage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkpage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkpage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkdoc","download_url":"https://codeload.github.com/mkdoc/mkpage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251204565,"owners_count":21552239,"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-11-11T10:12:44.293Z","updated_at":"2025-04-27T20:32:27.608Z","avatar_url":"https://github.com/mkdoc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Page\n\n[![Build Status](https://travis-ci.org/mkdoc/mkpage.svg?v=3)](https://travis-ci.org/mkdoc/mkpage)\n[![npm version](http://img.shields.io/npm/v/mkpage.svg?v=3)](https://npmjs.org/package/mkpage)\n[![Coverage Status](https://coveralls.io/repos/mkdoc/mkpage/badge.svg?branch=master\u0026service=github\u0026v=3)](https://coveralls.io/github/mkdoc/mkpage?branch=master)\n\n\u003e Create an HTML page\n\nConverts a markdown document stream to a full HTML page with html, head and body elements.\n\n## Install\n\n```\nnpm i mkpage --save\n```\n\nFor the command line interface install [mkdoc][] globally (`npm i -g mkdoc`).\n\n---\n\n- [Install](#install)\n- [Example](#example)\n- [Usage](#usage)\n- [Help](#help)\n- [API](#api)\n  - [page](#page)\n    - [Options](#options)\n  - [HtmlPage](#htmlpage)\n    - [Options](#options-1)\n- [License](#license)\n\n---\n\n## Example\n\nCreate an HTML page:\n\n```shell\nmkcat README.md | mkpage --title=README | mkhtml \u003e README.html\n```\n\nUse a stylesheet:\n\n```shell\nmkcat README.md | mkpage --title=README --style=style.css | mkhtml \u003e README.html\n```\n\n## Usage\n\nCreate the stream and write a [commonmark][] document:\n\n```javascript\nvar page = require('mkpage')\n  , ast = require('mkast');\nast.src('## Heading\\n\\nParagraph.')\n  .pipe(page())\n  .pipe(ast.stringify({indent: 2}))\n  .pipe(process.stdout);\n```\n\n## Help\n\n```\nUsage: mkpage [-h] [--async] [--help] [--version] [--doctype=\u003cval\u003e]\n              [--charset=\u003cval\u003e] [--lang=\u003cval\u003e] [--title=\u003cval\u003e]\n              [--style=\u003cpath...\u003e] [--script=\u003cpath...\u003e] [--css=\u003cfile\u003e]\n              [--javascript=\u003cfile\u003e] [--favicon=\u003cpath\u003e] [--media=\u003cval\u003e]\n              [--html-[ATTR]=\u003cval...\u003e] [--meta-[NAME]=\u003cdesc...\u003e]\n              [--equiv-[NAME]=\u003cdesc...\u003e] [--body-[ATTR]=\u003cval...\u003e]\n              [--element=\u003cname\u003e] [--attr-[NAME]=\u003cval...\u003e] [--app=\u003cpath...\u003e]\n              [--header=\u003cfile\u003e] [--footer=\u003cfile\u003e]\n\n  Convert a document to an HTML page.\n\nOptions\n  -d, --doctype=[VAL]     Doctype declaration (default: \u003c!doctype html\u003e)\n  -r, --charset=[VAL]     Document charset (default: utf-8)\n  -l, --lang=[VAL]        Language attribute (default: en-us)\n  -t, --title=[VAL]       Document title\n  -s, --style=[PATH...]   Paths for link elements\n  -S, --script=[PATH...]  Paths for script elements\n  -c, --css=[FILE]        Create style element from FILE\n  -j, --javascript=[FILE] Create script element from FILE\n  -f, --favicon=[PATH]    Path to use for a favicon\n  -m, --media=[VAL]       Set media attribute for stylesheets\n  --html-[ATTR]=[VAL...]  Set attributes on the html element\n  --meta-[NAME]=[DESC...] Set meta data in document head\n  --equiv-[NAME]=[DESC...] \n                          Set http-equiv meta data in document head\n  --body-[ATTR]=[VAL...]  Set attributes on the body element\n  --element=[NAME]        Container element for the input document\n  --attr-[NAME]=[VAL...]  Set attributes on container element\n  --app=[PATH...]         Script elements before the end of the body\n  --header=[FILE]         Include file at start of document body\n  --footer=[FILE]         Include file at end of document body\n  --async                 Add async attribute to script elements\n  -h, --help              Display help and exit\n  --version               Print the version and exit\n\nmkpage@1.0.5\n```\n\n## API\n\n### page\n\n```javascript\npage([opts][, cb])\n```\n\nCreate an HTML page.\n\nSee [HtmlPage](#htmlpage) for more options.\n\nReturns an output stream.\n\n* `opts` Object processing options.\n* `cb` Function callback function.\n\n#### Options\n\n* `input` Readable input stream.\n* `output` Writable output stream.\n\n### HtmlPage\n\n```javascript\nHtmlPage([opts])\n```\n\nWraps a document stream with HTML code blocks for the doctype, html, head\nand body elements.\n\nThis implementation wraps the entire output in a DOCUMENT node which is\nterminated with an EOF after all output has been sent.\n\nIf the `element` option is given the input markdown document is wrapped in\na container element using the tag name given with the `element` option. In\nthis case you can use the `attr` map to set attributes on the container\nelement.\n\nThe `meta` option allows setting `\u003cmeta name=\"\" content=\"\" /\u003e` elements in\nthe head of the document; for example keywords or author information.\n\nBoth the `header` and `footer` options are file paths; when specified the\nfiles are loaded and parsed as markdown.\n\nThe data from the header file is written after the body element but before\nany container element. The data for the footer file is written after any\ncontainer element and before the end of the body element.\n\nIf the `title` option is not given no title element is created.\n\nThe `style` and `script` options correspond to `link` and `script` elements\ncreated in the head of the document, each entry should be the URL to use\nfor the `href` or `src` attribute.\n\nWhen the `favicon` option is given it is a URL to an image to use as a\nshortcut icon, the path should have a `.png` or `.ico` extension so that\nthe MIME type may be determined.\n\nIf the `async` option is given all `script` elements are given the `async`\nattribute.\n\nThe `app` array lists URLs for script elements to create just before the\nbody element is closed; these script elements when given are guaranteed to\nbe the final elements before the body element is closed (after any footer\nor container element).\n\nYou can set attributes on the html and body elements using the `html` and\n`body` options.\n\n* `opts` Object stream options.\n\n#### Options\n\n* `doctype` String document type declaration.\n* `lang` String=en-us language attribute for the html element.\n* `charset` String=utf-8 document character set.\n* `title` String document title.\n* `style` Array paths for link elements.\n* `script` Array paths for script elements.\n* `css` String file path to inline css contents.\n* `javascript` String file path to inline javascript contents.\n* `favicon` String path to use for a favicon link element.\n* `media` String stylesheet media attribute.\n* `async` Boolean=false add async attribute to script elements.\n* `html` Object map of attributes for the html element.\n* `meta` Object map of name and descriptions for meta elements.\n* `equiv` Object map of name and content for meta http-equiv elements.\n* `body` Object map of attributes for the body element.\n* `element` String container element name.\n* `attr` Object map of attributes for the container element.\n* `app` Array paths for script elements before end of body.\n* `header` Array|String include files at start of body.\n* `footer` Array|String include files at end of body.\n\n## License\n\nMIT\n\n---\n\nCreated by [mkdoc](https://github.com/mkdoc/mkdoc) on May 19, 2016\n\n[mkdoc]: https://github.com/mkdoc/mkdoc\n[mkparse]: https://github.com/mkdoc/mkparse\n[commonmark]: http://commonmark.org\n[jshint]: http://jshint.com\n[jscs]: http://jscs.info\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdoc%2Fmkpage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkdoc%2Fmkpage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdoc%2Fmkpage/lists"}