aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-20 00:14:58 +0800
committerGitHub <noreply@github.com>2018-07-20 00:14:58 +0800
commit9b6476a6b7db8db7b0fc6bbf9306c01566fb47a9 (patch)
treef96d1aa76c7e5aa9e3311d5cdbd0d31c8ec8d7fb
parent3de88d5345c7a4549bc69e2ca28f0601f5d42189 (diff)
parentd8898cf9a30cc349868afcf2b78e6369e57aa726 (diff)
downloaddexon-0x-contracts-9b6476a6b7db8db7b0fc6bbf9306c01566fb47a9.tar.gz
dexon-0x-contracts-9b6476a6b7db8db7b0fc6bbf9306c01566fb47a9.tar.zst
dexon-0x-contracts-9b6476a6b7db8db7b0fc6bbf9306c01566fb47a9.zip
Merge pull request #844 from 0xProject/support-multiple-doc-md
Support version-specific doc ref markdown sections
-rw-r--r--packages/react-docs-example/ts/docs.tsx8
-rw-r--r--packages/react-docs/CHANGELOG.json9
-rw-r--r--packages/react-docs/package.json3
-rw-r--r--packages/react-docs/src/components/documentation.tsx16
-rw-r--r--packages/react-docs/src/docs_info.ts5
-rw-r--r--packages/react-docs/src/types.ts6
-rw-r--r--packages/sol-compiler/package.json2
-rw-r--r--packages/website/md/docs/0xjs/1.0.0/async.md (renamed from packages/website/md/docs/0xjs/async.md)0
-rw-r--r--packages/website/md/docs/0xjs/1.0.0/errors.md (renamed from packages/website/md/docs/0xjs/errors.md)0
-rw-r--r--packages/website/md/docs/0xjs/1.0.0/installation.md (renamed from packages/website/md/docs/0xjs/installation.md)0
-rw-r--r--packages/website/md/docs/0xjs/1.0.0/introduction.md (renamed from packages/website/md/docs/0xjs/introduction.md)0
-rw-r--r--packages/website/md/docs/0xjs/1.0.0/versioning.md (renamed from packages/website/md/docs/0xjs/versioning.md)0
-rw-r--r--packages/website/md/docs/connect/1.0.0/installation.md (renamed from packages/website/md/docs/connect/installation.md)0
-rw-r--r--packages/website/md/docs/connect/1.0.0/introduction.md (renamed from packages/website/md/docs/connect/introduction.md)0
-rw-r--r--packages/website/md/docs/json_schemas/1.0.0/installation.md (renamed from packages/website/md/docs/json_schemas/installation.md)0
-rw-r--r--packages/website/md/docs/json_schemas/1.0.0/introduction.md (renamed from packages/website/md/docs/json_schemas/introduction.md)0
-rw-r--r--packages/website/md/docs/json_schemas/1.0.0/schemas.md (renamed from packages/website/md/docs/json_schemas/schemas.md)0
-rw-r--r--packages/website/md/docs/json_schemas/1.0.0/usage.md (renamed from packages/website/md/docs/json_schemas/usage.md)0
-rw-r--r--packages/website/md/docs/order_utils/1.0.0/installation.md (renamed from packages/website/md/docs/order_utils/installation.md)0
-rw-r--r--packages/website/md/docs/order_utils/1.0.0/introduction.md (renamed from packages/website/md/docs/order_utils/introduction.md)0
-rw-r--r--packages/website/md/docs/smart_contracts/1.0.0/introduction.md (renamed from packages/website/md/docs/smart_contracts/introduction.md)0
-rw-r--r--packages/website/ts/containers/connect_documentation.ts12
-rw-r--r--packages/website/ts/containers/ethereum_types_documentation.ts8
-rw-r--r--packages/website/ts/containers/json_schemas_documentation.ts20
-rw-r--r--packages/website/ts/containers/order_utils_documentation.ts12
-rw-r--r--packages/website/ts/containers/smart_contracts_documentation.ts8
-rw-r--r--packages/website/ts/containers/sol_compiler_documentation.ts14
-rw-r--r--packages/website/ts/containers/sol_cov_documentation.ts14
-rw-r--r--packages/website/ts/containers/subproviders_documentation.ts14
-rw-r--r--packages/website/ts/containers/web3_wrapper_documentation.ts12
-rw-r--r--packages/website/ts/containers/zero_ex_js_documentation.ts24
31 files changed, 119 insertions, 68 deletions
diff --git a/packages/react-docs-example/ts/docs.tsx b/packages/react-docs-example/ts/docs.tsx
index b70de1257..bb605806f 100644
--- a/packages/react-docs-example/ts/docs.tsx
+++ b/packages/react-docs-example/ts/docs.tsx
@@ -14,7 +14,7 @@ import * as v0TypeDocJson from './json/0.1.12.json';
import * as v2TypeDocJson from './json/0.2.0.json';
// tslint:disable-next-line:no-implicit-dependencies no-var-requires
-const IntroMarkdown = require('md/introduction');
+const IntroMarkdownV1 = require('md/introduction');
const docSections = {
introduction: 'introduction',
@@ -32,8 +32,10 @@ const docsInfoConfig: DocsInfoConfig = {
web3Wrapper: [docSections.web3Wrapper],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdownV1,
+ },
},
sectionNameToModulePath: {
[docSections.web3Wrapper]: ['"web3-wrapper/src/index"'],
diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json
index d794e159b..f4af828d7 100644
--- a/packages/react-docs/CHANGELOG.json
+++ b/packages/react-docs/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "0.0.17",
+ "changes": [
+ {
+ "note": "Nest MD files under versions so that you can update them for future versions",
+ "pr": 844
+ }
+ ]
+ },
+ {
"timestamp": 1531919263,
"version": "0.0.16",
"changes": [
diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json
index 023c63db2..1ca0e0157 100644
--- a/packages/react-docs/package.json
+++ b/packages/react-docs/package.json
@@ -52,7 +52,8 @@
"react-dom": "15.6.1",
"react-markdown": "^3.2.2",
"react-scroll": "^1.5.2",
- "react-tooltip": "^3.2.7"
+ "react-tooltip": "^3.2.7",
+ "semver": "5.5.0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx
index a4e6f4f6e..ff33220d2 100644
--- a/packages/react-docs/src/components/documentation.tsx
+++ b/packages/react-docs/src/components/documentation.tsx
@@ -12,6 +12,7 @@ import {
import * as _ from 'lodash';
import CircularProgress from 'material-ui/CircularProgress';
import * as React from 'react';
+import * as semver from 'semver';
import { DocsInfo } from '../docs_info';
import {
@@ -180,7 +181,20 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
return renderedSections;
}
private _renderSection(typeDefinitionByName: TypeDefinitionByName, sectionName: string): React.ReactNode {
- const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdown[sectionName];
+ const markdownVersions = _.keys(this.props.docsInfo.sectionNameToMarkdownByVersion);
+ const eligibleVersions = _.filter(markdownVersions, mdVersion => {
+ return semver.lte(mdVersion, this.props.selectedVersion);
+ });
+ if (_.isEmpty(eligibleVersions)) {
+ throw new Error(
+ `No eligible markdown sections found for ${this.props.docsInfo.displayName} version ${
+ this.props.selectedVersion
+ }.`,
+ );
+ }
+ const sortedEligibleVersions = eligibleVersions.sort(semver.rcompare.bind(semver));
+ const closestVersion = sortedEligibleVersions[0];
+ const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdownByVersion[closestVersion][sectionName];
if (!_.isUndefined(markdownFileIfExists)) {
return (
<MarkdownSection
diff --git a/packages/react-docs/src/docs_info.ts b/packages/react-docs/src/docs_info.ts
index 5d46dbda6..b37942da6 100644
--- a/packages/react-docs/src/docs_info.ts
+++ b/packages/react-docs/src/docs_info.ts
@@ -9,6 +9,7 @@ import {
DocsInfoTypeConfigs,
DocsMenu,
DoxityDocObj,
+ SectionNameToMarkdownByVersion,
SectionsMap,
SupportedDocJson,
TypeDefinitionByName,
@@ -24,7 +25,7 @@ export class DocsInfo {
public packageUrl: string;
public menu: DocsMenu;
public sections: SectionsMap;
- public sectionNameToMarkdown: { [sectionName: string]: string };
+ public sectionNameToMarkdownByVersion: SectionNameToMarkdownByVersion;
public contractsByVersionByNetworkId?: ContractsByVersionByNetworkId;
public typeConfigs: DocsInfoTypeConfigs;
private readonly _docsInfo: DocsInfoConfig;
@@ -34,7 +35,7 @@ export class DocsInfo {
this.displayName = config.displayName;
this.packageUrl = config.packageUrl;
this.sections = config.sections;
- this.sectionNameToMarkdown = config.sectionNameToMarkdown;
+ this.sectionNameToMarkdownByVersion = config.sectionNameToMarkdownByVersion;
this.contractsByVersionByNetworkId = config.contractsByVersionByNetworkId;
this.typeConfigs = config.typeConfigs;
this._docsInfo = config;
diff --git a/packages/react-docs/src/types.ts b/packages/react-docs/src/types.ts
index f4e61edc9..cbc774c2e 100644
--- a/packages/react-docs/src/types.ts
+++ b/packages/react-docs/src/types.ts
@@ -1,3 +1,7 @@
+export interface SectionNameToMarkdownByVersion {
+ [version: string]: { [sectionName: string]: string };
+}
+
export interface DocsInfoConfig {
id: string;
type: SupportedDocJson;
@@ -5,7 +9,7 @@ export interface DocsInfoConfig {
packageUrl: string;
menu: DocsMenu;
sections: SectionsMap;
- sectionNameToMarkdown: { [sectionName: string]: string };
+ sectionNameToMarkdownByVersion: SectionNameToMarkdownByVersion;
visibleConstructors: string[];
sectionNameToModulePath?: { [sectionName: string]: string[] };
menuSubsectionToVersionWhenIntroduced?: { [sectionName: string]: string };
diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json
index 670dfad2e..534205b47 100644
--- a/packages/sol-compiler/package.json
+++ b/packages/sol-compiler/package.json
@@ -90,7 +90,7 @@
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"require-from-string": "^2.0.1",
- "semver": "^5.5.0",
+ "semver": "5.5.0",
"solc": "^0.4.23",
"web3-eth-abi": "^1.0.0-beta.24",
"yargs": "^10.0.3"
diff --git a/packages/website/md/docs/0xjs/async.md b/packages/website/md/docs/0xjs/1.0.0/async.md
index 8abaef331..8abaef331 100644
--- a/packages/website/md/docs/0xjs/async.md
+++ b/packages/website/md/docs/0xjs/1.0.0/async.md
diff --git a/packages/website/md/docs/0xjs/errors.md b/packages/website/md/docs/0xjs/1.0.0/errors.md
index e97973ccf..e97973ccf 100644
--- a/packages/website/md/docs/0xjs/errors.md
+++ b/packages/website/md/docs/0xjs/1.0.0/errors.md
diff --git a/packages/website/md/docs/0xjs/installation.md b/packages/website/md/docs/0xjs/1.0.0/installation.md
index ac0a47699..ac0a47699 100644
--- a/packages/website/md/docs/0xjs/installation.md
+++ b/packages/website/md/docs/0xjs/1.0.0/installation.md
diff --git a/packages/website/md/docs/0xjs/introduction.md b/packages/website/md/docs/0xjs/1.0.0/introduction.md
index 008376d33..008376d33 100644
--- a/packages/website/md/docs/0xjs/introduction.md
+++ b/packages/website/md/docs/0xjs/1.0.0/introduction.md
diff --git a/packages/website/md/docs/0xjs/versioning.md b/packages/website/md/docs/0xjs/1.0.0/versioning.md
index 6bcaa5b4d..6bcaa5b4d 100644
--- a/packages/website/md/docs/0xjs/versioning.md
+++ b/packages/website/md/docs/0xjs/1.0.0/versioning.md
diff --git a/packages/website/md/docs/connect/installation.md b/packages/website/md/docs/connect/1.0.0/installation.md
index 950bf92ca..950bf92ca 100644
--- a/packages/website/md/docs/connect/installation.md
+++ b/packages/website/md/docs/connect/1.0.0/installation.md
diff --git a/packages/website/md/docs/connect/introduction.md b/packages/website/md/docs/connect/1.0.0/introduction.md
index 4e3039442..4e3039442 100644
--- a/packages/website/md/docs/connect/introduction.md
+++ b/packages/website/md/docs/connect/1.0.0/introduction.md
diff --git a/packages/website/md/docs/json_schemas/installation.md b/packages/website/md/docs/json_schemas/1.0.0/installation.md
index 50a37bae1..50a37bae1 100644
--- a/packages/website/md/docs/json_schemas/installation.md
+++ b/packages/website/md/docs/json_schemas/1.0.0/installation.md
diff --git a/packages/website/md/docs/json_schemas/introduction.md b/packages/website/md/docs/json_schemas/1.0.0/introduction.md
index a27f4b521..a27f4b521 100644
--- a/packages/website/md/docs/json_schemas/introduction.md
+++ b/packages/website/md/docs/json_schemas/1.0.0/introduction.md
diff --git a/packages/website/md/docs/json_schemas/schemas.md b/packages/website/md/docs/json_schemas/1.0.0/schemas.md
index fcf5d8df6..fcf5d8df6 100644
--- a/packages/website/md/docs/json_schemas/schemas.md
+++ b/packages/website/md/docs/json_schemas/1.0.0/schemas.md
diff --git a/packages/website/md/docs/json_schemas/usage.md b/packages/website/md/docs/json_schemas/1.0.0/usage.md
index 68b801153..68b801153 100644
--- a/packages/website/md/docs/json_schemas/usage.md
+++ b/packages/website/md/docs/json_schemas/1.0.0/usage.md
diff --git a/packages/website/md/docs/order_utils/installation.md b/packages/website/md/docs/order_utils/1.0.0/installation.md
index 68a7cf960..68a7cf960 100644
--- a/packages/website/md/docs/order_utils/installation.md
+++ b/packages/website/md/docs/order_utils/1.0.0/installation.md
diff --git a/packages/website/md/docs/order_utils/introduction.md b/packages/website/md/docs/order_utils/1.0.0/introduction.md
index d5f3f2925..d5f3f2925 100644
--- a/packages/website/md/docs/order_utils/introduction.md
+++ b/packages/website/md/docs/order_utils/1.0.0/introduction.md
diff --git a/packages/website/md/docs/smart_contracts/introduction.md b/packages/website/md/docs/smart_contracts/1.0.0/introduction.md
index 566a573b6..566a573b6 100644
--- a/packages/website/md/docs/smart_contracts/introduction.md
+++ b/packages/website/md/docs/smart_contracts/1.0.0/introduction.md
diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts
index f939ef0df..abf419347 100644
--- a/packages/website/ts/containers/connect_documentation.ts
+++ b/packages/website/ts/containers/connect_documentation.ts
@@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/connect/introduction');
-const InstallationMarkdown = require('md/docs/connect/installation');
+const IntroMarkdownV1 = require('md/docs/connect/1.0.0/introduction');
+const InstallationMarkdownV1 = require('md/docs/connect/1.0.0/installation');
/* tslint:enable:no-var-requires */
const connectDocSections = {
@@ -34,9 +34,11 @@ const docsInfoConfig: DocsInfoConfig = {
webSocketOrderbookChannel: [connectDocSections.webSocketOrderbookChannel],
types: [connectDocSections.types],
},
- sectionNameToMarkdown: {
- [connectDocSections.introduction]: IntroMarkdown,
- [connectDocSections.installation]: InstallationMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [connectDocSections.introduction]: IntroMarkdownV1,
+ [connectDocSections.installation]: InstallationMarkdownV1,
+ },
},
sectionNameToModulePath: {
[connectDocSections.httpClient]: ['"src/http_client"'],
diff --git a/packages/website/ts/containers/ethereum_types_documentation.ts b/packages/website/ts/containers/ethereum_types_documentation.ts
index 285438835..0be8dd3bc 100644
--- a/packages/website/ts/containers/ethereum_types_documentation.ts
+++ b/packages/website/ts/containers/ethereum_types_documentation.ts
@@ -30,9 +30,11 @@ const docsInfoConfig: DocsInfoConfig = {
install: [docSections.installation],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
- [docSections.installation]: InstallationMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdown,
+ [docSections.installation]: InstallationMarkdown,
+ },
},
sectionNameToModulePath: {
[docSections.types]: ['"index"'],
diff --git a/packages/website/ts/containers/json_schemas_documentation.ts b/packages/website/ts/containers/json_schemas_documentation.ts
index 67740d4c6..523777114 100644
--- a/packages/website/ts/containers/json_schemas_documentation.ts
+++ b/packages/website/ts/containers/json_schemas_documentation.ts
@@ -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"'],
diff --git a/packages/website/ts/containers/order_utils_documentation.ts b/packages/website/ts/containers/order_utils_documentation.ts
index 37b7f2273..c6570f514 100644
--- a/packages/website/ts/containers/order_utils_documentation.ts
+++ b/packages/website/ts/containers/order_utils_documentation.ts
@@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/order_utils/introduction');
-const InstallationMarkdown = require('md/docs/order_utils/installation');
+const IntroMarkdownV1 = require('md/docs/order_utils/1.0.0/introduction');
+const InstallationMarkdownV1 = require('md/docs/order_utils/1.0.0/installation');
/* tslint:enable:no-var-requires */
const docSections = {
@@ -32,9 +32,11 @@ const docsInfoConfig: DocsInfoConfig = {
usage: [docSections.usage],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
- [docSections.installation]: InstallationMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdownV1,
+ [docSections.installation]: InstallationMarkdownV1,
+ },
},
sectionNameToModulePath: {
[docSections.usage]: [
diff --git a/packages/website/ts/containers/smart_contracts_documentation.ts b/packages/website/ts/containers/smart_contracts_documentation.ts
index c88c3b365..b0a712477 100644
--- a/packages/website/ts/containers/smart_contracts_documentation.ts
+++ b/packages/website/ts/containers/smart_contracts_documentation.ts
@@ -10,7 +10,7 @@ import { DocPackages, SmartContractDocSections as Sections } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/smart_contracts/introduction');
+const IntroMarkdownV1 = require('md/docs/smart_contracts/1.0.0/introduction');
/* tslint:enable:no-var-requires */
const docsInfoConfig: DocsInfoConfig = {
@@ -22,8 +22,10 @@ const docsInfoConfig: DocsInfoConfig = {
introduction: [Sections.Introduction],
contracts: [Sections.Exchange, Sections.TokenRegistry, Sections.ZRXToken, Sections.TokenTransferProxy],
},
- sectionNameToMarkdown: {
- [Sections.Introduction]: IntroMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [Sections.Introduction]: IntroMarkdownV1,
+ },
},
sections: {
Introduction: Sections.Introduction,
diff --git a/packages/website/ts/containers/sol_compiler_documentation.ts b/packages/website/ts/containers/sol_compiler_documentation.ts
index 8720e2c1d..b289c8f34 100644
--- a/packages/website/ts/containers/sol_compiler_documentation.ts
+++ b/packages/website/ts/containers/sol_compiler_documentation.ts
@@ -9,8 +9,8 @@ import { DocPackages } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/sol-compiler/introduction');
-const InstallationMarkdown = require('md/docs/sol-compiler/installation');
+const IntroMarkdownV1 = require('md/docs/sol-compiler/introduction');
+const InstallationMarkdownV1 = require('md/docs/sol-compiler/installation');
const UsageMarkdown = require('md/docs/sol-compiler/usage');
/* tslint:enable:no-var-requires */
@@ -34,10 +34,12 @@ const docsInfoConfig: DocsInfoConfig = {
compiler: [docSections.compiler],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
- [docSections.installation]: InstallationMarkdown,
- [docSections.usage]: UsageMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdownV1,
+ [docSections.installation]: InstallationMarkdownV1,
+ [docSections.usage]: UsageMarkdown,
+ },
},
sectionNameToModulePath: {
[docSections.compiler]: ['"sol-compiler/src/compiler"'],
diff --git a/packages/website/ts/containers/sol_cov_documentation.ts b/packages/website/ts/containers/sol_cov_documentation.ts
index a8009071f..d78c450ed 100644
--- a/packages/website/ts/containers/sol_cov_documentation.ts
+++ b/packages/website/ts/containers/sol_cov_documentation.ts
@@ -9,8 +9,8 @@ import { DocPackages } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/sol_cov/introduction');
-const InstallationMarkdown = require('md/docs/sol_cov/installation');
+const IntroMarkdownV1 = require('md/docs/sol_cov/introduction');
+const InstallationMarkdownV1 = require('md/docs/sol_cov/installation');
const UsageMarkdown = require('md/docs/sol_cov/usage');
/* tslint:enable:no-var-requires */
@@ -40,10 +40,12 @@ const docsInfoConfig: DocsInfoConfig = {
'truffle-artifact-adapter': [docSections.truffleArtifactAdapter],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
- [docSections.installation]: InstallationMarkdown,
- [docSections.usage]: UsageMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdownV1,
+ [docSections.installation]: InstallationMarkdownV1,
+ [docSections.usage]: UsageMarkdown,
+ },
},
sectionNameToModulePath: {
[docSections.coverageSubprovider]: ['"sol-cov/src/coverage_subprovider"'],
diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts
index 567f6a37e..0e9150d7b 100644
--- a/packages/website/ts/containers/subproviders_documentation.ts
+++ b/packages/website/ts/containers/subproviders_documentation.ts
@@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/subproviders/introduction');
-const InstallationMarkdown = require('md/docs/subproviders/installation');
+const IntroMarkdownV1 = require('md/docs/subproviders/introduction');
+const InstallationMarkdownV1 = require('md/docs/subproviders/installation');
const LedgerNodeHidMarkdown = require('md/docs/subproviders/ledger_node_hid');
/* tslint:enable:no-var-requires */
@@ -57,10 +57,12 @@ const docsInfoConfig: DocsInfoConfig = {
['nonceTracker-subprovider']: [docSections.nonceTrackerSubprovider],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
- [docSections.installation]: InstallationMarkdown,
- [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdownV1,
+ [docSections.installation]: InstallationMarkdownV1,
+ [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown,
+ },
},
sectionNameToModulePath: {
[docSections.subprovider]: ['"subproviders/src/subproviders/subprovider"'],
diff --git a/packages/website/ts/containers/web3_wrapper_documentation.ts b/packages/website/ts/containers/web3_wrapper_documentation.ts
index b04a83ac4..8d98d9476 100644
--- a/packages/website/ts/containers/web3_wrapper_documentation.ts
+++ b/packages/website/ts/containers/web3_wrapper_documentation.ts
@@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/web3_wrapper/introduction');
-const InstallationMarkdown = require('md/docs/web3_wrapper/installation');
+const IntroMarkdownV1 = require('md/docs/web3_wrapper/introduction');
+const InstallationMarkdownV1 = require('md/docs/web3_wrapper/installation');
/* tslint:enable:no-var-requires */
const docSections = {
@@ -32,9 +32,11 @@ const docsInfoConfig: DocsInfoConfig = {
web3Wrapper: [docSections.web3Wrapper],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
- [docSections.installation]: InstallationMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdownV1,
+ [docSections.installation]: InstallationMarkdownV1,
+ },
},
sectionNameToModulePath: {
[docSections.web3Wrapper]: ['"web3-wrapper/src/web3_wrapper"'],
diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts
index 9d3be56f5..2fc08e923 100644
--- a/packages/website/ts/containers/zero_ex_js_documentation.ts
+++ b/packages/website/ts/containers/zero_ex_js_documentation.ts
@@ -10,11 +10,11 @@ import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/0xjs/introduction');
-const InstallationMarkdown = require('md/docs/0xjs/installation');
-const AsyncMarkdown = require('md/docs/0xjs/async');
-const ErrorsMarkdown = require('md/docs/0xjs/errors');
-const versioningMarkdown = require('md/docs/0xjs/versioning');
+const IntroMarkdownV1 = require('md/docs/0xjs/1.0.0/introduction');
+const InstallationMarkdownV1 = require('md/docs/0xjs/1.0.0/installation');
+const AsyncMarkdownV1 = require('md/docs/0xjs/1.0.0/async');
+const ErrorsMarkdownV1 = require('md/docs/0xjs/1.0.0/errors');
+const versioningMarkdownV1 = require('md/docs/0xjs/1.0.0/versioning');
/* tslint:enable:no-var-requires */
const zeroExJsDocSections = {
@@ -54,12 +54,14 @@ const docsInfoConfig: DocsInfoConfig = {
orderWatcher: [zeroExJsDocSections.orderWatcher],
types: [zeroExJsDocSections.types],
},
- sectionNameToMarkdown: {
- [zeroExJsDocSections.introduction]: IntroMarkdown,
- [zeroExJsDocSections.installation]: InstallationMarkdown,
- [zeroExJsDocSections.async]: AsyncMarkdown,
- [zeroExJsDocSections.errors]: ErrorsMarkdown,
- [zeroExJsDocSections.versioning]: versioningMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [zeroExJsDocSections.introduction]: IntroMarkdownV1,
+ [zeroExJsDocSections.installation]: InstallationMarkdownV1,
+ [zeroExJsDocSections.async]: AsyncMarkdownV1,
+ [zeroExJsDocSections.errors]: ErrorsMarkdownV1,
+ [zeroExJsDocSections.versioning]: versioningMarkdownV1,
+ },
},
sectionNameToModulePath: {
[zeroExJsDocSections.zeroEx]: ['"0x.js/src/0x"', '"src/0x"'],