renaming(mkDocs): To mkdocs
Suggested by kmatyukhin on https://github.com/backstage/backstage/pull/15417 Signed-off-by: Renan Mendes Carvalho <aitherios@gmail.com> Co-authored-by: Konstantin Matyukhin <kmatyukhin@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
/// <reference types="cypress" />
|
||||
describe('TechDocs Live Preview - MkDocs Serve', () => {
|
||||
it('successfully serves documentation', () => {
|
||||
cy.visit(Cypress.env('mkDocsBaseUrl'));
|
||||
cy.visit(Cypress.env('mkdocsBaseUrl'));
|
||||
cy.contains('hello mock docs');
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@ describe('TechDocs Live Preview - MkDocs Serve', () => {
|
||||
});
|
||||
|
||||
it('matchImage - MkDocs Page', () => {
|
||||
cy.visit(Cypress.env('mkDocsBaseUrl')).then(() => {
|
||||
cy.visit(Cypress.env('mkdocsBaseUrl')).then(() => {
|
||||
cy.document().matchImage();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ export default async function generate(opts: OptionValues) {
|
||||
|
||||
await fs.ensureDir(outputDir);
|
||||
|
||||
const { path: mkDocsYmlPath, configIsTemporary } = await getMkdocsYml(
|
||||
const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(
|
||||
sourceDir,
|
||||
);
|
||||
|
||||
@@ -116,7 +116,7 @@ export default async function generate(opts: OptionValues) {
|
||||
|
||||
if (configIsTemporary) {
|
||||
process.on('exit', async () => {
|
||||
fs.rmSync(mkDocsYmlPath, {});
|
||||
fs.rmSync(mkdocsYmlPath, {});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export default async function serveMkdocs(opts: OptionValues) {
|
||||
const localAddr = `http://127.0.0.1:${opts.port}`;
|
||||
const expectedDevAddr = opts.docker ? dockerAddr : localAddr;
|
||||
|
||||
const { path: mkDocsYmlPath, configIsTemporary } = await getMkdocsYml(
|
||||
const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(
|
||||
'./',
|
||||
opts.siteName,
|
||||
);
|
||||
@@ -81,7 +81,7 @@ export default async function serveMkdocs(opts: OptionValues) {
|
||||
|
||||
if (configIsTemporary) {
|
||||
process.on('exit', async () => {
|
||||
fs.rmSync(mkDocsYmlPath, {});
|
||||
fs.rmSync(mkdocsYmlPath, {});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export default async function serve(opts: OptionValues) {
|
||||
? mkdocsDockerAddr
|
||||
: mkdocsLocalAddr;
|
||||
|
||||
const { path: mkDocsYmlPath, configIsTemporary } = await getMkdocsYml(
|
||||
const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(
|
||||
'./',
|
||||
opts.siteName,
|
||||
);
|
||||
@@ -150,7 +150,7 @@ export default async function serve(opts: OptionValues) {
|
||||
|
||||
if (configIsTemporary) {
|
||||
process.on('exit', async () => {
|
||||
fs.rmSync(mkDocsYmlPath, {});
|
||||
fs.rmSync(mkdocsYmlPath, {});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,20 @@ export const getLocationForEntity: (
|
||||
scmIntegration: ScmIntegrationRegistry,
|
||||
) => ParsedLocationAnnotation;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export const getMkDocsYml: (
|
||||
inputDir: string,
|
||||
siteOptions?:
|
||||
| {
|
||||
name?: string | undefined;
|
||||
}
|
||||
| undefined,
|
||||
) => Promise<{
|
||||
path: string;
|
||||
content: string;
|
||||
configIsTemporary: boolean;
|
||||
}>;
|
||||
|
||||
// @public
|
||||
export const getMkdocsYml: (
|
||||
inputDir: string,
|
||||
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
import {
|
||||
patchMkdocsYmlPreBuild,
|
||||
pathMkdocsYmlWithTechdocsPlugin,
|
||||
} from './mkDocsPatchers';
|
||||
} from './mkdocsPatchers';
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
const mockEntity = {
|
||||
|
||||
@@ -23,3 +23,10 @@ export type {
|
||||
GeneratorRunOptions,
|
||||
SupportedGeneratorKey,
|
||||
} from './types';
|
||||
import { getMkdocsYml } from './helpers';
|
||||
/**
|
||||
* @public
|
||||
* @deprecated
|
||||
* Deprecated in favor of getMkdocsYml (lowercase 'd')
|
||||
*/
|
||||
export const getMkDocsYml = getMkdocsYml;
|
||||
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
import {
|
||||
patchMkdocsYmlPreBuild,
|
||||
pathMkdocsYmlWithTechdocsPlugin,
|
||||
} from './mkDocsPatchers';
|
||||
} from './mkdocsPatchers';
|
||||
import {
|
||||
GeneratorBase,
|
||||
GeneratorConfig,
|
||||
|
||||
Reference in New Issue
Block a user