From 83b2b2f8522014d724800a8f7502f92c3702ab60 Mon Sep 17 00:00:00 2001 From: John McNamara Date: Fri, 26 Jul 2024 00:11:53 +0100 Subject: [PATCH] docs: clean up trailing lines in examples --- src/chart.rs | 30 +++++------ src/conditional_format.rs | 34 ++++++------- src/data_validation.rs | 4 +- src/datetime.rs | 2 +- src/filter.rs | 8 +-- src/format.rs | 38 +++++++------- src/image.rs | 8 +-- src/note.rs | 4 +- src/serializer.rs | 4 +- src/table.rs | 32 ++++++------ src/workbook.rs | 10 ++-- src/worksheet.rs | 102 +++++++++++++++++++------------------- 12 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src/chart.rs b/src/chart.rs index 3a5803b0..1e982534 100644 --- a/src/chart.rs +++ b/src/chart.rs @@ -1661,7 +1661,7 @@ impl Chart { /// /// // Add the primary chart to the worksheet. /// worksheet.insert_chart_with_offset(0, 3, &column_chart, 5, 5)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("chart.xlsx")?; /// # @@ -1727,7 +1727,7 @@ impl Chart { /// /// // Add the primary chart to the worksheet. /// worksheet.insert_chart_with_offset(0, 3, &column_chart, 5, 5)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("chart.xlsx")?; /// # @@ -1997,7 +1997,7 @@ impl Chart { /// chart.set_up_down_bars(true); /// /// worksheet.insert_chart(0, 4, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -2076,7 +2076,7 @@ impl Chart { /// ); /// /// worksheet.insert_chart(0, 4, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -2166,7 +2166,7 @@ impl Chart { /// chart.set_high_low_lines(true); /// /// worksheet.insert_chart(0, 4, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -2238,7 +2238,7 @@ impl Chart { /// .set_high_low_lines_format(ChartLine::new().set_color("#FF0000")); /// /// worksheet.insert_chart(0, 4, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -2308,7 +2308,7 @@ impl Chart { /// chart.set_drop_lines(true); /// /// worksheet.insert_chart(0, 4, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -2380,7 +2380,7 @@ impl Chart { /// .set_drop_lines_format(ChartLine::new().set_color("#FF0000")); /// /// worksheet.insert_chart(0, 4, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -2452,7 +2452,7 @@ impl Chart { /// /// // Add the chart to the worksheet. /// worksheet.insert_chart(0, 4, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -7902,7 +7902,7 @@ impl ChartSeries { /// /// // Add the chart to the worksheet. /// worksheet.insert_chart(0, 2, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -10989,7 +10989,7 @@ impl ChartAxis { /// /// // Add the chart to the worksheet. /// worksheet.insert_chart(0, 3, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -11100,7 +11100,7 @@ impl ChartAxis { /// /// // Add the chart to the worksheet. /// worksheet.insert_chart(0, 2, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -11335,7 +11335,7 @@ impl ChartAxis { /// /// // Add the chart to the worksheet. /// worksheet.insert_chart(0, 3, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -11524,7 +11524,7 @@ impl ChartAxis { /// /// // Add the chart to the worksheet. /// worksheet.insert_chart(0, 2, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # @@ -17742,7 +17742,7 @@ impl ChartPlotArea { /// /// // Add the modified chart to the worksheet. /// worksheet.insert_chart(16, 2, &chart)?; - /// + /// # /// # // Save the file. /// # workbook.save("chart.xlsx")?; /// # diff --git a/src/conditional_format.rs b/src/conditional_format.rs index 68a85ba7..ed61ea5b 100644 --- a/src/conditional_format.rs +++ b/src/conditional_format.rs @@ -1257,7 +1257,7 @@ impl ConditionalFormatCell { /// .set_format(format); /// /// worksheet.add_conditional_format(0, 0, 9, 0, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -1301,7 +1301,7 @@ impl ConditionalFormatCell { /// .set_format(format); /// /// worksheet.add_conditional_format(0, 0, 9, 0, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -2247,7 +2247,7 @@ impl ConditionalFormatFormula { /// .set_format(format2); /// /// worksheet.add_conditional_format(2, 1, 11, 10, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -4674,7 +4674,7 @@ impl ConditionalFormatDataBar { /// let conditional_format = ConditionalFormatDataBar::new().set_fill_color("009933"); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -4739,7 +4739,7 @@ impl ConditionalFormatDataBar { /// let conditional_format = ConditionalFormatDataBar::new().set_border_color("FF0000"); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -4803,7 +4803,7 @@ impl ConditionalFormatDataBar { /// let conditional_format = ConditionalFormatDataBar::new().set_negative_fill_color("009933"); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -4870,7 +4870,7 @@ impl ConditionalFormatDataBar { /// .set_negative_border_color("000000"); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -4932,7 +4932,7 @@ impl ConditionalFormatDataBar { /// let conditional_format = ConditionalFormatDataBar::new().set_solid_fill(true); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -4985,7 +4985,7 @@ impl ConditionalFormatDataBar { /// let conditional_format = ConditionalFormatDataBar::new().set_border_off(true); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -5043,7 +5043,7 @@ impl ConditionalFormatDataBar { /// .set_direction(ConditionalFormatDataBarDirection::RightToLeft); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -5099,7 +5099,7 @@ impl ConditionalFormatDataBar { /// let conditional_format = ConditionalFormatDataBar::new().set_bar_only(true); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -5172,7 +5172,7 @@ impl ConditionalFormatDataBar { /// .set_axis_position(ConditionalFormatDataBarAxisPosition::None); /// /// worksheet.add_conditional_format(2, 7, 11, 7, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -5233,7 +5233,7 @@ impl ConditionalFormatDataBar { /// let conditional_format = ConditionalFormatDataBar::new().set_axis_color("FF0000"); /// /// worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -5885,7 +5885,7 @@ impl ConditionalFormatIconSet { /// .reverse_icons(true); /// /// worksheet.add_conditional_format(2, 1, 2, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -5946,7 +5946,7 @@ impl ConditionalFormatIconSet { /// .show_icons_only(true); /// /// worksheet.add_conditional_format(2, 1, 2, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -6051,7 +6051,7 @@ impl ConditionalFormatIconSet { /// .set_icons(&icons); /// /// worksheet.add_conditional_format(2, 1, 2, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -6514,7 +6514,7 @@ impl ConditionalFormatCustomIcon { /// .set_icons(&icons); /// /// worksheet.add_conditional_format(2, 1, 2, 3, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # diff --git a/src/data_validation.rs b/src/data_validation.rs index 0fd00497..0c6813fd 100644 --- a/src/data_validation.rs +++ b/src/data_validation.rs @@ -1189,7 +1189,7 @@ impl DataValidation { /// .set_error_title("Danger, Will Robinson!")?; /// /// worksheet.add_data_validation(1, 3, 1, 3, &data_validation)?; - /// + /// # /// # // Save the file. /// # workbook.save("data_validation.xlsx")?; /// # @@ -1255,7 +1255,7 @@ impl DataValidation { /// .set_error_message("The input value must be an integer in the range 1-10.")?; /// /// worksheet.add_data_validation(1, 3, 1, 3, &data_validation)?; - /// + /// # /// # // Save the file. /// # workbook.save("data_validation.xlsx")?; /// # diff --git a/src/datetime.rs b/src/datetime.rs index 0570fccc..94ee1c33 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -803,7 +803,7 @@ impl ExcelDateTime { /// worksheet.write_with_format(0, 0, &datetime1, &format)?; /// worksheet.write_with_format(1, 0, &datetime2, &format)?; /// worksheet.write_with_format(2, 0, &datetime3, &format)?; - /// + /// # /// # workbook.save("datetime.xlsx")?; /// # /// # Ok(()) diff --git a/src/filter.rs b/src/filter.rs index fe814a75..d3609383 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -477,7 +477,7 @@ impl FilterCondition { /// .add_list_filter("West") /// .add_list_filter("South"); /// worksheet.filter_column(0, &filter_condition)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -545,7 +545,7 @@ impl FilterCondition { /// let filter_condition = FilterCondition::new().add_list_blanks_filter(); /// /// worksheet.filter_column(0, &filter_condition)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -609,7 +609,7 @@ impl FilterCondition { /// let filter_condition = /// FilterCondition::new().add_custom_filter(FilterCriteria::NotEqualTo, " "); /// worksheet.filter_column(0, &filter_condition)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -683,7 +683,7 @@ impl FilterCondition { /// .add_custom_filter(FilterCriteria::GreaterThanOrEqualTo, 4000) /// .add_custom_filter(FilterCriteria::LessThanOrEqualTo, 8000); /// worksheet.filter_column(1, &filter_condition)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) diff --git a/src/format.rs b/src/format.rs index 67236e51..c45b1cad 100644 --- a/src/format.rs +++ b/src/format.rs @@ -497,7 +497,7 @@ impl Format { /// ``` /// # // This code is available in examples/doc_format_new.rs /// use rust_xlsxwriter::Format; - /// + /// # /// # #[allow(unused_variables)] /// fn main() { /// @@ -979,7 +979,7 @@ impl Format { /// let format = Format::new().set_font_name("Avenir Black Oblique"); /// /// worksheet.write_string_with_format(0, 0, "Avenir Black Oblique", &format)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1029,7 +1029,7 @@ impl Format { /// let format = Format::new().set_font_size(30); /// /// worksheet.write_string_with_format(0, 0, "Font Size 30", &format)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1126,7 +1126,7 @@ impl Format { /// worksheet.write_string_with_format(2, 0, "Double", &format3)?; /// worksheet.write_string_with_format(3, 0, "Single Accounting", &format4)?; /// worksheet.write_string_with_format(4, 0, "Double Accounting", &format5)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1162,7 +1162,7 @@ impl Format { /// let format = Format::new().set_font_strikethrough(); /// /// worksheet.write_string_with_format(0, 0, "Strikethrough Text", &format)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1246,7 +1246,7 @@ impl Format { /// worksheet.write_string_with_format(1, 0, "Top - Left", &format2)?; /// worksheet.write_string_with_format(2, 0, "Center - Center", &format3)?; /// worksheet.write_string_with_format(3, 0, "Bottom - Right", &format4)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1313,7 +1313,7 @@ impl Format { /// worksheet.write_string(0, 0, "Some text that isn't wrapped")?; /// worksheet.write_string_with_format(1, 0, "Some text that is wrapped", &format1)?; /// worksheet.write_string_with_format(2, 0, "Some text\nthat is\nwrapped\nat newlines", &format1)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1364,7 +1364,7 @@ impl Format { /// worksheet.write_string(0, 0, "Indent 0")?; /// worksheet.write_string_with_format(1, 0, "Indent 1", &format1)?; /// worksheet.write_string_with_format(2, 0, "Indent 2", &format2)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1417,7 +1417,7 @@ impl Format { /// worksheet.write_string_with_format(0, 0, "Rust", &format1)?; /// worksheet.write_string_with_format(1, 0, "Rust", &format2)?; /// worksheet.write_string_with_format(2, 0, "Rust", &format3)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1480,7 +1480,7 @@ impl Format { /// worksheet.write_string(0, 0, "نص عربي / English text")?; /// worksheet.write_string_with_format(1, 0, "نص عربي / English text", &format1)?; /// worksheet.write_string_with_format(2, 0, "نص عربي / English text", &format2)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1523,7 +1523,7 @@ impl Format { /// let format1 = Format::new().set_shrink(); /// /// worksheet.write_string_with_format(0, 0, "Shrink text to fit", &format1)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1581,7 +1581,7 @@ impl Format { /// /// worksheet.write_string_with_format(0, 0, "Rust", &format1)?; /// worksheet.write_blank(1, 0, &format2)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1629,7 +1629,7 @@ impl Format { /// let format1 = Format::new().set_background_color(Color::Green); /// /// worksheet.write_string_with_format(0, 0, "Rust", &format1)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1688,7 +1688,7 @@ impl Format { /// .set_pattern(FormatPattern::DarkVertical); /// /// worksheet.write_blank(0, 0, &format1)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1750,7 +1750,7 @@ impl Format { /// worksheet.write_blank(1, 1, &format1)?; /// worksheet.write_blank(3, 1, &format2)?; /// worksheet.write_blank(5, 1, &format3)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -1820,7 +1820,7 @@ impl Format { /// worksheet.write_blank(1, 1, &format1)?; /// worksheet.write_blank(3, 1, &format2)?; /// worksheet.write_blank(5, 1, &format3)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -2027,7 +2027,7 @@ impl Format { /// worksheet.write_blank(3, 1, &format2)?; /// worksheet.write_blank(5, 1, &format3)?; /// worksheet.write_blank(7, 1, &format4)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) @@ -2130,7 +2130,7 @@ impl Format { /// /// worksheet.write_string(2, 0, "Cell B3 is hidden. The formula isn't visible.")?; /// worksheet.write_formula_with_format(2, 1, "=1+2", &hidden)?; - /// + /// # /// # worksheet.write_string(4, 0, "Use Menu -> Review -> Unprotect Sheet")?; /// # worksheet.write_string(5, 0, "to remove the worksheet protection.")?; /// # @@ -2196,7 +2196,7 @@ impl Format { /// // invalid formula and raise an error. The quote prefix adds a virtual quote /// // to the start of the string and prevents this from happening. /// worksheet.write_string_with_format(0, 0, "=Hello", &format)?; - /// + /// # /// # workbook.save("formats.xlsx")?; /// # /// # Ok(()) diff --git a/src/image.rs b/src/image.rs index 5a3a3e8d..c4834cc6 100644 --- a/src/image.rs +++ b/src/image.rs @@ -232,7 +232,7 @@ impl Image { /// /// // Insert the image. /// worksheet.insert_image(1, 2, &image)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("image.xlsx")?; /// # @@ -588,7 +588,7 @@ impl Image { /// and a large letter R on the inside.\n\n\ /// The logo of the Rust programming language.", /// ); - /// + /// # /// # // Insert the image. /// # worksheet.insert_image(1, 2, &image)?; /// # @@ -647,7 +647,7 @@ impl Image { /// # /// // Create a new image object. /// let image = Image::new("examples/rust_logo.png")?.set_decorative(true); - /// + /// # /// # // Insert the image. /// # worksheet.insert_image(1, 2, &image)?; /// # @@ -715,7 +715,7 @@ impl Image { /// /// // Insert the image. /// worksheet.insert_image(1, 2, &image)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("image.xlsx")?; /// # diff --git a/src/note.rs b/src/note.rs index 7d2b1796..69178841 100644 --- a/src/note.rs +++ b/src/note.rs @@ -358,7 +358,7 @@ impl Note { /// /// // Add the note to a worksheet cell. /// worksheet.insert_note(2, 0, ¬e)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("notes.xlsx")?; /// # @@ -478,7 +478,7 @@ impl Note { /// /// // Add the note to a worksheet cell. /// worksheet.insert_note(2, 0, ¬e)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("notes.xlsx")?; /// # diff --git a/src/serializer.rs b/src/serializer.rs index cb479e73..72bf9d1f 100644 --- a/src/serializer.rs +++ b/src/serializer.rs @@ -3221,7 +3221,7 @@ impl CustomSerializeField { /// .set_background_color("C6EFCE"); /// /// let currency_format = Format::new().set_num_format("$0.00"); - /// + /// # /// # // Create a serializable struct. /// # #[derive(Deserialize, Serialize)] /// # struct Produce { @@ -3319,7 +3319,7 @@ impl CustomSerializeField { /// # /// // Set a cell value format. /// let value_format = Format::new().set_num_format("$0.00"); - /// + /// # /// # // Create a serializable struct. /// # #[derive(Deserialize, Serialize)] /// # struct Produce { diff --git a/src/table.rs b/src/table.rs index bdbff3d1..abb60d1d 100644 --- a/src/table.rs +++ b/src/table.rs @@ -324,7 +324,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 5, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -383,7 +383,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -464,7 +464,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 7, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -526,7 +526,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 7, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -600,7 +600,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -669,7 +669,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -736,7 +736,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -818,7 +818,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 6, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -884,7 +884,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -980,7 +980,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 7, 6, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -1053,7 +1053,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -1123,7 +1123,7 @@ impl Table { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -1530,7 +1530,7 @@ impl TableColumn { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -1625,7 +1625,7 @@ impl TableColumn { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 7, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -1731,7 +1731,7 @@ impl TableColumn { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 6, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # @@ -1817,7 +1817,7 @@ impl TableColumn { /// /// // Add the table to the worksheet. /// worksheet.add_table(2, 1, 6, 5, &table)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("tables.xlsx")?; /// # diff --git a/src/workbook.rs b/src/workbook.rs index 7bc8172a..2c71b09f 100644 --- a/src/workbook.rs +++ b/src/workbook.rs @@ -540,7 +540,7 @@ impl Workbook { /// // Stop using worksheet1 and move back to worksheet2. /// worksheet2 = workbook.worksheet_from_index(1)?; /// worksheet2.write_string(1, 0, "Sheet2")?; - /// + /// # /// # workbook.save("workbook.xlsx")?; /// # /// # Ok(()) @@ -626,7 +626,7 @@ impl Workbook { /// // Stop using worksheet1 and move back to worksheet2. /// worksheet2 = workbook.worksheet_from_index(1)?; /// worksheet2.write_string(1, 0, "Sheet2")?; - /// + /// # /// # workbook.save("workbook.xlsx")?; /// # /// # Ok(()) @@ -1091,7 +1091,7 @@ impl Workbook { /// /// // Define a local/worksheet name. Over-rides the "Sales" name above. /// workbook.define_name("Sheet2!Sales", "=Sheet2!$G$1:$G$10")?; - /// + /// # /// # // Write some text in the file and one of the defined names in a formula. /// # for worksheet in workbook.worksheets_mut() { /// # worksheet.set_column_width(0, 45)?; @@ -1208,9 +1208,9 @@ impl Workbook { /// .set_comment("Created with Rust and rust_xlsxwriter"); /// /// workbook.set_properties(&properties); - /// + /// # /// # let worksheet = workbook.add_worksheet(); - /// + /// # /// # worksheet.set_column_width(0, 30)?; /// # worksheet.write_string(0, 0, "See File -> Info -> Properties")?; /// # diff --git a/src/worksheet.rs b/src/worksheet.rs index 69650f54..25684466 100644 --- a/src/worksheet.rs +++ b/src/worksheet.rs @@ -1605,7 +1605,7 @@ impl Worksheet { /// // Try name() using a user defined sheet name. /// let worksheet = workbook.add_worksheet().set_name("Data")?; /// assert_eq!("Data", worksheet.name()); - /// + /// # /// # workbook.save("workbook.xlsx")?; /// # /// # Ok(()) @@ -2275,7 +2275,7 @@ impl Worksheet { /// // Note Excel normally ignores trailing decimal zeros /// // when the number is unformatted. /// worksheet.write_number(7, 0, 1234.50000)?; - /// + /// # /// # workbook.save("numbers.xlsx")?; /// # /// # Ok(()) @@ -2359,7 +2359,7 @@ impl Worksheet { /// worksheet.write_number_with_format(1, 0, 1234.5, ¤cy_format)?; /// worksheet.write_number_with_format(2, 0, 0.3300, &percentage_format)?; /// worksheet.write_number_with_format(3, 0, 1234.5, &bold_italic_format)?; - /// + /// # /// # workbook.save("numbers.xlsx")?; /// # /// # Ok(()) @@ -2507,7 +2507,7 @@ impl Worksheet { /// worksheet.write_string_with_format(1, 0, "שָׁלוֹם", &bold_format)?; /// worksheet.write_string_with_format(2, 0, "नमस्ते", &italic_format)?; /// worksheet.write_string_with_format(3, 0, "こんにちは", &italic_format)?; - /// + /// # /// # workbook.save("strings.xlsx")?; /// # /// # Ok(()) @@ -2638,7 +2638,7 @@ impl Worksheet { /// (&red, &text[25..]), /// ]; /// worksheet.write_rich_string(1, 0, &segments)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("worksheet.xlsx")?; /// # @@ -2804,7 +2804,7 @@ impl Worksheet { /// worksheet.write_formula(3, 0, r#"=IF(A3>1,"Yes", "No")"#)?; /// worksheet.write_formula(4, 0, "=AVERAGE(1, 2, 3, 4)")?; /// worksheet.write_formula(5, 0, r#"=DATEVALUE("1-Jan-2023")"#)?; - /// + /// # /// # workbook.save("formulas.xlsx")?; /// # /// # Ok(()) @@ -2872,7 +2872,7 @@ impl Worksheet { /// worksheet.write_formula_with_format(1, 0, "=A1*2", &bold_format)?; /// worksheet.write_formula_with_format(2, 0, "=SIN(PI()/4)", &italic_format)?; /// worksheet.write_formula_with_format(3, 0, "=AVERAGE(1, 2, 3, 4)", &italic_format)?; - /// + /// # /// # workbook.save("formulas.xlsx")?; /// # /// # Ok(()) @@ -2953,7 +2953,7 @@ impl Worksheet { /// # /// // Write an array formula that returns a single value. /// worksheet.write_array_formula(0, 0, 0, 0, "{=SUM(B1:C1*B2:C2)}")?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("worksheet.xlsx")?; /// # @@ -3053,7 +3053,7 @@ impl Worksheet { /// # /// // Write an array formula that returns a single value. /// worksheet.write_array_formula_with_format(0, 0, 0, 0, "{=SUM(B1:C1*B2:C2)}", &bold)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("worksheet.xlsx")?; /// # @@ -3413,7 +3413,7 @@ impl Worksheet { /// /// worksheet.write_blank(1, 1, &format1)?; /// worksheet.write_blank(3, 1, &format2)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -3550,7 +3550,7 @@ impl Worksheet { /// let worksheet2 = workbook.add_worksheet(); /// worksheet2.write_string(3, 2, "Here I am")?; /// worksheet2.write_url_with_text(4, 2, "internal:Sheet1!A6", "Go back")?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("hyperlinks.xlsx")?; /// # @@ -3747,7 +3747,7 @@ impl Worksheet { /// /// // Write a url with an alternative format. /// worksheet.write_url_with_format(0, 0, "https://www.rust-lang.org", &link_format)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("worksheet.xlsx")?; /// # @@ -3887,7 +3887,7 @@ impl Worksheet { /// worksheet.write_datetime_with_format(2, 0, &datetime, &format3)?; /// worksheet.write_datetime_with_format(3, 0, &datetime, &format4)?; /// worksheet.write_datetime_with_format(4, 0, &datetime, &format5)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -3930,7 +3930,7 @@ impl Worksheet { /// worksheet.write_datetime_with_format(2, 0, &date, &format3)?; /// worksheet.write_datetime_with_format(3, 0, &date, &format4)?; /// worksheet.write_datetime_with_format(4, 0, &date, &format5)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -3973,7 +3973,7 @@ impl Worksheet { /// worksheet.write_datetime_with_format(2, 0, &time, &format3)?; /// worksheet.write_datetime_with_format(3, 0, &time, &format4)?; /// worksheet.write_datetime_with_format(4, 0, &time, &format5)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -4171,7 +4171,7 @@ impl Worksheet { /// worksheet.write_date_with_format(2, 0, &date, &format3)?; /// worksheet.write_date_with_format(3, 0, &date, &format4)?; /// worksheet.write_date_with_format(4, 0, &date, &format5)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -4266,7 +4266,7 @@ impl Worksheet { /// worksheet.write_time_with_format(2, 0, &time, &format3)?; /// worksheet.write_time_with_format(3, 0, &time, &format4)?; /// worksheet.write_time_with_format(4, 0, &time, &format5)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -4322,7 +4322,7 @@ impl Worksheet { /// /// worksheet.write_boolean(0, 0, true)?; /// worksheet.write_boolean(1, 0, false)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -4382,7 +4382,7 @@ impl Worksheet { /// /// worksheet.write_boolean_with_format(0, 0, true, &bold)?; /// worksheet.write_boolean_with_format(1, 0, false, &bold)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -4478,7 +4478,7 @@ impl Worksheet { /// .set_background_color(Color::Silver); /// /// worksheet.merge_range(7, 1, 8, 3, "Merged cells", &format)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("merge_range.xlsx")?; /// # @@ -4689,7 +4689,7 @@ impl Worksheet { /// /// // Insert the image at an offset. /// worksheet.insert_image_with_offset(1, 2, &image, 10, 5)?; - /// + /// # /// # // Save the file to disk. /// # workbook.save("image.xlsx")?; /// # @@ -5512,7 +5512,7 @@ impl Worksheet { /// /// // Set the row height in Excel character units. /// worksheet.set_row_height(2, 30)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -5597,7 +5597,7 @@ impl Worksheet { /// /// // Set the row height in pixels. /// worksheet.set_row_height_pixels(2, 40)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -5663,7 +5663,7 @@ impl Worksheet { /// /// // Add some formatted text that overrides the row format. /// worksheet.write_string_with_format(1, 2, "Hello", &bold_format)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -5861,7 +5861,7 @@ impl Worksheet { /// worksheet.set_column_width(2, 16)?; /// worksheet.set_column_width(4, 4)?; /// worksheet.set_column_width(5, 4)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -5941,7 +5941,7 @@ impl Worksheet { /// worksheet.set_column_width_pixels(2, 117)?; /// worksheet.set_column_width_pixels(4, 33)?; /// worksheet.set_column_width_pixels(5, 33)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -6019,7 +6019,7 @@ impl Worksheet { /// /// // Add some formatted text that overrides the column format. /// worksheet.write_string_with_format(2, 1, "Hello", &bold_format)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -6337,7 +6337,7 @@ impl Worksheet { /// // column. /// let filter_condition = FilterCondition::new().add_list_filter("East"); /// worksheet.filter_column(0, &filter_condition)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -6728,7 +6728,7 @@ impl Worksheet { /// .set_format(format2); /// /// worksheet.add_conditional_format(2, 1, 11, 10, &conditional_format)?; - /// + /// # /// # // Save the file. /// # workbook.save("conditional_format.xlsx")?; /// # @@ -7263,7 +7263,7 @@ impl Worksheet { /// /// worksheet.write_string(2, 0, "Cell B3 is hidden. The formula isn't visible.")?; /// worksheet.write_formula_with_format(2, 1, "=1+2", &hidden)?; - /// + /// # /// # worksheet.write_string(4, 0, "Use Menu -> Review -> Unprotect Sheet")?; /// # worksheet.write_string(5, 0, "to remove the worksheet protection.")?; /// # @@ -7328,7 +7328,7 @@ impl Worksheet { /// /// // Protect the worksheet from modification. /// worksheet.protect_with_password("abc123"); - /// + /// # /// # worksheet.write_string(0, 0, "Unlock the worksheet to edit the cell")?; /// # /// # workbook.save("worksheet.xlsx")?; @@ -7393,7 +7393,7 @@ impl Worksheet { /// /// // Set the protection options. /// worksheet.protect_with_options(&options); - /// + /// # /// # worksheet.write_string(0, 0, "Unlock the worksheet to edit the cell")?; /// # /// # workbook.save("worksheet.xlsx")?; @@ -7462,7 +7462,7 @@ impl Worksheet { /// /// // Unprotect single cell B3 by repeating (row, col). /// worksheet.unprotect_range(2, 1, 2, 1)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -7533,7 +7533,7 @@ impl Worksheet { /// /// // Unprotect range D4:F10 and give it a user defined name. /// worksheet.unprotect_range_with_options(4, 3, 9, 5, "MyRange", "")?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -7709,7 +7709,7 @@ impl Worksheet { /// /// // Also make this the active/selected cell. /// worksheet.set_selection(31, 26, 31, 26)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -7864,7 +7864,7 @@ impl Worksheet { /// # let worksheet = workbook.add_worksheet(); /// # /// worksheet.set_formula_result_default(""); - /// + /// # /// # workbook.save("formulas.xlsx")?; /// # /// # Ok(()) @@ -9526,7 +9526,7 @@ impl Worksheet { /// worksheet2.write_string(0, 0, "نص عربي / English text")?; /// worksheet2.write_string_with_format(1, 0, "نص عربي / English text", &format_left_to_right)?; /// worksheet2.write_string_with_format(2, 0, "نص عربي / English text", &format_right_to_left)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -9570,7 +9570,7 @@ impl Worksheet { /// let mut worksheet2 = Worksheet::new(); /// /// worksheet2.set_active(true); - /// + /// # /// # workbook.push_worksheet(worksheet1); /// # workbook.push_worksheet(worksheet2); /// # workbook.push_worksheet(worksheet3); @@ -9631,7 +9631,7 @@ impl Worksheet { /// let mut worksheet2 = Worksheet::new(); /// /// worksheet2.set_selected(true); - /// + /// # /// # workbook.push_worksheet(worksheet1); /// # workbook.push_worksheet(worksheet2); /// # workbook.push_worksheet(worksheet3); @@ -9691,7 +9691,7 @@ impl Worksheet { /// let mut worksheet2 = Worksheet::new(); /// /// worksheet2.set_hidden(true); - /// + /// # /// # workbook.push_worksheet(worksheet1); /// # workbook.push_worksheet(worksheet2); /// # workbook.push_worksheet(worksheet3); @@ -9809,7 +9809,7 @@ impl Worksheet { /// /// // worksheet4 will have the default color. /// worksheet4.set_active(true); - /// + /// # /// # workbook.push_worksheet(worksheet1); /// # workbook.push_worksheet(worksheet2); /// # workbook.push_worksheet(worksheet3); @@ -10000,7 +10000,7 @@ impl Worksheet { /// # let worksheet = workbook.add_worksheet(); /// # /// worksheet.set_landscape(); - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -10195,7 +10195,7 @@ impl Worksheet { /// # /// worksheet.write_string(0, 0, "Hello")?; /// worksheet.set_zoom(200); - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -10269,7 +10269,7 @@ impl Worksheet { /// /// // Freeze the top row and leftmost column. /// worksheet3.set_freeze_panes(1, 1)?; - /// + /// # /// # workbook.push_worksheet(worksheet1); /// # workbook.push_worksheet(worksheet2); /// # workbook.push_worksheet(worksheet3); @@ -10338,7 +10338,7 @@ impl Worksheet { /// /// // Pre-scroll to the row 20. /// worksheet.set_freeze_panes_top_cell(19, 0)?; - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -10538,7 +10538,7 @@ impl Worksheet { /// # let worksheet = workbook.add_worksheet(); /// # /// worksheet.set_header("&CPage &P of &N"); - /// + /// # /// # worksheet.write_string(0, 0, "Hello")?; /// # worksheet.write_string(200, 0, "Hello")?; /// # worksheet.set_view_page_layout(); @@ -10653,7 +10653,7 @@ impl Worksheet { /// // Insert the watermark image in the header. /// worksheet.set_header("&C&[Picture]"); /// worksheet.set_header_image(&image, HeaderImagePosition::Center)?; - /// + /// # /// # // Increase the top margin to 1.2 for clarity. The -1.0 values are ignored. /// # worksheet.set_margins(-1.0, -1.0, 1.2, -1.0, -1.0, -1.0); /// # @@ -10848,7 +10848,7 @@ impl Worksheet { /// # let worksheet = workbook.add_worksheet(); /// # /// worksheet.set_margins(1.0, 1.25, 1.5, 1.75, 0.75, 0.25); - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -10929,7 +10929,7 @@ impl Worksheet { /// # /// worksheet.set_header("&CPage &P of &N"); /// worksheet.set_print_first_page_number(2); - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -10975,7 +10975,7 @@ impl Worksheet { /// # /// // Scale the printed worksheet to 50%. /// worksheet.set_print_scale(50); - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(()) @@ -11055,7 +11055,7 @@ impl Worksheet { /// # /// // Set the printed output to fit 1 page wide and as long as necessary. /// worksheet.set_print_fit_to_pages(1, 0); - /// + /// # /// # workbook.save("worksheet.xlsx")?; /// # /// # Ok(())