Use actual packageName for external example imports

This commit is contained in:
Fabio Berger 2018-08-22 16:11:42 +01:00
parent 40b202f8c0
commit 7c29cadb17
15 changed files with 17 additions and 2 deletions

View File

@ -322,7 +322,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
<a href={link} target="_blank" style={{ color: colors.lightBlueA700, textDecoration: 'none' }}> <a href={link} target="_blank" style={{ color: colors.lightBlueA700, textDecoration: 'none' }}>
{exportName} {exportName}
</a> </a>
{` } from '${this.props.docsInfo.displayName}'`} {` } from '${this.props.docsInfo.packageName}'`}
</code> </code>
</div> </div>
); );

View File

@ -21,6 +21,7 @@ export class DocsInfo {
public id: string; public id: string;
public type: SupportedDocJson; public type: SupportedDocJson;
public displayName: string; public displayName: string;
public packageName: string;
public packageUrl: string; public packageUrl: string;
public menu: DocsMenu; public menu: DocsMenu;
public sections: SectionsMap; public sections: SectionsMap;
@ -31,6 +32,7 @@ export class DocsInfo {
this.type = config.type; this.type = config.type;
this.menu = config.markdownMenu; this.menu = config.markdownMenu;
this.displayName = config.displayName; this.displayName = config.displayName;
this.packageName = config.packageName;
this.packageUrl = config.packageUrl; this.packageUrl = config.packageUrl;
this.sections = config.markdownSections; this.sections = config.markdownSections;
this.sectionNameToMarkdownByVersion = config.sectionNameToMarkdownByVersion; this.sectionNameToMarkdownByVersion = config.sectionNameToMarkdownByVersion;

View File

@ -4,6 +4,7 @@ export interface SectionNameToMarkdownByVersion {
export interface DocsInfoConfig { export interface DocsInfoConfig {
id: string; id: string;
packageName: string;
type: SupportedDocJson; type: SupportedDocJson;
displayName: string; displayName: string;
packageUrl: string; packageUrl: string;
@ -309,6 +310,7 @@ export interface Metadata {
} }
export interface GeneratedDocJson { export interface GeneratedDocJson {
version: string;
metadata: Metadata; metadata: Metadata;
typedocJson: TypeDocNode; typedocJson: TypeDocNode;
} }

View File

@ -6,7 +6,6 @@ import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentatio
import { Dispatcher } from 'ts/redux/dispatcher'; import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer'; import { State } from 'ts/redux/reducer';
import { DocPackages } from 'ts/types'; import { DocPackages } from 'ts/types';
import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate'; import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */ /* tslint:disable:no-var-requires */
@ -21,6 +20,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.Connect, id: DocPackages.Connect,
packageName: '@0xproject/connect',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: '0x Connect', displayName: '0x Connect',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -21,6 +21,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.ContractWrappers, id: DocPackages.ContractWrappers,
packageName: '@0xproject/contract-wrappers',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'Contract Wrappers', displayName: 'Contract Wrappers',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -22,6 +22,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.EthereumTypes, id: DocPackages.EthereumTypes,
packageName: 'ethereum-types',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'Ethereum Types', displayName: 'Ethereum Types',
packageUrl: 'https://github.com/0xProject/0x-monorepo/packages/ethereum-types', packageUrl: 'https://github.com/0xProject/0x-monorepo/packages/ethereum-types',

View File

@ -25,6 +25,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.JSONSchemas, id: DocPackages.JSONSchemas,
packageName: '@0xproject/json-schemas',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'JSON Schemas', displayName: 'JSON Schemas',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -21,6 +21,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.OrderUtils, id: DocPackages.OrderUtils,
packageName: '@0xproject/order-utils',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'Order utils', displayName: 'Order utils',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -21,6 +21,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.OrderWatcher, id: DocPackages.OrderWatcher,
packageName: '@0xproject/order-watcher',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'OrderWatcher', displayName: 'OrderWatcher',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -15,6 +15,7 @@ const IntroMarkdownV1 = require('md/docs/smart_contracts/1.0.0/introduction');
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.SmartContracts, id: DocPackages.SmartContracts,
packageName: 'contracts',
type: SupportedDocJson.Doxity, type: SupportedDocJson.Doxity,
displayName: '0x Smart Contracts', displayName: '0x Smart Contracts',
packageUrl: 'https://github.com/0xProject/contracts', packageUrl: 'https://github.com/0xProject/contracts',

View File

@ -22,6 +22,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.SolCompiler, id: DocPackages.SolCompiler,
packageName: '@0xproject/sol-compiler',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'Solidity Compiler', displayName: 'Solidity Compiler',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -22,6 +22,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.SolCov, id: DocPackages.SolCov,
packageName: '@0xproject/sol-cov',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'Sol-cov', displayName: 'Sol-cov',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -23,6 +23,7 @@ const docSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.Subproviders, id: DocPackages.Subproviders,
packageName: '@0xproject/subproviders',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'Subproviders', displayName: 'Subproviders',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -21,6 +21,7 @@ const docSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.Web3Wrapper, id: DocPackages.Web3Wrapper,
packageName: '@0xproject/web3-wrapper',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: 'Web3Wrapper', displayName: 'Web3Wrapper',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',

View File

@ -31,6 +31,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = { const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.ZeroExJs, id: DocPackages.ZeroExJs,
packageName: '0x.js',
type: SupportedDocJson.TypeDoc, type: SupportedDocJson.TypeDoc,
displayName: '0x.js', displayName: '0x.js',
packageUrl: 'https://github.com/0xProject/0x-monorepo', packageUrl: 'https://github.com/0xProject/0x-monorepo',