readme.com
v0.0.12
Published
Minimal website generator
Downloads
59
Readme
Readme.com
From README.md
to index.html in one touch
Usage
Inside a folder with a README.md file:
npx readme.comYou'll get:
dist
index.html
styles.cssLocal development
You can add the following scripts to your package.json in order to test the output locally and eventually building it:
{
"scripts": {
"dev:site": "npx concurrently 'npx serve site' 'npx nodemon --watch readme.md --exec npm run build:site'",
"build:site": "rm -rf site && npx readme.com"
}
}- run
npm run dev:siteto see a preview at http://localhost:3000; - run
npm run dev:buildto generate the website inside thedistPathfolder (defaults to'./dist).
If you want to deploy your website to Github Pages, configure your repo accordingly and set up an action like the one used by this library.
Include assets
Any files contained in the assets folder will be copied over to the dist folder and then available at the same level of the index.html file, i.e.:
assets
robots.txt
image.jpg
README.mdYields:
dist
index.html
styles.css
robots.txt
image.jpgThe assets folder is configurable via the assetsPath option:
npx readme.com --assetsPath ./my-assets-pathTemplate override
The library uses the following templates:
meta.ejs
navbar.ejs
section.ejs
footer.ejs
scripts.ejs
styles.ejsYou can override any of them by providing a same named file in a folder called templates:
templates
footer.ejs
README.mdAnd your custom footer will be used instead of the existing one.
The custom templates folder is configurable via the templatePath option:
npx readme.com --templatePath ./my-templates-pathDocumentation
Command Line
npx readme.com
Generates an HTML document from a README.md file
Options:
--help Show help [boolean]
--version Show version number [boolean]
--readmePath README path [default: "{process.cwd}/README.md"]
--distPath dist path [default: "{process.cwd}"]
--templatePath custom templates path [default: "{process.cwd}/templates"]
--assetsPath assets pathExamples
- this page!
- homepage example
