marmite 0.4.2

Marmite is the easiest static site generator.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
use log::{error, info, warn};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::{fs, process};

use crate::cli::Cli;
use crate::config::Marmite;
use crate::site::{self, Data};

pub const WORKSPACE_CONFIG_FILENAME: &str = "marmite-workspace.yaml";

#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct WorkspaceSiteEntry {
    pub name: String,
    #[serde(default)]
    pub output_path: Option<String>,
}

impl WorkspaceSiteEntry {
    pub fn resolved_output_path(&self) -> &str {
        self.output_path.as_deref().unwrap_or(&self.name)
    }
}

#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct WorkspaceConfig {
    pub sites: Vec<WorkspaceSiteEntry>,
    #[serde(default)]
    pub default_site: Option<String>,
    #[serde(default)]
    pub redirect: bool,
    #[serde(default)]
    pub defaults: Option<Marmite>,
    #[serde(default = "default_separator")]
    pub separator: String,
}

fn default_separator() -> String {
    "::".to_string()
}

impl WorkspaceConfig {
    pub fn resolved_default_site(&self) -> Option<&str> {
        self.default_site
            .as_deref()
            .or(self.sites.first().map(|s| s.name.as_str()))
    }
}

#[derive(Debug, Clone)]
pub struct SiteData {
    #[allow(dead_code)]
    pub name: String,
    pub output_path: String,
    pub data: Data,
}

#[derive(Debug, Clone, Default)]
pub struct CrossSiteData {
    pub sites: HashMap<String, SiteData>,
    pub separator: String,
}

pub fn detect_workspace(input_folder: &Path) -> Option<PathBuf> {
    let config_path = input_folder.join(WORKSPACE_CONFIG_FILENAME);
    if config_path.exists() {
        Some(config_path)
    } else {
        None
    }
}

pub fn load_workspace_config(
    config_path: &Path,
) -> Result<WorkspaceConfig, Box<dyn std::error::Error>> {
    let content = fs::read_to_string(config_path)?;
    let config: WorkspaceConfig = serde_yaml::from_str(&content)?;
    if config.sites.is_empty() {
        return Err("Workspace config must define at least one site in 'sites'".into());
    }
    Ok(config)
}

pub(crate) fn deep_merge_yaml(
    base: serde_yaml::Value,
    overlay: serde_yaml::Value,
) -> serde_yaml::Value {
    match (base, overlay) {
        (serde_yaml::Value::Mapping(mut base_map), serde_yaml::Value::Mapping(overlay_map)) => {
            for (key, overlay_val) in overlay_map {
                let merged = if let Some(base_val) = base_map.remove(&key) {
                    deep_merge_yaml(base_val, overlay_val)
                } else {
                    overlay_val
                };
                base_map.insert(key, merged);
            }
            serde_yaml::Value::Mapping(base_map)
        }
        (_, overlay) => overlay,
    }
}

pub fn merge_site_config(
    workspace_defaults: Option<&Marmite>,
    site_config_path: &Path,
    cli_args: &Arc<Cli>,
) -> Marmite {
    let mut base = workspace_defaults.cloned().unwrap_or_else(Marmite::new);
    base.override_from_cli_args(cli_args);

    let site_str = fs::read_to_string(site_config_path).unwrap_or_default();
    if site_str.is_empty() {
        return base;
    }

    let site_value: serde_yaml::Value = match serde_yaml::from_str(&site_str) {
        Ok(v) => v,
        Err(e) => {
            warn!(
                "Failed to parse site config '{}': {e}, using workspace defaults",
                site_config_path.display()
            );
            return base;
        }
    };

    let Ok(base_value) = serde_yaml::to_value(&base) else {
        return base;
    };

    let merged_value = deep_merge_yaml(base_value, site_value);
    serde_yaml::from_value(merged_value).unwrap_or(base)
}

fn preprocess_all_sites(
    ws_config: &WorkspaceConfig,
    workspace_root: &Path,
    cli_args: &Arc<Cli>,
) -> Result<CrossSiteData, Box<dyn std::error::Error>> {
    let mut cross_site = CrossSiteData {
        sites: HashMap::new(),
        separator: ws_config.separator.clone(),
    };

    let default_site_name = ws_config.resolved_default_site();

    for site_entry in &ws_config.sites {
        let site_input = workspace_root.join(&site_entry.name);
        if !site_input.exists() {
            return Err(format!("Site directory does not exist: {}", site_input.display()).into());
        }

        let site_config_path = site_input.join(&cli_args.config);
        let merged_config =
            merge_site_config(ws_config.defaults.as_ref(), &site_config_path, cli_args);

        let config_str = serde_yaml::to_string(&merged_config).unwrap_or_default();
        let mut site_data = Data::new(&config_str, &site_config_path);
        let content_folder = site::get_content_folder(&site_data.site, &site_input);
        let fragments = site::collect_content_fragments(&content_folder);
        let folder_defaults = site::load_folder_frontmatter(&content_folder);
        site::collect_content(
            &content_folder,
            &mut site_data,
            &fragments,
            None,
            &folder_defaults,
        );
        site_data.sort_all();
        site_data.collect_all_urls();

        let is_default = default_site_name == Some(site_entry.name.as_str());
        let output_path = if is_default && !ws_config.redirect {
            String::new()
        } else {
            site_entry.resolved_output_path().to_string()
        };

        cross_site.sites.insert(
            site_entry.name.clone(),
            SiteData {
                name: site_entry.name.clone(),
                output_path,
                data: site_data,
            },
        );
    }

    Ok(cross_site)
}

pub fn run_workspace(
    ws_config_path: &Path,
    workspace_root: &Path,
    output_folder_override: Option<PathBuf>,
    watch: bool,
    serve: bool,
    bind_address: &str,
    cli_args: &Arc<Cli>,
) -> Result<(), Box<dyn std::error::Error>> {
    let ws_config = load_workspace_config(ws_config_path)?;
    let output_root = output_folder_override.unwrap_or_else(|| workspace_root.join("site"));

    info!("Workspace mode: {} site(s) detected", ws_config.sites.len());

    let cross_site_data = preprocess_all_sites(&ws_config, workspace_root, cli_args)?;

    let default_site_name = ws_config.resolved_default_site().map(String::from);

    for site_entry in &ws_config.sites {
        let site_input = workspace_root.join(&site_entry.name);
        let site_config_path = site_input.join(&cli_args.config);
        let mut merged_config =
            merge_site_config(ws_config.defaults.as_ref(), &site_config_path, cli_args);

        let is_default = default_site_name.as_deref() == Some(&site_entry.name);
        let site_output = if is_default && !ws_config.redirect {
            output_root.clone()
        } else {
            output_root.join(site_entry.resolved_output_path())
        };

        if is_default && !ws_config.redirect {
            if let Some(url) = resolve_site_url(&merged_config.url, "") {
                merged_config.url = url;
            }
        } else {
            let path = site_entry.resolved_output_path();
            if let Some(url) = resolve_site_url(&merged_config.url, path) {
                merged_config.url = url;
            }
        }

        let path_prefix = if is_default && !ws_config.redirect {
            ""
        } else {
            site_entry.resolved_output_path()
        };

        info!(
            "Building site '{}' -> {}",
            site_entry.name,
            site_output.display()
        );

        site::build_site_with_config(
            &merged_config,
            &site_input,
            &site_output,
            cli_args,
            Some(&cross_site_data),
            path_prefix,
        )?;
    }

    if ws_config.redirect {
        if let Some(default_name) = &default_site_name {
            let default_path = ws_config
                .sites
                .iter()
                .find(|s| s.name == *default_name)
                .map_or(
                    default_name.as_str(),
                    WorkspaceSiteEntry::resolved_output_path,
                );
            let redirect_html = site::generate_redirect_html(&format!("/{default_path}/"));
            if let Err(e) = fs::create_dir_all(&output_root) {
                error!(
                    "Failed to create output directory: {}",
                    output_root.display()
                );
                return Err(e.into());
            }
            fs::write(output_root.join("index.html"), redirect_html)?;
            info!("Generated root redirect to /{default_path}/");
        }
    }

    write_sites_json(&ws_config, &output_root)?;
    write_workspace_build_info(&ws_config, &cross_site_data, &output_root)?;
    write_workspace_urls_json(&cross_site_data, &output_root)?;

    info!("Workspace generated at: {}/", output_root.display());

    if watch || serve {
        handle_workspace_watch_serve(
            &ws_config,
            ws_config_path,
            workspace_root,
            &output_root,
            watch,
            serve,
            bind_address,
            cli_args,
        );
    }

    Ok(())
}

fn resolve_site_url(base_url: &str, subpath: &str) -> Option<String> {
    if base_url.is_empty() {
        return None;
    }
    let base = base_url.trim_end_matches('/');
    if subpath.is_empty() {
        Some(base.to_string())
    } else {
        Some(format!("{base}/{subpath}"))
    }
}

fn write_sites_json(
    ws_config: &WorkspaceConfig,
    output_root: &Path,
) -> Result<(), Box<dyn std::error::Error>> {
    let sites_info: Vec<serde_json::Value> = ws_config
        .sites
        .iter()
        .map(|s| {
            serde_json::json!({
                "name": s.name,
                "path": format!("/{}/", s.resolved_output_path()),
            })
        })
        .collect();

    let json = serde_json::to_string_pretty(&sites_info)?;
    fs::write(output_root.join("sites.json"), json)?;
    info!("Generated sites.json");
    Ok(())
}

fn write_workspace_build_info(
    ws_config: &WorkspaceConfig,
    cross_site_data: &CrossSiteData,
    output_root: &Path,
) -> Result<(), Box<dyn std::error::Error>> {
    let mut total_posts = 0;
    let mut total_pages = 0;
    let mut sites = Vec::new();

    for site_entry in &ws_config.sites {
        if let Some(sd) = cross_site_data.sites.get(&site_entry.name) {
            let post_count = sd.data.posts.len();
            let page_count = sd.data.pages.len();
            total_posts += post_count;
            total_pages += page_count;
            sites.push(serde_json::json!({
                "name": site_entry.name,
                "output_path": sd.output_path,
                "posts": post_count,
                "pages": page_count,
            }));
        }
    }

    let build_info = serde_json::json!({
        "workspace": true,
        "marmite_version": env!("CARGO_PKG_VERSION"),
        "generated_at": chrono::Local::now().to_string(),
        "sites": sites,
        "total_posts": total_posts,
        "total_pages": total_pages,
    });

    let json = serde_json::to_string_pretty(&build_info)?;
    fs::write(output_root.join("marmite-workspace.json"), json)?;
    info!("Generated marmite-workspace.json");
    Ok(())
}

fn write_workspace_urls_json(
    cross_site_data: &CrossSiteData,
    output_root: &Path,
) -> Result<(), Box<dyn std::error::Error>> {
    let mut merged = serde_json::Map::new();

    for sd in cross_site_data.sites.values() {
        let site_json = site::create_urls_json(&sd.data, &sd.output_path);
        if let serde_json::Value::Object(map) = site_json {
            for (category, urls) in map {
                let entry = merged
                    .entry(category)
                    .or_insert_with(|| serde_json::Value::Array(Vec::new()));
                if let (serde_json::Value::Array(existing), serde_json::Value::Array(new)) =
                    (entry, urls)
                {
                    existing.extend(new);
                }
            }
        }
    }

    let json = serde_json::to_string_pretty(&serde_json::Value::Object(merged))?;
    fs::write(output_root.join("urls-workspace.json"), json)?;
    info!("Generated urls-workspace.json");
    Ok(())
}

pub fn show_urls_workspace(
    ws_config: &WorkspaceConfig,
    workspace_root: &Path,
    cli_args: &Arc<Cli>,
) {
    let cross_site = match preprocess_all_sites(ws_config, workspace_root, cli_args) {
        Ok(data) => data,
        Err(e) => {
            error!("Failed to preprocess workspace sites: {e}");
            process::exit(1);
        }
    };

    let mut all_urls = serde_json::Map::new();
    for site_entry in &ws_config.sites {
        if let Some(site_data) = cross_site.sites.get(&site_entry.name) {
            let urls = site_data.data.generated_urls.get_all_urls();
            let prefix = &site_data.output_path;
            let prefixed: Vec<String> = urls
                .iter()
                .map(|u| {
                    if prefix.is_empty() {
                        if u.starts_with('/') {
                            u.clone()
                        } else {
                            format!("/{u}")
                        }
                    } else if u.starts_with('/') {
                        format!("/{prefix}{u}")
                    } else {
                        format!("/{prefix}/{u}")
                    }
                })
                .collect();
            all_urls.insert(
                site_entry.name.clone(),
                serde_json::Value::Array(
                    prefixed
                        .into_iter()
                        .map(serde_json::Value::String)
                        .collect(),
                ),
            );
        }
    }

    match serde_json::to_string_pretty(&serde_json::Value::Object(all_urls)) {
        Ok(json_string) => println!("{json_string}"),
        Err(e) => error!("Failed to serialize workspace URLs to JSON: {e}"),
    }
}

pub fn show_shortcodes_workspace(
    ws_config: &WorkspaceConfig,
    workspace_root: &Path,
    cli_args: &Arc<Cli>,
) {
    for site_entry in &ws_config.sites {
        let site_input = workspace_root.join(&site_entry.name);
        let site_config_path = site_input.join(&cli_args.config);
        let merged_config =
            merge_site_config(ws_config.defaults.as_ref(), &site_config_path, cli_args);

        println!("\n=== Site: {} ===", site_entry.name);

        let mut processor =
            crate::shortcodes::ShortcodeProcessor::new(merged_config.shortcode_pattern.as_deref());
        if let Err(e) = processor.collect_shortcodes(&site_input) {
            eprintln!("Error collecting shortcodes for '{}': {e}", site_entry.name);
            continue;
        }

        println!("Enabled: {}", merged_config.enable_shortcodes);
        if processor.shortcodes.is_empty() {
            println!("No shortcodes available.");
        } else {
            for (name, description) in processor.list_shortcodes_with_descriptions() {
                match description {
                    Some(desc) => println!("  - {name}: {desc}"),
                    None => println!("  - {name}"),
                }
            }
        }
    }
}

pub fn resolve_cross_site_refs(html: &str, cross_site_data: &CrossSiteData) -> String {
    let sep = &cross_site_data.separator;
    let escaped_sep = regex::escape(sep);

    let pattern = format!(r#"((?:href|src)=["'])(\w+){escaped_sep}([^"']+)(["'])"#);
    let Ok(re) = regex::Regex::new(&pattern) else {
        return html.to_string();
    };

    re.replace_all(html, |caps: &regex::Captures| {
        let prefix = &caps[1];
        let site_name = &caps[2];
        let path = &caps[3];
        let suffix = &caps[4];

        if let Some(site_data) = cross_site_data.sites.get(site_name) {
            if site_data.output_path.is_empty() {
                format!("{prefix}/{path}{suffix}")
            } else {
                format!("{prefix}/{}/{path}{suffix}", site_data.output_path)
            }
        } else {
            caps[0].to_string()
        }
    })
    .to_string()
}

fn make_rebuild_fn(
    ws_config: &WorkspaceConfig,
    workspace_root: &Path,
    output_root: &Path,
    cli_args: &Arc<Cli>,
    live_reload: Option<crate::server::LiveReload>,
) -> Arc<std::sync::Mutex<impl Fn()>> {
    let ws_config_clone = ws_config.clone();
    let workspace_root_owned = workspace_root.to_path_buf();
    let output_root_owned = output_root.to_path_buf();
    let cli_clone = Arc::clone(cli_args);

    Arc::new(std::sync::Mutex::new(move || {
        info!("Change detected. Rebuilding workspace...");
        let cross_site_data =
            match preprocess_all_sites(&ws_config_clone, &workspace_root_owned, &cli_clone) {
                Ok(data) => data,
                Err(e) => {
                    error!("Failed to preprocess workspace: {e}");
                    return;
                }
            };

        let default_site_name = ws_config_clone.resolved_default_site().map(String::from);

        for site_entry in &ws_config_clone.sites {
            let site_input = workspace_root_owned.join(&site_entry.name);
            let site_config_path = site_input.join(&cli_clone.config);
            let mut merged_config = merge_site_config(
                ws_config_clone.defaults.as_ref(),
                &site_config_path,
                &cli_clone,
            );

            let is_default = default_site_name.as_deref() == Some(&site_entry.name);
            let site_output = if is_default && !ws_config_clone.redirect {
                output_root_owned.clone()
            } else {
                output_root_owned.join(site_entry.resolved_output_path())
            };

            if is_default && !ws_config_clone.redirect {
                if let Some(url) = resolve_site_url(&merged_config.url, "") {
                    merged_config.url = url;
                }
            } else {
                let path = site_entry.resolved_output_path();
                if let Some(url) = resolve_site_url(&merged_config.url, path) {
                    merged_config.url = url;
                }
            }

            let path_prefix = if is_default && !ws_config_clone.redirect {
                ""
            } else {
                site_entry.resolved_output_path()
            };

            if let Err(e) = site::build_site_with_config(
                &merged_config,
                &site_input,
                &site_output,
                &cli_clone,
                Some(&cross_site_data),
                path_prefix,
            ) {
                error!("Failed to rebuild site '{}': {e}", site_entry.name);
            }
        }

        if ws_config_clone.redirect {
            if let Some(default_name) = &default_site_name {
                let default_path = ws_config_clone
                    .sites
                    .iter()
                    .find(|s| s.name == *default_name)
                    .map_or(
                        default_name.as_str(),
                        WorkspaceSiteEntry::resolved_output_path,
                    );
                let redirect_html = site::generate_redirect_html(&format!("/{default_path}/"));
                let _ = fs::write(output_root_owned.join("index.html"), redirect_html);
            }
        }

        if let Some(lr) = &live_reload {
            lr.notify_reload();
        }
    }))
}

#[allow(clippy::too_many_arguments)]
fn handle_workspace_watch_serve(
    ws_config: &WorkspaceConfig,
    ws_config_path: &Path,
    workspace_root: &Path,
    output_root: &Path,
    watch: bool,
    serve: bool,
    bind_address: &str,
    cli_args: &Arc<Cli>,
) {
    let live_reload = if watch && serve {
        Some(crate::server::LiveReload::new())
    } else {
        None
    };

    if watch {
        let mut hotwatch = match hotwatch::Hotwatch::new() {
            Ok(hw) => hw,
            Err(e) => {
                error!("Failed to initialize hotwatch: {e}");
                return;
            }
        };

        let rebuild = make_rebuild_fn(
            ws_config,
            workspace_root,
            output_root,
            cli_args,
            live_reload.clone(),
        );

        for site_entry in &ws_config.sites {
            let site_input = workspace_root.join(&site_entry.name);
            let out_folder = output_root.to_path_buf();
            let rebuild_clone = Arc::clone(&rebuild);
            let watch_result = hotwatch.watch(site_input.clone(), move |event: hotwatch::Event| {
                use hotwatch::EventKind;
                match event.kind {
                    EventKind::Create(_) | EventKind::Modify(_) | EventKind::Remove(_) => {
                        let in_output = event.paths.iter().any(|p| {
                            p.starts_with(
                                fs::canonicalize(&out_folder)
                                    .unwrap_or_else(|_| out_folder.clone()),
                            )
                        });
                        if !in_output {
                            if let Ok(rebuild_fn) = rebuild_clone.lock() {
                                rebuild_fn();
                            }
                        }
                    }
                    _ => {}
                }
            });
            if let Err(e) = watch_result {
                error!(
                    "Failed to watch site directory '{}': {e}",
                    site_input.display()
                );
            }
        }

        let ws_config_file = ws_config_path.to_path_buf();
        let rebuild_clone = Arc::clone(&rebuild);
        let watch_result = hotwatch.watch(ws_config_file.clone(), move |event: hotwatch::Event| {
            use hotwatch::EventKind;
            if matches!(event.kind, EventKind::Create(_) | EventKind::Modify(_)) {
                if let Ok(rebuild_fn) = rebuild_clone.lock() {
                    rebuild_fn();
                }
            }
        });
        if let Err(e) = watch_result {
            error!(
                "Failed to watch workspace config '{}': {e}",
                ws_config_file.display()
            );
        }

        info!(
            "Watching for changes in workspace: {}",
            workspace_root.display()
        );

        if serve {
            info!("Starting built-in HTTP server...");
            let ctx = crate::server::ServerContext {
                output_folder: Arc::new(output_root.to_path_buf()),
                input_folder: Arc::new(workspace_root.to_path_buf()),
                config_path: Arc::new(ws_config_path.to_path_buf()),
                enable_toolbar: true,
                watch_enabled: true,
            };
            crate::server::start(bind_address, &ctx, live_reload.as_ref());
        } else {
            loop {
                std::thread::sleep(std::time::Duration::from_secs(1));
            }
        }
    } else if serve {
        info!("Starting built-in HTTP server...");
        let ctx = crate::server::ServerContext {
            output_folder: Arc::new(output_root.to_path_buf()),
            input_folder: Arc::new(workspace_root.to_path_buf()),
            config_path: Arc::new(ws_config_path.to_path_buf()),
            enable_toolbar: true,
            watch_enabled: false,
        };
        crate::server::start(bind_address, &ctx, None);
    }
}

#[cfg(test)]
#[path = "tests/workspace.rs"]
mod tests;