add doc test
All checks were successful
CI/CD Pipeline / test (push) Successful in 37s

This commit is contained in:
philipp 2024-02-05 11:46:36 +01:00
parent 29e064cdbb
commit 9454b89d8e
3 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,5 @@
//! This deals with accessing RIS data.
pub mod overview;
pub mod paragraphs;
mod parser;

View File

@ -24,6 +24,14 @@ use super::parser::OgdSearchResult;
///
/// - `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.
///
/// # 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<Vec<String>, Error> {
let mut page = 1;

View File

@ -0,0 +1 @@
//! Deals with getting all paragraphs for a given law text