From ac8c7cd29a1f82b641542c10c0f7f9d7087967c7 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 4 Feb 2024 22:04:07 +0100 Subject: [PATCH] better docs --- src/risparser/overview.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/risparser/overview.rs b/src/risparser/overview.rs index d5da3fe..53c49d0 100644 --- a/src/risparser/overview.rs +++ b/src/risparser/overview.rs @@ -7,11 +7,24 @@ use crate::misc::{current_date, Error}; 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 -/// - `law_id`: Id from RIS of a law +/// +/// - `law_id`: The unique identifier of the law in the RIS system. /// /// # Returns -/// Error, or a list of Xml file links of the given law text +/// +/// - `Ok(Vec)`: 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, Error> { let mut page = 1; let mut skip = true;