MCPcopy
hub / github.com/docsifyjs/docsify / getFile

Method getFile

src/core/router/history/base.js:41–56  ·  view source on GitHub ↗
(path = this.getCurrentPath(), isRelative)

Source from the content-addressed store, hash-verified

39 }
40
41 getFile(path = this.getCurrentPath(), isRelative) {
42 const { config } = this;
43 const base = this.getBasePath();
44 const ext = typeof config.ext === 'string' ? config.ext : '.md';
45
46 path = config.alias ? getAlias(path, config.alias) : path;
47 path = getFileName(path, ext);
48 path = path === `/README${ext}` ? config.homepage || path : path;
49 path = isAbsolutePath(path) ? path : getPath(base, path);
50
51 if (isRelative) {
52 path = path.replace(new RegExp(`^${base}`), '');
53 }
54
55 return path;
56 }
57
58 onchange(cb = noop) {
59 cb();

Callers 10

_getPathMethod · 0.80
loadNestedFunction · 0.80
_fetchMethod · 0.80
_fetchCoverMethod · 0.80
_fetchFallbackPageMethod · 0.80
_fetch404Method · 0.80
parseMethod · 0.80
parseMethod · 0.80
parseMethod · 0.80
initFunction · 0.80

Calls 5

getCurrentPathMethod · 0.95
getBasePathMethod · 0.95
getPathFunction · 0.90
getAliasFunction · 0.85
getFileNameFunction · 0.85

Tested by

no test coverage detected