Skip to main content

make_sub_collection_documents

Function make_sub_collection_documents 

Source
pub fn make_sub_collection_documents(
    doc: &mut PostDocument,
    root: &Node,
    collections: &FxHashMap<String, Vec<NodeData>>,
) -> Vec<PostDocument>
Expand description

Given collected content broken into portions by initial letter, fill in the main document with the first sub-collection, and create new documents for the rest.

Port of Collector::makeSubCollectionDocuments.

The collections map has: initial → XML data for that section. The first sub-collection fills the existing root element; each subsequent one gets a new sub-document.