two_face/acknowledgement/mod.rs
1//! Contains acknowledgements for embedded data and all of their associated types
2
3mod core_types;
4pub use core_types::{Acknowledgements, License, LicenseType};
5
6impl Acknowledgements {
7 /// Returns all of the acknowledgements specifically for embedded syntax definitions
8 pub fn for_syntaxes(&self) -> &[License] {
9 &self.for_syntaxes
10 }
11
12 /// Returns all of the acknowledgements specifically for embedded theme definitions
13 pub fn for_themes(&self) -> &[License] {
14 &self.for_themes
15 }
16}
17
18/// Returns all the [`Acknowledgements`] for embedded data
19pub fn listing() -> Acknowledgements {
20 syntect::dumps::from_binary(include_bytes!("../../generated/acknowledgements_full.bin",))
21}
22
23/// Returns a link to a page listing acknowledgements for all syntax and theme definitions
24///
25/// Unlike the embedded acknowledgements which only include the licenses which _require_
26/// acknowledgement this listing contains _all_ of the licenses of the syntaxes and themes included
27/// with this crate. All without having to bundle the acknowledgement info into your final binary!
28///
29/// ```
30/// assert_eq!(
31/// two_face::acknowledgement::url(),
32/// "https://github.com/CosmicHorrorDev/two-face/blob/v0.5.1/generated/acknowledgements_full.md"
33/// );
34/// ```
35pub const fn url() -> &'static str {
36 concat!(
37 "https://github.com/CosmicHorrorDev/two-face/blob/v",
38 env!("CARGO_PKG_VERSION"),
39 "/generated/acknowledgements_full.md",
40 )
41}