diff options
author | Minijackson <minijackson@riseup.net> | 2020-02-23 17:01:14 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2020-02-23 17:01:14 +0100 |
commit | 5b137e8bb767aa2b381e9d5a0710583c4edaa889 (patch) | |
tree | b732d1071bffda7b9d54aaa5ebeb0122890a750a /src/generator/mod.rs | |
parent | 5a83e2b55b672042562601866ed0253613c5e8b8 (diff) | |
download | poseidoc-5b137e8bb767aa2b381e9d5a0710583c4edaa889.tar.gz poseidoc-5b137e8bb767aa2b381e9d5a0710583c4edaa889.zip |
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++
Diffstat (limited to 'src/generator/mod.rs')
-rw-r--r-- | src/generator/mod.rs | 23 |
1 files changed, 11 insertions, 12 deletions
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"); | |||
17 | 17 | ||
18 | pub(crate) fn generate( | 18 | pub(crate) fn generate( |
19 | base_dir: &Path, | 19 | base_dir: &Path, |
20 | entities: BTreeMap<EntityId, Entity>, | 20 | toplevel_entity: Entity, |
21 | config: &Config, | 21 | config: &Config, |
22 | ) -> Result<()> { | 22 | ) -> Result<()> { |
23 | let md_output_dir = base_dir.join("markdown"); | 23 | let md_output_dir = base_dir.join("markdown"); |
@@ -38,17 +38,16 @@ pub(crate) fn generate( | |||
38 | debug!("Generated temporary file with CSS at: {:?}", css_path); | 38 | debug!("Generated temporary file with CSS at: {:?}", css_path); |
39 | 39 | ||
40 | rayon::scope(|scope| { | 40 | rayon::scope(|scope| { |
41 | for (id, entity) in entities { | 41 | generate_recursively( |
42 | generate_recursively( | 42 | // TODO: a bit hacky? |
43 | id, | 43 | EntityId(String::from("index")), |
44 | entity, | 44 | toplevel_entity, |
45 | scope, | 45 | scope, |
46 | &md_output_dir, | 46 | &md_output_dir, |
47 | &html_output_dir, | 47 | &html_output_dir, |
48 | css_path, | 48 | css_path, |
49 | config, | 49 | config, |
50 | ); | 50 | ); |
51 | } | ||
52 | }); | 51 | }); |
53 | 52 | ||
54 | Ok(()) | 53 | Ok(()) |