Browse Source

ndoc => typedoc (draft)

pull/1197/head
Vitaly Puzrin 3 months ago
parent
commit
bb5ffbb09a
  1. 25
      .ndocrc
  2. 1056
      package-lock.json
  3. 5
      package.json
  4. 6
      src/index.ts
  5. 22
      support/build_doc.mjs
  6. 19
      typedoc.json

25
.ndocrc

@ -1,25 +0,0 @@
#
# Common nodeca config
################################################################################
--index "./README.md"
--package "./package.json"
--gh-ribbon "https://github.com/{package.repository}"
--output "apidoc"
--render "html"
--link-format "https://github.com/{package.repository}/blob/master/{file}#L{line}"
--broken-links "show"
#
# Paths with sources
################################################################################
lib
#
# Project specific configuration
################################################################################
--show-all

1056
package-lock.json

File diff suppressed because it is too large

5
package.json

@ -48,7 +48,7 @@
"pathological:track-ref": "node support/track-ref-pathological.mjs",
"pathological:update-hash": "node support/track-ref-pathological.mjs --update",
"coverage": "npm run build && c8 --include 'src/**' -r text -r html -r lcov node --test --test-reporter=dot",
"doc": "node support/build_doc.mjs",
"doc": "typedoc",
"gh-doc": "npm run doc && gh-pages -d apidoc -f",
"demo": "npm run lint && node support/build_demo.mjs",
"gh-demo": "npm run demo && gh-pages -d demo -f -b master -r git@github.com:markdown-it/markdown-it.github.io.git",
@ -86,9 +86,10 @@
"markdown-it-mark": "^4.0.0",
"markdown-it-sub": "^2.0.0",
"markdown-it-sup": "^2.0.0",
"ndoc": "^6.0.1",
"neostandard": "^0.13.0",
"tinybench": "^6.0.2",
"typedoc": "^0.28.19",
"typedoc-plugin-missing-exports": "^4.1.4",
"typescript": "^6.0.3",
"vite": "^8.1.5",
"vite-plugin-singlefile": "^2.3.3"

6
src/index.ts

@ -1,4 +1,6 @@
import { callable } from './common/utils.ts'
import MarkdownIt from './markdownit.ts'
import MarkdownItClass from './markdownit.ts'
export default callable(MarkdownIt)
const MarkdownIt = callable(MarkdownItClass)
export default MarkdownIt

22
support/build_doc.mjs

@ -1,22 +0,0 @@
#!/usr/bin/env node
import { rmSync } from 'node:fs'
import { execFileSync, spawnSync } from 'node:child_process'
rmSync('apidoc', { recursive: true, force: true })
const head = execFileSync('git', ['show-ref', '--hash', 'HEAD'], { encoding: 'utf8' }).slice(0, 6)
const link_format = `https://github.com/{package.repository}/blob/${head}/{file}#L{line}`
const result = spawnSync(process.execPath, [
'node_modules/.bin/ndoc',
'--alias',
'mjs:js',
'--link-format',
link_format
], { stdio: 'inherit' })
if (result.error) throw result.error
process.exitCode = result.status

19
typedoc.json

@ -0,0 +1,19 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["src/index.ts"],
"plugin": ["typedoc-plugin-missing-exports"],
"out": "apidoc",
"includeVersion": true,
"markdownLinkExternal": true,
"sourceLinkExternal": true,
"sourceLinkTemplate": "https://github.com/markdown-it/markdown-it/blob/{gitRevision:short}/{path}#L{line}",
"navigationLinks": {
"GitHub": "https://github.com/markdown-it/markdown-it"
},
"defaultCategory": "markdown-it",
"categoryOrder": ["markdown-it", "*"],
"sort": ["source-order"],
"navigation": {
"includeCategories": true
}
}
Loading…
Cancel
Save