···51515252### Examples
53535454-Examples can be found within the [`examples/`](./examples) directory.
5454+Examples can be found within the
5555+[`examples/`](https://github.com/gemrest/germ/tree/main/examples) directory.
55565657## License
5758
···11-// This file is part of Germ <https://github.com/gemrest/germ>.
22-// Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
33-//
44-// This program is free software: you can redistribute it and/or modify
55-// it under the terms of the GNU General Public License as published by
66-// the Free Software Foundation, version 3.
77-//
88-// This program is distributed in the hope that it will be useful, but
99-// WITHOUT ANY WARRANTY; without even the implied warranty of
1010-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1111-// General Public License for more details.
1212-//
1313-// You should have received a copy of the GNU General Public License
1414-// along with this program. If not, see <http://www.gnu.org/licenses/>.
1515-//
1616-// Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
1717-// SPDX-License-Identifier: GPL-3.0-only
1818-1919-#![deny(
2020- warnings,
2121- nonstandard_style,
2222- unused,
2323- future_incompatible,
2424- rust_2018_idioms,
2525- unsafe_code,
2626- clippy::all,
2727- clippy::nursery,
2828- clippy::pedantic
2929-)]
3030-#![feature(proc_macro_hygiene, proc_macro_span)]
3131-#![recursion_limit = "128"]
3232-3333-use proc_macro::TokenStream;
3434-3535-/// Convert Gemtext into a token tree
3636-///
3737-/// # Panics
3838-///
3939-/// May panic if the Gemini could not be properly handled, for any reason.
4040-#[proc_macro]
4141-pub fn gemini_to_tt(input: TokenStream) -> TokenStream {
4242- let mut tokens = input.into_iter();
4343- let mut span = tokens.next().unwrap().span();
4444-4545- for token in tokens {
4646- span = span.join(token.span()).unwrap();
4747- }
4848-4949- let gemini = span
5050- .source_text()
5151- .unwrap()
5252- .lines()
5353- .map(|l| l.trim_start().to_string())
5454- .collect::<Vec<String>>()
5555- .join("\n");
5656-5757- quote::quote!(#gemini).into()
5858-}