Skip to content

Write an outline of one's own - #7

Merged
tannevaled merged 1 commit into
mainfrom
write-outlines
Aug 25, 2026
Merged

Write an outline of one's own#7
tannevaled merged 1 commit into
mainfrom
write-outlines

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

A document assembled rather than merged has an outline of its caller's: there is no source outline to carry over, because the pages came from several places and the headings over them are new.

doc.SetOutline([]ops.Bookmark{
    {Title: "One", Page: 1, Children: []ops.Bookmark{{Title: "One and a half", Page: 2}}},
    {Title: "Three", Page: 3},
})

An entry pointing at a page this document has not got is left out, and so is everything under it — a heading whose section has gone is not a heading any more. Passing nothing puts the sources' bookmarks back, and DropOutlines still wins over both. The same depth and count limits that bound a carried-over outline bound this one.

This is what a shared edit needs, where several people agree on an order of pages drawn from several files and the headings over them belong to the plan rather than to any of the files.

100% statement coverage.

A document assembled rather than merged has an outline of its caller's: there
is no source outline to carry over, because the pages came from several places
and the headings over them are new.

Doc.SetOutline writes the bookmarks given rather than the sources' own. An
entry pointing at a page this document has not got is left out, and so is
everything under it — a heading whose section has gone is not a heading any
more. Passing nothing puts the sources' bookmarks back, and DropOutlines still
wins over both.

This is what a shared edit needs: several people agree on an order of pages
drawn from several files, and the headings over them belong to the plan rather
than to any of the files.
@tannevaled
tannevaled merged commit bf439cc into main Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant