Add ability to nest doc ref markdown under specific versions

This commit is contained in:
Fabio Berger
2018-07-09 19:05:38 +02:00
parent a9b320e636
commit 324b1079e7
31 changed files with 111 additions and 68 deletions

View File

@@ -9,10 +9,10 @@ import { DocPackages } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
const IntroMarkdown = require('md/docs/json_schemas/introduction');
const InstallationMarkdown = require('md/docs/json_schemas/installation');
const UsageMarkdown = require('md/docs/json_schemas/usage');
const SchemasMarkdown = require('md/docs/json_schemas/schemas');
const IntroMarkdownV1 = require('md/docs/json_schemas/1.0.0/introduction');
const InstallationMarkdownV1 = require('md/docs/json_schemas/1.0.0/installation');
const UsageMarkdownV1 = require('md/docs/json_schemas/1.0.0/usage');
const SchemasMarkdownV1 = require('md/docs/json_schemas/1.0.0/schemas');
/* tslint:enable:no-var-requires */
const docSections = {
@@ -35,11 +35,13 @@ const docsInfoConfig: DocsInfoConfig = {
schemaValidator: [docSections.schemaValidator],
schemas: [docSections.schemas],
},
sectionNameToMarkdown: {
[docSections.introduction]: IntroMarkdown,
[docSections.installation]: InstallationMarkdown,
[docSections.schemas]: SchemasMarkdown,
[docSections.usage]: UsageMarkdown,
sectionNameToMarkdownByVersion: {
'0.0.1': {
[docSections.introduction]: IntroMarkdownV1,
[docSections.installation]: InstallationMarkdownV1,
[docSections.schemas]: SchemasMarkdownV1,
[docSections.usage]: UsageMarkdownV1,
},
},
sectionNameToModulePath: {
[docSections.schemaValidator]: ['"json-schemas/src/schema_validator"'],