mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-02-22 21:00:48 +01:00
ShowAll Marker for transformer stages
This commit is contained in:
parent
e7574513c5
commit
a99b031bc6
@ -1,6 +1,10 @@
|
||||
import type ItemMerger from './debug/ItemMerger';
|
||||
|
||||
interface Debug {
|
||||
/**
|
||||
* If set to true, all items will be shown as relevant.
|
||||
*/
|
||||
readonly showAll?: boolean;
|
||||
/**
|
||||
* If this is set, the debug UI will group items and display a merged item.
|
||||
*/
|
||||
|
@ -31,5 +31,5 @@ export function initialStage(inputSchema: string[], inputItems: Item[]): StageRe
|
||||
inputItems.length
|
||||
} items`,
|
||||
];
|
||||
return new StageResult(toDescriptor({}), schema, pages, tracker, messages);
|
||||
return new StageResult(toDescriptor({ debug: { showAll: true } }), schema, pages, tracker, messages);
|
||||
}
|
||||
|
@ -16,6 +16,9 @@ export default class CalculateStatistics extends ItemTransformer {
|
||||
'maxHeightFont',
|
||||
'fontToFormats',
|
||||
],
|
||||
debug: {
|
||||
showAll: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,9 @@ export default class CalculateCoordinates extends ItemTransformer {
|
||||
'Extracts X and Y out of the Transform array',
|
||||
{
|
||||
requireColumns: ['transform'],
|
||||
debug: {
|
||||
showAll: true,
|
||||
},
|
||||
},
|
||||
(incomingSchema) => {
|
||||
return incomingSchema.reduce((schema, column) => {
|
||||
|
@ -101,6 +101,7 @@
|
||||
pages={visiblePages}
|
||||
{maxPage}
|
||||
{pageIsPinned}
|
||||
showAllAsRelevant={stageResult.descriptor?.debug?.showAll}
|
||||
bind:onlyRelevantItems
|
||||
changes={stageResult.changes} />
|
||||
</div>
|
||||
|
@ -13,6 +13,7 @@
|
||||
export let maxPage: number;
|
||||
export let pageIsPinned: boolean;
|
||||
export let onlyRelevantItems: boolean;
|
||||
export let showAllAsRelevant = false;
|
||||
export let changes: ChangeIndex;
|
||||
let maxItemsToRenderInOneLoad = 200;
|
||||
let renderedMaxPage = 0;
|
||||
@ -74,7 +75,7 @@
|
||||
{/if}
|
||||
|
||||
<!-- Page items -->
|
||||
{#each page.itemGroups.filter((group) => !onlyRelevantItems || changes.hasChanged(group.top)) as itemGroup, itemIdx}
|
||||
{#each page.itemGroups.filter((group) => showAllAsRelevant || !onlyRelevantItems || changes.hasChanged(group.top)) as itemGroup, itemIdx}
|
||||
<tr
|
||||
class:expandable={itemGroup.hasMany()}
|
||||
class:expanded={expandedItemGroup && isExpanded(page.index, itemIdx)}
|
||||
|
Loading…
Reference in New Issue
Block a user