diff --git a/apps/daffio/src/app/docs/docs-routing.module.ts b/apps/daffio/src/app/docs/docs-routing.module.ts index d9441b30fb..5928682ffc 100644 --- a/apps/daffio/src/app/docs/docs-routing.module.ts +++ b/apps/daffio/src/app/docs/docs-routing.module.ts @@ -6,6 +6,7 @@ import { import { DaffRouteWithNamedViews } from '@daffodil/router'; +import { DAFFIO_DOCS_GUIDE_DEFAULT } from './guides/guides-routing.module'; import { DaffioDocsHeaderContainer } from '../core/header/containers/docs-header/docs-header.component'; import { DaffioDocsSidebarContainer } from '../core/sidebar/containers/docs-sidebar/docs-sidebar.component'; import { DaffioRouterNamedViewsEnum } from '../named-views/models/named-views.enum'; @@ -35,7 +36,7 @@ export const docsRoutes: Routes = [ { path: '', pathMatch: 'full', - redirectTo: 'guides/getting-started/introduction', + redirectTo: `guides/${DAFFIO_DOCS_GUIDE_DEFAULT}`, }, ], }, diff --git a/apps/daffio/src/app/docs/guides/guides-routing.module.ts b/apps/daffio/src/app/docs/guides/guides-routing.module.ts index 84b8eae67c..7f3dec1f43 100644 --- a/apps/daffio/src/app/docs/guides/guides-routing.module.ts +++ b/apps/daffio/src/app/docs/guides/guides-routing.module.ts @@ -11,6 +11,8 @@ import { DaffioRouterNamedViewsEnum } from '../../named-views/models/named-views import { DaffioDocsPageComponent } from '../pages/docs-page/docs-page.component'; import { DocsResolver } from '../resolvers/docs-resolver.service'; +export const DAFFIO_DOCS_GUIDE_DEFAULT = 'introduction/about'; + export const docsRoutes: Routes = [ { path: '', @@ -23,7 +25,7 @@ export const docsRoutes: Routes = [ { path: '', pathMatch: 'full', - redirectTo: 'getting-started/introduction', + redirectTo: DAFFIO_DOCS_GUIDE_DEFAULT, }, { path: '**', diff --git a/docs/architecture/search.md b/docs/explanations/architecture/search.md similarity index 100% rename from docs/architecture/search.md rename to docs/explanations/architecture/search.md diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md deleted file mode 100644 index f6ecaa676c..0000000000 --- a/docs/getting-started/introduction.md +++ /dev/null @@ -1 +0,0 @@ -# Introduction \ No newline at end of file diff --git a/docs/guides/introduction/about.md b/docs/guides/introduction/about.md new file mode 100644 index 0000000000..fbd131c5a1 --- /dev/null +++ b/docs/guides/introduction/about.md @@ -0,0 +1 @@ +# About Daffodil diff --git a/docs/guides/introduction/getting-started.md b/docs/guides/introduction/getting-started.md new file mode 100644 index 0000000000..31dd91e805 --- /dev/null +++ b/docs/guides/introduction/getting-started.md @@ -0,0 +1,2 @@ +# Getting Started + diff --git a/docs/state/action-naming-conventions.md b/docs/internal/state/action-naming-conventions.md similarity index 100% rename from docs/state/action-naming-conventions.md rename to docs/internal/state/action-naming-conventions.md diff --git a/tools/dgeni/build.ts b/tools/dgeni/build.ts index 8d7c23903a..0c5db823cb 100644 --- a/tools/dgeni/build.ts +++ b/tools/dgeni/build.ts @@ -6,12 +6,13 @@ import { designExamplePackage } from './src/transforms/daffodil-design-examples- import { packageDocsPackage, guideDocsPackage, + explanationDocsPackage, } from './src/transforms/daffodil-guides-package'; - rimraf('../../dist/docs/*', { glob: true }).then(() => { new Dgeni([packageDocsPackage]).generate().catch(() => process.exit(1)); new Dgeni([guideDocsPackage]).generate().catch(() => process.exit(1)); + new Dgeni([explanationDocsPackage]).generate().catch(() => process.exit(1)); new Dgeni([apiDocs]).generate().catch(() => process.exit(1)); new Dgeni([designExamplePackage]).generate().catch(() => process.exit(1)); }); diff --git a/tools/dgeni/src/transforms/daffodil-guides-package/index.ts b/tools/dgeni/src/transforms/daffodil-guides-package/index.ts index 8b3035da23..f2ba6a9b68 100644 --- a/tools/dgeni/src/transforms/daffodil-guides-package/index.ts +++ b/tools/dgeni/src/transforms/daffodil-guides-package/index.ts @@ -69,11 +69,10 @@ export const packageDocsPackage = new Package('daffodil-package-docs', [base]) export const guideDocsPackage = new Package('daffodil-guide-docs', [base]) .processor(new GenerateGuideListProcessor({ outputFolder: 'guides' })) .config((readFilesProcessor) => { - readFilesProcessor.basePath = DOCS_SOURCE_PATH; + readFilesProcessor.basePath = `${DOCS_SOURCE_PATH}/guides`; readFilesProcessor.sourceFiles = [ { include: [ - // `${excludedDocsRegex}/**/*.md`, - `${excludedDocsRegex}/*.md`, + '**/*.md', ]}, ]; }) @@ -88,3 +87,25 @@ export const guideDocsPackage = new Package('daffodil-guide-docs', [base]) outputPathTemplate: '${moduleFolder}.json', }); }); + +export const explanationDocsPackage = new Package('daffodil-explanation-docs', [base]) + .processor(new GenerateGuideListProcessor({ outputFolder: 'explanations' })) + .config((readFilesProcessor) => { + readFilesProcessor.basePath = `${DOCS_SOURCE_PATH}/explanations`; + readFilesProcessor.sourceFiles = [ + { include: [ + '**/*.md', + ]}, + ]; + }) + .config((computePathsProcessor) => { + const DOCS_SEGMENT = 'explanations'; + computePathsProcessor.pathTemplates.push({ + docTypes: ['guide'], + getPath: (doc) =>{ + doc.moduleFolder = `${DOCS_SEGMENT}/${doc.id.replace(/\/docs/, '')}`; + return doc.moduleFolder; + }, + outputPathTemplate: '${moduleFolder}.json', + }); + });