mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 08:36:33 +03:00
feat(cli): add disableGoogleFont
parameter to cli (#1045)
This commit is contained in:
parent
350649d8b3
commit
aceb3438f2
19
cli/index.ts
19
cli/index.ts
|
@ -25,6 +25,7 @@ interface Options {
|
||||||
cdn?: boolean;
|
cdn?: boolean;
|
||||||
output?: string;
|
output?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
|
disableGoogleFont?: boolean;
|
||||||
port?: number;
|
port?: number;
|
||||||
templateFileName?: string;
|
templateFileName?: string;
|
||||||
templateOptions?: any;
|
templateOptions?: any;
|
||||||
|
@ -99,6 +100,12 @@ YargsParser.command(
|
||||||
default: 'ReDoc documentation',
|
default: 'ReDoc documentation',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
yargs.options('disableGoogleFont', {
|
||||||
|
describe: 'Disable Google Font',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
});
|
||||||
|
|
||||||
yargs.option('cdn', {
|
yargs.option('cdn', {
|
||||||
describe: 'Do not include ReDoc source code into html page, use link to CDN instead',
|
describe: 'Do not include ReDoc source code into html page, use link to CDN instead',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
@ -114,6 +121,7 @@ YargsParser.command(
|
||||||
output: argv.o as string,
|
output: argv.o as string,
|
||||||
cdn: argv.cdn as boolean,
|
cdn: argv.cdn as boolean,
|
||||||
title: argv.title as string,
|
title: argv.title as string,
|
||||||
|
disableGoogleFont: argv.disableGoogleFont as boolean,
|
||||||
templateFileName: argv.template as string,
|
templateFileName: argv.template as string,
|
||||||
templateOptions: argv.templateOptions || {},
|
templateOptions: argv.templateOptions || {},
|
||||||
redocOptions: argv.options || {},
|
redocOptions: argv.options || {},
|
||||||
|
@ -218,7 +226,15 @@ async function bundle(pathToSpec, options: Options = {}) {
|
||||||
async function getPageHTML(
|
async function getPageHTML(
|
||||||
spec: any,
|
spec: any,
|
||||||
pathToSpec: string,
|
pathToSpec: string,
|
||||||
{ ssr, cdn, title, templateFileName, templateOptions, redocOptions = {} }: Options,
|
{
|
||||||
|
ssr,
|
||||||
|
cdn,
|
||||||
|
title,
|
||||||
|
disableGoogleFont,
|
||||||
|
templateFileName,
|
||||||
|
templateOptions,
|
||||||
|
redocOptions = {},
|
||||||
|
}: Options,
|
||||||
) {
|
) {
|
||||||
let html;
|
let html;
|
||||||
let css;
|
let css;
|
||||||
|
@ -261,6 +277,7 @@ async function getPageHTML(
|
||||||
: `<script>${redocStandaloneSrc}</script>`) + css
|
: `<script>${redocStandaloneSrc}</script>`) + css
|
||||||
: '<script src="redoc.standalone.js"></script>',
|
: '<script src="redoc.standalone.js"></script>',
|
||||||
title,
|
title,
|
||||||
|
disableGoogleFont,
|
||||||
templateOptions,
|
templateOptions,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{{{redocHead}}}
|
{{{redocHead}}}
|
||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
|
{{#unless disableGoogleFont}}<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">{{/unless}}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user