Skip to content
Discussion options

You must be logged in to vote

Thanks @AB1908! I found that custom compare does actually work! Here's some working code for anyone who stumbles on this in the future:

let longform_index = dv.pages('"Book/Index"');
let current_draft_folder = longform_index.drafts.folder; 
let book_pages = dv.pages('"Book/Drafts/'+ current_draft_folder +'"');
let longformOrder = longform_index.drafts.scenes;

const longformSort = (a, b) => {
		const i1 = longformOrder.indexOf(a); 
		const i2 = longformOrder.indexOf(b); 		
		return ( (i1 > -1 ? i1 : Infinity) - (i2 > -1 ? i2 : Infinity) ); 
};

//

for(let group of book_pages.groupBy(p => p.arc).sort(g => g.key, "desc")) {
	dv.header(2, group.key);

	dv.table(
		["Scene", "POV"],
		group.…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@AB1908
Comment options

Comment options

You must be logged in to vote
1 reply
@blacksmithgu
Comment options

Answer selected by AB1908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants