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' }}>
{exportName}
</a>
{` } from '${this.props.docsInfo.displayName}'`}
{` } from '${this.props.docsInfo.packageName}'`}
</code>
</div>
);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,6 +21,7 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.OrderWatcher,
packageName: '@0xproject/order-watcher',
type: SupportedDocJson.TypeDoc,
displayName: 'OrderWatcher',
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 = {
id: DocPackages.SmartContracts,
packageName: 'contracts',
type: SupportedDocJson.Doxity,
displayName: '0x Smart Contracts',
packageUrl: 'https://github.com/0xProject/contracts',

View File

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

View File

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

View File

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

View File

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

View File

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