atlas-confluence

Crates.ioatlas-confluence
lib.rsatlas-confluence
version0.2.0
sourcesrc
created_at2023-06-16 08:36:09.883567
updated_at2023-11-12 13:03:13.631265
descriptionSimple library to interact with the Confluence REST API
homepagehttps://github.com/alvarium-hex/confluence-rs
repositoryhttps://github.com/alvarium-hex/confluence-rs
max_upload_size
id892045
size13,835
Hannah Witvrouwen (xunafay)

documentation

README

About

A simple confluence API wrapper. Contributions are welcome!

Example

let session = Session::new(
    "joe@example.com".to_string(),
    "your token".to_string(),
    "https://example.atlassian.net/wiki".to_string(),
);

let spaces = session.get_spaces().await.expect("Failed to get spaces");
for space in spaces {
    let pages = session
        .get_pages_for_space(&space.key, None)
        .await
        .expect("Failed to get pages");
    
    info!(
        "Space({:?}): {:?} with {} pages",
        space.key,
        space.name,
        pages.len()
    );

    for page in pages {
        let html = &page.body.unwrap().view.unwrap().value;

        // replace relative links with absolute links
        let html = html.replace("(/wiki/", "(https://example.atlassian.net/wiki/");
  }
}
Commit count: 11

cargo fmt