MCPcopy Index your code
hub / github.com/docsifyjs/docsify / constructor

Method constructor

packages/docsify-server-renderer/index.js:61–79  ·  view source on GitHub ↗
({ template, config, cache })

Source from the content-addressed store, hash-verified

59
60export default class Renderer {
61 constructor({ template, config, cache }) {
62 this.html = template;
63 this.config = config = Object.assign({}, config, {
64 routerMode: 'history',
65 });
66 this.cache = cache;
67
68 this.router = new AbstractHistory(config);
69 this.compiler = new Compiler(config, this.router);
70
71 this.router.getCurrentPath = () => this.url;
72 this._renderHtml(
73 'inject-config',
74 `<script>window.$docsify = ${JSON.stringify(config)}</script>`
75 );
76 this._renderHtml('inject-app', mainTpl(config));
77
78 this.template = this.html;
79 }
80
81 _getPath(url) {
82 const file = this.router.getFile(url);

Callers

nothing calls this directly

Calls 2

_renderHtmlMethod · 0.95
mainTplFunction · 0.85

Tested by

no test coverage detected