adapt-authoring-docs 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/docserve.js CHANGED
@@ -17,7 +17,7 @@ async function getOutputDir () {
17
17
  const { loadDependencies, loadConfigDefaults } = await import('../lib/docsData.js')
18
18
  const rootDir = path.resolve(getArg('--rootDir') || process.cwd())
19
19
  const dependencies = await loadDependencies(rootDir)
20
- const config = await loadConfigDefaults(dependencies)
20
+ const config = await loadConfigDefaults(rootDir, dependencies)
21
21
  return path.resolve(config.get('adapt-authoring-docs.outputDir'))
22
22
  }
23
23
 
@@ -56,8 +56,9 @@ export default async function docsify (appData, configs, outputdir, defaultPages
56
56
  if (!sectionsConf[key]) sectionsConf[key] = data
57
57
  })
58
58
  }
59
- [...customFiles, ...globSync('docs/*.md', { cwd: c.rootDir, absolute: true })].forEach(f => {
60
- if (f === defaultPages.sourceIndex) {
59
+ const excludedFiles = ['README.md', ...Object.values(defaultPages).filter(Boolean).map(f => path.basename(f))]
60
+ ;[...customFiles, ...globSync('docs/*.md', { cwd: c.rootDir, absolute: true })].forEach(f => {
61
+ if (excludedFiles.includes(path.basename(f))) {
61
62
  return
62
63
  }
63
64
  const title = path.basename(f)
@@ -97,7 +98,10 @@ export default async function docsify (appData, configs, outputdir, defaultPages
97
98
  homepage: defaultPages.manualIndex ? path.basename(defaultPages.manualIndex) : false
98
99
  })))
99
100
 
100
- await Promise.allSettled(Object.entries(titleMap).map(([filename, v]) => fs.copy(v.path, `${dir}/${filename}`)))
101
+ await Promise.allSettled([
102
+ ...Object.entries(titleMap).map(([filename, v]) => fs.copy(v.path, `${dir}/${filename}`)),
103
+ ...Object.values(defaultPages).filter(Boolean).map(f => fs.copy(f, `${dir}/${path.basename(f)}`))
104
+ ])
101
105
  /**
102
106
  * Generate custom sidebar
103
107
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-docs",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Tools for auto-generating documentation for the Adapt authoring tool",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-docs",
6
6
  "license": "GPL-3.0",