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/// Available without having to bundle all of the acknowledgement info in your binary
26///
27/// ```
28/// assert_eq!(
29/// two_face::acknowledgement::url(),
30/// "https://github.com/CosmicHorrorDev/two-face/blob/v0.4.5/generated/acknowledgements_full.md"
31/// );
32/// ```
33pub const fn url() -> &'static str {
34 concat!(
35 "https://github.com/CosmicHorrorDev/two-face/blob/v",
36 env!("CARGO_PKG_VERSION"),
37 "/generated/acknowledgements_full.md",
38 )
39}