Skip to content

Commit 6e8c5af

Browse files
author
yjang
committed
Remove page break if end of pdf
1 parent d2efeaf commit 6e8c5af

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/pdf-gen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default async function createPdf(specUrl, options) {
6969
allContent.push(securityDef);
7070
}
7171
if (options.includeApiDetails) {
72-
apiDef = getApiDef(parsedSpec, '', options.pdfSchemaStyle, options.localize, options.includeExample);
72+
apiDef = getApiDef(parsedSpec, '', options.pdfSchemaStyle, options.localize, options.includeExample, options.includeApiList);
7373
allContent.push(apiDef);
7474
}
7575
if (options.includeApiList) {

src/pdf-parts-gen.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ function getResponseDef(responses, schemaStyle, localize) {
312312
}
313313

314314
// API details def
315-
export function getApiDef(spec, filterPath, schemaStyle, localize, includeExample) {
315+
export function getApiDef(spec, filterPath, schemaStyle, localize, includeExample, includeApiList) {
316316
const content = [{ text: localize.api, style: ['h2', 'b'] }];
317317
let tagSeq = 0;
318318

@@ -444,6 +444,12 @@ export function getApiDef(spec, filterPath, schemaStyle, localize, includeExampl
444444
);
445445
}
446446
});
447+
448+
// Remove last page break if api list not included
449+
if (!includeApiList) {
450+
content.pop();
451+
}
452+
447453
return content;
448454
}
449455

0 commit comments

Comments
 (0)