1use crate::Error;
8
9mod github;
10mod gitlab;
11mod service;
12
13pub use service::{WikiConfig, WikiPlatform, WikiService};
14
15#[must_use]
17pub fn is_available() -> bool {
18 true
19}
20
21pub fn detect_platform(remote_url: &str) -> Result<WikiPlatform, Error> {
27 if remote_url.contains("github.com") {
28 Ok(WikiPlatform::GitHub)
29 } else if remote_url.contains("gitlab.com") || remote_url.contains("gitlab") {
30 Ok(WikiPlatform::GitLab)
31 } else {
32 Err(Error::WikiError {
33 message: format!("Unknown wiki platform for remote: {remote_url}"),
34 })
35 }
36}