refactor(derive-ahk): push up generation logic

This commit pushes as much of the generation logic as possible to the
derive-ahk crate, so that when it is used in komorebic, we only need to
do an as_bytes() call to prepare it for being written to a file.

Besides that, this commit changes the generation command name to
'ahk-library' for clarity, and adds both additional samples and
instructions in the readme file and Scoop post-install hook.
This commit is contained in:
LGUG2Z
2021-08-23 07:49:34 -07:00
parent 2c876701d8
commit a02cd699a0
6 changed files with 238 additions and 17 deletions

View File

@@ -83,13 +83,12 @@ pub fn ahk(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
quote! {
impl #name {
fn ahk_functions() -> Vec<String> {
let mut v: Vec<String> = vec![];
v.push(String::from("; Generated by komorebic.exe ahk-lib"));
fn generate_ahk_library() -> String {
let mut v: Vec<String> = vec![String::from("; Generated by komorebic.exe")];
#stream
v
v.join("\n")
}
}
}