better docs
All checks were successful
CI/CD Pipeline / test (push) Successful in 36s

This commit is contained in:
philipp 2024-02-04 22:04:07 +01:00
parent 443807d2b8
commit ac8c7cd29a

View File

@ -7,11 +7,24 @@ use crate::misc::{current_date, Error};
use super::parser::OgdSearchResult; use super::parser::OgdSearchResult;
/// Parses a law text from the Austrian RIS (Rechtsinformationssystem) based on the given `law_id`.
///
/// This function iterates over all pages of the law text, with each page containing a maximum of 100
/// paragraphs in XML format. It extracts and returns the links to each paragraph as XML URLs.
///
/// The first section of the first page is skipped (`skip` is set to true) because it always
/// contains the table of contents. The function continues processing subsequent pages until there
/// are no more pages left to fetch.
///
/// # Parameters /// # Parameters
/// - `law_id`: Id from RIS of a law ///
/// - `law_id`: The unique identifier of the law in the RIS system.
/// ///
/// # Returns /// # Returns
/// Error, or a list of Xml file links of the given law text ///
/// - `Ok(Vec<String>)`: A vector of XML file links representing paragraphs from the given law text.
/// - `Err(Error)`: An error if there was an issue fetching or parsing the law text.
/// ```
pub fn parse(law_id: usize) -> Result<Vec<String>, Error> { pub fn parse(law_id: usize) -> Result<Vec<String>, Error> {
let mut page = 1; let mut page = 1;
let mut skip = true; let mut skip = true;