Migrations
This page contains information about migrating from previous versions of NgDoc to the current version.
Migration to >= v18.0
NgDoc 18 contains several migrations that can help migrate your documentation to the new version. To perform the migration, execute the following command:
After migration you also need to update other
@ng-doc/*packages to v17.0.0
ng update @ng-doc/builderThe migration should:
- move
keywordfromng-doc.page.tsto your page's markdown file - remove
# {{from the markdown file since the title is now displayed by default.NgDocPage.title }}
Migration to >= v17.0
In v17.0.0, project was migrated to Angular v17, support of Webpack was removed, now it works only with Vite + Esbuild. To migrate automatically, you can run the following command:
After migration you also need to update other
@ng-doc/*packages to v17.0.0
ng update @ng-doc/builderManual migration steps:
- replace
@ng-doc/builder:browserbuilder for the build target with@ng-doc/builder:applicationbuilder - rename
mainproperty inangular.jsontobrowser - covert
polyfillsproperty inangular.jsontopolyfillsarray - remove
buildOptimizerandvendorChunkproperties fromangular.json - rename
buildTargetproperties inangular.jsontobuildTarget
Vite doesn't see changes in folders that start with a dot, so you need to rename .ng-doc folder:
- rename assets
.ng-doc/ng-doc/assetsfolder tong-doc/ng-doc/assetsinangular.json - change
@ng-doc/generatedpath.ng-doc/ng-doc/index.tsintsconfig.jsontong-doc/ng-doc/index.ts - replace
.ng-docfolder name in.gitignorefile with/ng-doc
Migration to >= v16.13
In v16.13.0 all NgModules were removed. Application configuration was changed. This was done to simplify API and add more flexibility to the application, now Application will use only components that YOU provided and nothing else which will reduce the size of the final bundle for applications that don't use all features of NgDoc or want to customize it.
Now you can replace page components such as breadcrumbs, page navigation at the bottom of the page, or table of contents with your own components, or even remove them completely.
NgDoc's schematics now also support standalone applications.
NgDocSidebarModule,NgDocNavbarModulewere removed, now you need to import,NgDocSidebarComponent .NgDocNavbarComponent NgDocModule,NgDocUiKitRootModulewere removed, all configurations can be provided by usingfunction.provideNgDocApp NgDocGeneratedModulewas removed, now you need to useprovideNgDocContextfunction to provide context of the generated documentation.andprovideMainPageProcessor functions were added, now you must use them to provide default or your own page processors and page skeleton components.providePageSkeleton
Please see updated
Migrating to >= v16.3
In v16.3.0, new standalone pages were introduced. Now you don't need ng-doc.dependencies.ts file or anymore, all dependencies can be imported directly in the ng-doc.page.ts file.
To migrate from previous versions, you need to run the following command:
ng g @ng-doc/builder:standalone-pages-migrationThis command will remove ng-doc.dependencies.ts file and update all ng-doc.page.ts files by importing all dependencies directly.