Older versions
Migration notes for NgDoc versions before 22.0. Apply them in order, one major version at a time: for example, update to 17 first, then to 18. For 22.0, see
Migrate to 18.0
NgDoc 18 has migrations that update your documentation. Run:
ng update @ng-doc/builder@18Then update the other @ng-doc/* packages to 18.0 as well.
The migration:
- moves
keywordfromng-doc.page.tsto the front matter of the page's Markdown file; - removes
# {{from Markdown files, because the page title is now shown by default.NgDocPage.title }}
Migrate to 17.0
NgDoc 17 moved to Angular 17 and dropped Webpack: it works only with the Vite and esbuild based builders. To migrate automatically, run:
ng update @ng-doc/builder@17Then update the other @ng-doc/* packages to 17.0 as well.
To migrate by hand, change the build configuration in angular.json:
- replace the
@ng-doc/builder:browserbuilder of thebuildtarget with@ng-doc/builder:application; - rename the
mainoption tobrowser; - turn the
polyfillsoption into an array; - remove the
buildOptimizerandvendorChunkoptions; - rename the
browserTargetoptions tobuildTarget.
Vite doesn't see changes in folders whose name starts with a dot, so rename the .ng-doc folder:
- in
angular.json, change the assets input.ng-doc/<project-name>/assetstong-doc/<project-name>/assets; - in
tsconfig.json, change the@ng-doc/generatedpath.ng-doc/<project-name>/index.tstong-doc/<project-name>/index.ts; - in
.gitignore, replace.ng-docwith/ng-doc.
Migrate to 16.13
NgDoc 16.13 removed all NgModules. The application uses only the components and providers that you provide, so you can replace or remove page parts such as breadcrumbs, page navigation and the table of contents.
NgDocSidebarModuleandNgDocNavbarModulewere removed. ImportandNgDocSidebarComponent instead.NgDocNavbarComponent NgDocModuleandNgDocUiKitRootModulewere removed. Configure the application with.provideNgDocApp NgDocGeneratedModulewas removed. Provide the generated context withprovideNgDocContext().andprovideMainPageProcessor were added. Use them to provide the default or your own page processors and page skeleton.providePageSkeleton
Migrate to 16.3
NgDoc 16.3 introduced standalone pages. Pages no longer need an ng-doc.dependencies.ts file or an NgModule: import dependencies directly in ng-doc.page.ts. To migrate, run:
ng g @ng-doc/builder:standalone-pages-migrationThe command removes the ng-doc.dependencies.ts files and moves their imports into the ng-doc.page.ts files.
Next: