diff --git a/src/risparser/mod.rs b/src/risparser/mod.rs index 907bbfd..3b210cc 100644 --- a/src/risparser/mod.rs +++ b/src/risparser/mod.rs @@ -1,4 +1,5 @@ //! This deals with accessing RIS data. pub mod overview; +pub mod paragraphs; mod parser; diff --git a/src/risparser/overview.rs b/src/risparser/overview.rs index c909051..27381b8 100644 --- a/src/risparser/overview.rs +++ b/src/risparser/overview.rs @@ -24,6 +24,14 @@ use super::parser::OgdSearchResult; /// /// - `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. +/// +/// # Example +/// ``` +/// use risp::risparser::overview::parse; +/// +/// let list_with_xml_links_to_paragraphs = parse(10001905).unwrap(); +/// assert_eq!(list_with_xml_links_to_paragraphs.len(), 31); // TEG has 31 paragraphs +/// assert_eq!(list_with_xml_links_to_paragraphs[0], "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025190/NOR12025190.xml"); // Link to first paragraph /// ``` pub fn parse(law_id: usize) -> Result, Error> { let mut page = 1; diff --git a/src/risparser/paragraphs.rs b/src/risparser/paragraphs.rs new file mode 100644 index 0000000..221a663 --- /dev/null +++ b/src/risparser/paragraphs.rs @@ -0,0 +1 @@ +//! Deals with getting all paragraphs for a given law text