Skip to content

Commit

Permalink
Snippet index: implement codegen foundations (#8383)
Browse files Browse the repository at this point in the history
All the codegen to generate the autogenerated parts of the new snippet
index.


[Rendered](https://github.com/rerun-io/rerun/blob/cmc/snippets_index_1_autogen/docs/snippets/INDEX.md)

* Fixes #1123
* Fixes #5662
* DNM: requires #8382

Generated data can be re-used for:
* #2934
  • Loading branch information
teh-cmc authored Dec 10, 2024
1 parent 17c0075 commit 6b40cd5
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 6b40cd5

Please sign in to comment.