From 7e4d57781d85bae11136309db82b042fa5698c6d Mon Sep 17 00:00:00 2001 From: Shadaj Laddad Date: Sat, 6 Jan 2024 20:15:55 -0800 Subject: [PATCH] docs(hydroflow_plus): make bash snippets copyable and link from Hydroflow landing (#1020) --- docs/docs/hydroflow/quickstart/index.md | 6 ++++++ docs/docs/hydroflow_plus/index.mdx | 9 ++++++--- docs/docs/hydroflow_plus/quickstart/clusters.mdx | 3 ++- docs/docs/hydroflow_plus/quickstart/distributed.mdx | 3 ++- docs/docs/hydroflow_plus/quickstart/index.mdx | 9 ++++++--- docs/docs/hydroflow_plus/quickstart/structure.mdx | 9 ++++++--- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/docs/docs/hydroflow/quickstart/index.md b/docs/docs/hydroflow/quickstart/index.md index 359d10b03ec9..d631fb2cefb5 100644 --- a/docs/docs/hydroflow/quickstart/index.md +++ b/docs/docs/hydroflow/quickstart/index.md @@ -1,2 +1,8 @@ # Quickstart This section will get you up and running with Rust and Hydroflow, and work you through a set of concrete examples illustrating much of what you need to know to get productive with Hydroflow. + +:::tip + +Hydroflow is the low-level IR that forms the foundation of the Hydro stack. If you're looking for a higher-level API, check out [Hydroflow+](../../hydroflow_plus/index.mdx). + +::: diff --git a/docs/docs/hydroflow_plus/index.mdx b/docs/docs/hydroflow_plus/index.mdx index aa770576db5c..dde0e1896cac 100644 --- a/docs/docs/hydroflow_plus/index.mdx +++ b/docs/docs/hydroflow_plus/index.mdx @@ -11,12 +11,15 @@ The main logic of Hydroflow+ programs manipulates **streams**, which capture inf Hydroflow+ requires a particular workspace setup, as any crate that uses Hydroflow+ must have an supporting macro crate to drive the code generation. To get started, we recommend using the Hydroflow+ template. ```bash -$ cargo install cargo-generate -$ cargo generate hydro-project/hydroflow-plus-template +#shell-command-next-line +cargo install cargo-generate +#shell-command-next-line +cargo generate hydro-project/hydroflow-plus-template ``` Then, you can test the example dataflow: ```bash -$ cargo test +#shell-command-next-line +cargo test ``` diff --git a/docs/docs/hydroflow_plus/quickstart/clusters.mdx b/docs/docs/hydroflow_plus/quickstart/clusters.mdx index 2f8043ed433f..ca3be813c46c 100644 --- a/docs/docs/hydroflow_plus/quickstart/clusters.mdx +++ b/docs/docs/hydroflow_plus/quickstart/clusters.mdx @@ -130,7 +130,8 @@ async fn main() { If we run this script, we should see the following output: ```bash -$ cargo run -p flow --example broadcast +#shell-command-next-line +cargo run -p flow --example broadcast [worker/0] 0 [worker/1] 0 [worker/0] 1 diff --git a/docs/docs/hydroflow_plus/quickstart/distributed.mdx b/docs/docs/hydroflow_plus/quickstart/distributed.mdx index 3f68d1556315..a7f4af0b430f 100644 --- a/docs/docs/hydroflow_plus/quickstart/distributed.mdx +++ b/docs/docs/hydroflow_plus/quickstart/distributed.mdx @@ -108,7 +108,8 @@ Most importantly, we specify a `DeployProcessSpec`, which takes a closure that c We can then run our distributed dataflow with: ```bash -$ cargo run -p flow --example first_ten_distributed +#shell-command-next-line +cargo run -p flow --example first_ten_distributed [service/1] 0 [service/1] 1 [service/1] 2 diff --git a/docs/docs/hydroflow_plus/quickstart/index.mdx b/docs/docs/hydroflow_plus/quickstart/index.mdx index 8b05ae8ff240..361cbf7ad6f7 100644 --- a/docs/docs/hydroflow_plus/quickstart/index.mdx +++ b/docs/docs/hydroflow_plus/quickstart/index.mdx @@ -4,8 +4,11 @@ In this tutorial, we'll walk through the basics of Hydroflow+ by building a simp To get started with a new project, we'll use the Hydroflow+ template. The template comes with a pre-configured build system and an implementation of the following examples. ```bash -$ cargo install cargo-generate -$ cargo generate hydro-project/hydroflow-plus-template +#shell-command-next-line +cargo install cargo-generate +#shell-command-next-line +cargo generate hydro-project/hydroflow-plus-template # Project Name: my-example-project -$ cd my-example-project +#shell-command-next-line +cd my-example-project ``` diff --git a/docs/docs/hydroflow_plus/quickstart/structure.mdx b/docs/docs/hydroflow_plus/quickstart/structure.mdx index 3170ccd20f09..86fd537d70d8 100644 --- a/docs/docs/hydroflow_plus/quickstart/structure.mdx +++ b/docs/docs/hydroflow_plus/quickstart/structure.mdx @@ -13,8 +13,10 @@ Hydroflow+ programs require special structure to support code generation and dis We recommend using the Hydroflow+ template to get started with a new project. The template comes with a pre-configured build system and the following example pre-implemented. ```bash -$ cargo install cargo-generate -$ cargo generate hydro-project/hydroflow-plus-template +#shell-command-next-line +cargo install cargo-generate +#shell-command-next-line +cargo generate hydro-project/hydroflow-plus-template ``` ::: @@ -90,7 +92,8 @@ async fn main() { We can now run this binary to see the output of our dataflow: ```bash -$ cargo run -p flow --bin first_ten +#shell-command-next-line +cargo run -p flow --bin first_ten 0 1 2