Skip to content

Commit d00928e

Browse files
committed
build mdbook as part of the PR CI
Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
1 parent f47ca56 commit d00928e

File tree

13 files changed

+31
-12
lines changed

13 files changed

+31
-12
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,22 @@ jobs:
123123
with:
124124
targets: wasm32-unknown-unknown
125125
- run: cd ${{ github.workspace }}/examples/wasm-yew/${{ matrix.example }} && cargo build --target wasm32-unknown-unknown
126+
127+
build_book:
128+
name: Build Book
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
- uses: dtolnay/rust-toolchain@stable
133+
- run: cargo install mdbook --no-default-features --features search --vers "^0.4" --locked --quiet
134+
- name: Build examples to generate needed html files
135+
run: |
136+
cd ${{ github.workspace }}/examples/basic_charts && cargo run
137+
cd ${{ github.workspace }}/examples/statistical_charts && cargo run
138+
cd ${{ github.workspace }}/examples/scientific_charts && cargo run
139+
cd ${{ github.workspace }}/examples/financial_charts && cargo run
140+
cd ${{ github.workspace }}/examples/3d_charts && cargo run
141+
cd ${{ github.workspace }}/examples/subplots && cargo run
142+
cd ${{ github.workspace }}/examples/shapes && cargo run
143+
- name: Build book
144+
run: mdbook build docs/book

examples/3d_charts/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ fn colorscale_plot(show: bool, file_name: &str) {
262262
fn write_example_to_html(plot: &Plot, name: &str) -> String {
263263
std::fs::create_dir_all("./output").unwrap();
264264
// Write inline HTML
265-
let html = plot.to_inline_html(Some(&name));
265+
let html = plot.to_inline_html(Some(name));
266266
let path = format!("./output/inline_{}.html", name);
267267
std::fs::write(path, html).unwrap();
268268
// Write standalone HTML

examples/basic_charts/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ fn grouped_donout_pie_charts(show: bool, file_name: &str) {
961961
fn write_example_to_html(plot: &Plot, name: &str) -> String {
962962
std::fs::create_dir_all("./output").unwrap();
963963
// Write inline HTML
964-
let html = plot.to_inline_html(Some(&name));
964+
let html = plot.to_inline_html(Some(name));
965965
let path = format!("./output/inline_{}.html", name);
966966
std::fs::write(path, html).unwrap();
967967
// Write standalone HTML

examples/custom_controls/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn bar_chart_with_modifiable_bar_mode(show: bool, file_name: &str) {
120120
fn write_example_to_html(plot: &Plot, name: &str) -> String {
121121
std::fs::create_dir_all("./output").unwrap();
122122
// Write inline HTML
123-
let html = plot.to_inline_html(Some(&name));
123+
let html = plot.to_inline_html(Some(name));
124124
let path = format!("./output/inline_{}.html", name);
125125
std::fs::write(path, html).unwrap();
126126
// Write standalone HTML

examples/customization/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn show_with_default_app(temp_path: &str) {
133133
fn write_example_to_html(plot: &Plot, name: &str) -> String {
134134
std::fs::create_dir_all("./output").unwrap();
135135
// Write inline HTML
136-
let html = plot.to_inline_html(Some(&name));
136+
let html = plot.to_inline_html(Some(name));
137137
let path = format!("./output/inline_{}.html", name);
138138
std::fs::write(path, html).unwrap();
139139
// Write standalone HTML

examples/financial_charts/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ fn simple_ohlc_chart(show: bool, file_name: &str) {
322322
fn write_example_to_html(plot: &Plot, name: &str) -> String {
323323
std::fs::create_dir_all("./output").unwrap();
324324
// Write inline HTML
325-
let html = plot.to_inline_html(Some(&name));
325+
let html = plot.to_inline_html(Some(name));
326326
let path = format!("./output/inline_{}.html", name);
327327
std::fs::write(path, html).unwrap();
328328
// Write standalone HTML

examples/images/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn trace_from_ndarray_rgba(show: bool, file_name: &str) {
105105
fn write_example_to_html(plot: &Plot, name: &str) -> String {
106106
std::fs::create_dir_all("./output").unwrap();
107107
// Write inline HTML
108-
let html = plot.to_inline_html(Some(&name));
108+
let html = plot.to_inline_html(Some(name));
109109
let path = format!("./output/inline_{}.html", name);
110110
std::fs::write(path, html).unwrap();
111111
// Write standalone HTML

examples/maps/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn density_mapbox(show: bool, file_name: &str) {
162162
fn write_example_to_html(plot: &Plot, name: &str) -> String {
163163
std::fs::create_dir_all("./output").unwrap();
164164
// Write inline HTML
165-
let html = plot.to_inline_html(Some(&name));
165+
let html = plot.to_inline_html(Some(name));
166166
let path = format!("./output/inline_{}.html", name);
167167
std::fs::write(path, html).unwrap();
168168
// Write standalone HTML

examples/ndarray/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn multiple_ndarray_traces_over_rows(show: bool, file_name: &str) {
7676
fn write_example_to_html(plot: &Plot, name: &str) -> String {
7777
std::fs::create_dir_all("./output").unwrap();
7878
// Write inline HTML
79-
let html = plot.to_inline_html(Some(&name));
79+
let html = plot.to_inline_html(Some(name));
8080
let path = format!("./output/inline_{}.html", name);
8181
std::fs::write(path, html).unwrap();
8282
// Write standalone HTML

examples/scientific_charts/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn customized_heat_map(show: bool, file_name: &str) {
179179
fn write_example_to_html(plot: &Plot, name: &str) -> String {
180180
std::fs::create_dir_all("./output").unwrap();
181181
// Write inline HTML
182-
let html = plot.to_inline_html(Some(&name));
182+
let html = plot.to_inline_html(Some(name));
183183
let path = format!("./output/inline_{}.html", name);
184184
std::fs::write(path, html).unwrap();
185185
// Write standalone HTML

0 commit comments

Comments
 (0)