Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/compiler/docs/readme/output-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ export async function generateReadme(config: d.Config, compilerCtx: d.CompilerCt
await Promise.all(readmeOutputs.map(async readmeOutput => {
if (readmeOutput.dir) {
const readmeContent = generateMarkdown(config, userContent, docsData, cmps, readmeOutput.footer);
const relPath = config.sys.path.relative(config.srcDir, docsData.readmePath);

let relPath;
if (readmeOutput.extension) {
const readme = docsData.readmePath.split('.');
relPath = config.sys.path.relative(config.srcDir, `${readme[0]}.${readmeOutput.extension}`);
} else {
relPath = config.sys.path.relative(config.srcDir, docsData.readmePath);
}

const absPath = config.sys.path.join(readmeOutput.dir, relPath);
const results = await compilerCtx.fs.writeFile(absPath, readmeContent);
if (results.changedContent) {
Expand Down
1 change: 1 addition & 0 deletions src/declarations/output-targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export interface OutputTargetDocsReadme extends OutputTargetBase {
dir?: string;
footer?: string;
strict?: boolean;
extension?: string;
}


Expand Down
2 changes: 1 addition & 1 deletion src/declarations/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Build } from './build-conditionals';

declare global {
namespace jest {
interface Matchers<R> {
interface Matchers<R, T> {
/**
* Compares HTML, but first normalizes the HTML so all
* whitespace, attribute order and css class order are
Expand Down