mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-02 20:20:30 +08:00
60b7f89b37
Snyk has created this PR to upgrade docsify from 4.10.2 to 4.11.2. See this package in NPM: https://www.npmjs.com/package/docsify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=upgrade-pr |
||
---|---|---|
.. | ||
.gitignore | ||
index.js | ||
package-lock.json | ||
package.json | ||
README.md |
docsify-server-renderer
Install
yarn add docsify-server-renderer
Usage
var Renderer = require('docsify-server-renderer')
var readFileSync = require('fs').readFileSync
// init
var renderer = new Renderer({
template: readFileSync('./docs/index.template.html', 'utf-8').,
config: {
name: 'docsify',
repo: 'docsifyjs/docsify'
}
})
renderer.renderToString(url)
.then(html => {})
.catch(err => {})
index.template.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>docsify</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//unpkg.com/docsify/themes/buble.css" title="buble" disabled>
</head>
<body>
<!--inject-app-->
<!--inject-config-->
<script src="//unpkg.com/docsify/lib/docsify.js"></script>
</body>
</html>