From 5b137e8bb767aa2b381e9d5a0710583c4edaa889 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Sun, 23 Feb 2020 17:01:14 +0100 Subject: Big clang refactoring - Manipulating the entity tree should be much nicer: - "Typesafe type erasure" - Entry API for the tree - *NOT clang specific*: There is now a single entity at the top of the tree: the global namespace scope for the case of C/C++ --- src/generator/mod.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/generator') diff --git a/src/generator/mod.rs b/src/generator/mod.rs index 3f62779..f351bb1 100644 --- a/src/generator/mod.rs +++ b/src/generator/mod.rs @@ -17,7 +17,7 @@ const DEFAULT_CSS: &[u8] = include_bytes!("../../res/style.css"); pub(crate) fn generate( base_dir: &Path, - entities: BTreeMap, + toplevel_entity: Entity, config: &Config, ) -> Result<()> { let md_output_dir = base_dir.join("markdown"); @@ -38,17 +38,16 @@ pub(crate) fn generate( debug!("Generated temporary file with CSS at: {:?}", css_path); rayon::scope(|scope| { - for (id, entity) in entities { - generate_recursively( - id, - entity, - scope, - &md_output_dir, - &html_output_dir, - css_path, - config, - ); - } + generate_recursively( + // TODO: a bit hacky? + EntityId(String::from("index")), + toplevel_entity, + scope, + &md_output_dir, + &html_output_dir, + css_path, + config, + ); }); Ok(()) -- cgit v1.2.3