#deserialize #requirements #doorstop

doorstop-rs

Library for reading doorstop documents

2 unstable releases

0.2.0 Apr 30, 2024
0.1.0 Apr 26, 2024

#2197 in Parser implementations


Used in doorstop-reqif

AGPL-3.0-or-later

23KB
481 lines

Doorstop library in rust

This library helps reading doorstop documents.

Features

  • Parsing documents

Roadmap

  • Add items links
  • Add custom attributes

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

lib.rs:

Help library to read doorstop documents implemented in Rust.

Here an example of how to read a document tree and print the elements of the root document sorted by level

 use crate::doorstop_rs::doorstop::document_tree::DocumentTree;

 let document_tree = DocumentTree::load("resources/reqs").unwrap();
 let root_document = &document_tree.borrow().document;
 for (_, each_item) in root_document.items_sorted_by_level.iter() {
     let default_string_value = "N/A".to_string();
     println!(
         "{}-({}){}",
         each_item.id.as_ref().unwrap_or_else(|| &default_string_value),
         each_item.level.as_ref().unwrap_or_else(|| &default_string_value),
         each_item.header.as_ref().unwrap_or_else(|| &default_string_value)
     )
 }

Dependencies

~3–11MB
~122K SLoC