mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-30 04:58:34 -06:00
Community links: Discord button in the title bar, ArtCraft community card on Home, About dialog with ArtCraft mark/wordmark and links, Help menu commands (help.discord/app_page/github/website), CLI --version and MCP websiteUrl, README Community section; 4 Lucide icons (attributed); regenerated screenshots with honest brand attribution
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bb31b5a1b5
commit
2fc7cb4e64
@@ -156,6 +156,10 @@ pub const COMMANDS: &[CommandSpec] = &[
|
||||
c("page.split", "Split document…", PAGES, None, Assembly, "scissors"),
|
||||
c("page.number", "Number pages…", PAGES, None, Assembly, "hash"),
|
||||
c("help.shortcuts", "Keyboard shortcuts", HELP, None, Nothing, "circle-help"),
|
||||
c("help.discord", "Join the ArtCraft Discord", HELP, None, Nothing, "messages-square"),
|
||||
c("help.app_page", "PrintCraft web page", HELP, None, Nothing, "globe"),
|
||||
c("help.github", "PrintCraft on GitHub", HELP, None, Nothing, "code-xml"),
|
||||
c("help.website", "ArtCraft website", HELP, None, Nothing, "external-link"),
|
||||
c("help.about", "About PrintCraft", HELP, None, Nothing, "info"),
|
||||
];
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
pub mod catalog;
|
||||
pub mod commands;
|
||||
pub mod links;
|
||||
|
||||
pub use printcraft_organize::{SplitBy, split_ranges};
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
//! Where PrintCraft and the ArtCraft community live on the web. One table, so the Help menu, the
|
||||
//! About dialog, the home screen, the CLI and the README agree.
|
||||
|
||||
/// The app's name in ArtCraft URLs (`getartcraft.com/apps/{APP}`, `github.com/storytold/{APP}`).
|
||||
pub const APP: &str = "printcraft";
|
||||
|
||||
pub const DISCORD: &str = "https://discord.gg/artcraft";
|
||||
pub const WEBSITE: &str = "https://getartcraft.com";
|
||||
pub const APP_PAGE: &str = "https://getartcraft.com/apps/printcraft";
|
||||
pub const GITHUB: &str = "https://github.com/storytold/printcraft";
|
||||
|
||||
/// A link and the registry command that opens it.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Link {
|
||||
pub command: &'static str,
|
||||
pub label: &'static str,
|
||||
pub url: &'static str,
|
||||
/// Lucide icon name.
|
||||
pub icon: &'static str,
|
||||
}
|
||||
|
||||
/// In the order they are shown. Discord comes first: it is where people get help fastest.
|
||||
pub const LINKS: &[Link] = &[
|
||||
Link { command: "help.discord", label: "Join the ArtCraft Discord", url: DISCORD, icon: "messages-square" },
|
||||
Link { command: "help.app_page", label: "PrintCraft web page", url: APP_PAGE, icon: "globe" },
|
||||
Link { command: "help.github", label: "PrintCraft on GitHub", url: GITHUB, icon: "code-xml" },
|
||||
Link { command: "help.website", label: "ArtCraft website", url: WEBSITE, icon: "external-link" },
|
||||
];
|
||||
|
||||
pub fn for_command(id: &str) -> Option<&'static Link> {
|
||||
LINKS.iter().find(|l| l.command == id)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn urls_follow_the_artcraft_scheme() {
|
||||
assert_eq!(super::APP_PAGE, format!("{}/apps/{}", super::WEBSITE, super::APP));
|
||||
assert_eq!(super::GITHUB, format!("https://github.com/storytold/{}", super::APP));
|
||||
for l in super::LINKS {
|
||||
assert!(l.url.starts_with("https://"), "{}", l.url);
|
||||
assert!(crate::commands::command(l.command).is_some(), "{} is a registered command", l.command);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user