{#snippet sectionHeading(title: string, depth: number)} {#if depth === 0}
{title}
{:else if depth === 1}
{title}
{:else if depth === 2}
{title}
{:else if depth === 3}
{title}
{:else if depth === 4}
{title}
{:else}
{title}
{/if} {/snippet} {#snippet contentParagraph(content: string, publicationType: string)} {#if publicationType === 'book'}
{@html content}
{:else}
{@html content}
{/if} {/snippet}
{#if orderedChildren.length === 0 || depth >= 4} {#key updateCount} {#if isEditing}
toggleEditing(rootId, false)} > Cancel
toggleEditing(rootId, true)} > Save
{:else} {@render contentParagraph(currentContent, publicationType)} {/if} {/key} {:else}
{#if isEditing}
toggleEditing(rootId, false)} />
toggleEditing(rootId, true)}> Save
{:else} {@render sectionHeading(title!, depth)} {/if} {#key subtreeUpdateCount} {#each orderedChildren as id, index}
{/each} {/key}
{/if} {#if allowEditing && depth > 0}
{#if hasPreviousSibling && parentId}
moveUp(rootId, parentId)}>
{/if} {#if hasNextSibling && parentId}
moveDown(rootId, parentId)}>
{/if}
toggleEditing(rootId)}>
Edit
{/if}