Skip to content

Commit

Permalink
docs: fix some parameter/error sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed Jan 2, 2025
1 parent 2c6eaab commit df856b5
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 75 deletions.
11 changes: 11 additions & 0 deletions src/chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8312,6 +8312,14 @@ impl Default for ChartRange {
impl ChartRange {
/// Create a new `ChartRange` from a worksheet 5 tuple.
///
/// # Parameters
///
/// - `sheet_name`: The worksheet name that the range refers to.
/// - `first_row`: The first row of the range. (All zero indexed.)
/// - `first_col`: The first row of the range.
/// - `last_row`: The last row of the range.
/// - `last_col`: The last row of the range.
///
/// # Examples
///
/// The following example demonstrates creating a new chart range.
Expand Down Expand Up @@ -8348,6 +8356,9 @@ impl ChartRange {

/// Create a new `ChartRange` from an Excel range formula.
///
/// # Parameters
///
/// - `range_string`: A range string ref like `"Sheet1!$A$1:$A$5"`.
///
/// # Examples
///
Expand Down
40 changes: 20 additions & 20 deletions src/data_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1039,16 +1039,16 @@ impl DataValidation {
/// The title is only visible if there is also an input message. See the
/// [`DataValidation::set_input_message()`] example below.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the title exceeds
/// Excel's limit of 32 characters.
///
/// # Parameters
///
/// - `text`: Title string. Must be less than or equal to the Excel limit
/// of 32 characters.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the title exceeds
/// Excel's limit of 32 characters.
///
pub fn set_input_title(mut self, text: impl Into<String>) -> Result<DataValidation, XlsxError> {
let text = text.into();
let length = text.chars().count();
Expand All @@ -1069,17 +1069,17 @@ impl DataValidation {
/// is entered. This can we used to explain to the user what the data
/// validation rules are for the cell.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the message exceeds
/// Excel's limit of 255 characters.
///
/// # Parameters
///
/// - `text`: Message string. Must be less than or equal to the Excel limit
/// of 255 characters. The string can contain newlines to split it over
/// several lines.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the message exceeds
/// Excel's limit of 255 characters.
///
/// # Examples
///
/// Example of adding a data validation to a worksheet cell. This validation
Expand Down Expand Up @@ -1157,16 +1157,16 @@ impl DataValidation {
/// This option is used to set a title in bold for the error message when
/// there is a validation error.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the title exceeds
/// Excel's limit of 32 characters.
///
/// # Parameters
///
/// - `text`: Title string. Must be less than or equal to the Excel limit
/// of 32 characters.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the title exceeds
/// Excel's limit of 32 characters.
///
/// # Examples
///
/// Example of adding a data validation to a worksheet cell. This validation
Expand Down Expand Up @@ -1221,17 +1221,17 @@ impl DataValidation {
/// error. This can we used to explain to the user what the data validation
/// rules are for the cell.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the message exceeds
/// Excel's limit of 255 characters.
///
/// # Parameters
///
/// - `text`: Message string. Must be less than or equal to the Excel limit
/// of 255 characters. The string can contain newlines to split it over
/// several lines.
///
/// # Errors
///
/// - [`XlsxError::DataValidationError`] - The length of the message exceeds
/// Excel's limit of 255 characters.
///
/// # Examples
///
/// Example of adding a data validation to a worksheet cell. This validation
Expand Down
12 changes: 12 additions & 0 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,12 @@ impl FilterData {
///
/// This is used in conjunction with the [`IntoFilterData`] trait.
///
/// # Parameters
///
/// - `value`: The value as a string ref.
/// - `criteria`: The criteria/operator to use in the filter as defined by
/// the [`FilterCriteria`] struct.
///
pub fn new_string_and_criteria(value: &str, criteria: FilterCriteria) -> FilterData {
FilterData {
data_type: FilterDataType::String,
Expand All @@ -829,6 +835,12 @@ impl FilterData {
///
/// This is used in conjunction with the [`IntoFilterData`] trait.
///
/// # Parameters
///
/// - `value`: The `f64` number value.
/// - `criteria`: The criteria/operator to use in the filter as defined by
/// the [`FilterCriteria`] struct.
///
pub fn new_number_and_criteria(value: f64, criteria: FilterCriteria) -> FilterData {
// Store number but also convert it to a string since Excel makes string
// comparisons to "numbers stored as strings".
Expand Down
4 changes: 4 additions & 0 deletions src/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ impl Note {
///
/// The text of the Note is added in the constructor.
///
/// # Parameters
///
/// - `text`: The text that will appear in the note.
///
/// # Examples
///
/// The following example demonstrates adding a note to a worksheet cell.
Expand Down
Loading

0 comments on commit df856b5

Please sign in to comment.