diff --git a/inc/lektor/config.def b/inc/lektor/config.def index cc6088e91c93140b0774275464f79c5593786ea1..35f43dfd14ea98201121a27713909788f94dd93f 100644 --- a/inc/lektor/config.def +++ b/inc/lektor/config.def @@ -12,9 +12,9 @@ comment("Can be DEBUG, INFO, WARN, ERROR.") value_opt("log", "INFO") /* EXTERNALS */ -comment("All specified programs in this section must exists!") section("externals") -value("mkvpropedit", "/usr/bin/mkvpropedit") +comment("All specified programs in this section must exists!") +value("mkvpropedit", "/usr/bin/mkvpropedit") /* SERVER */ section("server") @@ -35,8 +35,9 @@ value("kara_dir", "/home/kara") value("db_path", "/home/kara/kara.db") /* MODULE: REPO */ -comment("The repo module, here to be able to sync the bakabase with kurisu or any other server, if configured correctly.") section("repo") +comment("The repo module, here to be able to sync the bakabase with kurisu or any") +comment("other server, if configured correctly.") value("obfuscate", "1") value("module", "repo") value("name", "Kurisu") @@ -49,9 +50,10 @@ value("fav_json", "https://kurisu.iiens.net/api/fav/") value("plt_json", "https://kurisu.iiens.net/api/plt/") /* MODULE: PLAYER */ -comment("The player module, so that people can 'sing' when using lektor.") -comment("By default it's sdl, but one can create any module, for audio support only for example.") section("player") +comment("The player module, so that people can 'sing' when using lektor.") +comment("By default it's sdl, but one can create any module, for audio support") +comment("only for example.") value("module", "sdl2") value("autoclear", "true") value("def_random", "false") @@ -61,31 +63,35 @@ value("def_repeat", "false") value("font_size", "20") value("font_name", "Hack Nerd Font") value("msg_duration", "4") -comment("'force_x11' will be used to force libmpv to use the x11 context, may segfault on some PCs...") +value_opt("force_x11", "1") +comment("'force_x11' will be used to force libmpv to use the x11 context,") +comment("may segfault on some PCs...") /* HOOK */ -comment("To place hooks, when some things are done in lektor.") -comment("The default value 'none' is here so that nothing happens.") -comment("Like any module, the value can point to a module or a function in the internal register.") -comment("To specify multiple modules, use a comma separated list, line this:") -comment("`kara_load = print_stdout,print_stderr`.") +section("hook") +comment("To place hooks, when some things are done in lektor. The default value") +comment("'none' is here so that nothing happens. Like any module, the value can") +comment("point to a module or a function in the internal register. To specify") +comment("multiple modules, use a comma separated list, line this:") +comment(" `kara_load = print_stdout,print_stderr`") comment("For the moment, only functions in the server register are supported.") comment("NOTE: All the functions will recieve a va_list as a unique argument.") -section("hook") - -comment("kara_load: Before a kara is loaded to be played, the 'player' module needs to support it") -value("kara_load", "none") - -comment("queue_begin: On play, when the player is not already playing or paused") +value("kara_load", "none") value("queue_begin", "none") +value("launched", "none") -comment("launched: Configuration has been loaded, lektord is not currently listening for clients.") -comment("All the modules needed (player, repo) has been created") -value("launched", "none") +comment("The hooks are the following:") +comment("- kara_load: Before a kara is loaded to be played, the 'player' module") +comment(" needs to support it.") +comment("- queue_begin: On play, when the player is not already playing or paused.") +comment("- launched: Configuration has been loaded, lektord is not currently") +comment(" listening for clients. All the modules needed (player, repo)") +comment(" has been created.") comment("The available hooks are the followings:") -comment(" - none: nothing, the hook is ignored") -comment(" - launch_klkt: launch klkt, note that it will be automatically killed when lektord exits") +comment(" - none: nothing, the hook is ignored") +comment(" - launch_klkt: launch klkt, note that it will be automatically killed") +comment(" when lektord exits") // vi:syntax=c diff --git a/inc/lektor/config.h b/inc/lektor/config.h index 051e1e617104f85c86da00f2e5dd222bc2b6ae3b..cfdb225c6dd8c8cb9e6beadb81d2bcad4d5cb740 100644 --- a/inc/lektor/config.h +++ b/inc/lektor/config.h @@ -13,9 +13,11 @@ struct lkt_state; #define section(sct) "\n[" sct "]\n" #define value(key, val) key " = " val "\n" #define value_opt(key, val) value(key, val) +#define comment(...) "; " __VA_ARGS__ "\n" static const char *const lkt_default_config_file = #include <lektor/config.def> ; +#undef comment #undef value #undef value_opt #undef section