Skip to content

Commit

Permalink
implement codegen foundations for snippet index
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Dec 10, 2024
1 parent 17c0075 commit 8aaa8a8
Show file tree
Hide file tree
Showing 9 changed files with 960 additions and 2 deletions.
9 changes: 9 additions & 0 deletions crates/build/re_types_builder/src/bin/build_re_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const CPP_OUTPUT_DIR_PATH: &str = "rerun_cpp";
const PYTHON_OUTPUT_DIR_PATH: &str = "rerun_py/rerun_sdk/rerun";
const PYTHON_TESTING_OUTPUT_DIR_PATH: &str = "rerun_py/tests/test_types";
const DOCS_CONTENT_DIR_PATH: &str = "docs/content/reference/types";
const SNIPPETS_REF_DIR_PATH: &str = "docs/snippets/";

/// This uses [`rayon::scope`] to spawn all closures as tasks
/// running in parallel. It blocks until all tasks are done.
Expand Down Expand Up @@ -91,6 +92,7 @@ fn main() {
let python_output_dir_path = workspace_dir.join(PYTHON_OUTPUT_DIR_PATH);
let python_testing_output_dir_path = workspace_dir.join(PYTHON_TESTING_OUTPUT_DIR_PATH);
let docs_content_dir_path = workspace_dir.join(DOCS_CONTENT_DIR_PATH);
let snippets_ref_dir_path = workspace_dir.join(SNIPPETS_REF_DIR_PATH);

let cur_hash = read_versioning_hash(&re_types_source_hash_path);
re_log::debug!("cur_hash: {cur_hash:?}");
Expand Down Expand Up @@ -159,6 +161,13 @@ fn main() {
&arrow_registry,
check,
),
|| re_types_builder::generate_snippets_ref(
&reporter,
snippets_ref_dir_path,
&objects,
&arrow_registry,
check,
),
);

report.finalize();
Expand Down
3 changes: 2 additions & 1 deletion crates/build/re_types_builder/src/codegen/docs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod arrow_datatype;
mod snippets_ref;
mod website;

pub use self::website::DocsCodeGenerator;
pub use self::{snippets_ref::SnippetsRefCodeGenerator, website::DocsCodeGenerator};
Loading

0 comments on commit 8aaa8a8

Please sign in to comment.