Cleaned up documentation and other performed other code cleanups

This commit is contained in:
isaacST08 2025-02-11 21:14:24 -07:00
commit c3c720f4a2
13 changed files with 343 additions and 213 deletions

View file

@ -9,8 +9,8 @@
# The viewer template
template = import ./viewerTemplate.nix;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) package str listOf;
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
inherit (lib.types) str listOf;
in (
template {
inherit name moduleInheritancePackage;
@ -18,10 +18,8 @@ in (
options = {
enable = mkEnableOption "enable using a custom pdf viewer.";
package = mkOption {
type = package;
example = pkgs.okular;
description = "custom viewer package";
package = mkPackageOption pkgs "okular" {
extraDescription = "custom viewer package";
};
executable = mkOption {
@ -32,7 +30,10 @@ in (
args = mkOption {
type = listOf str;
example = ["--unique" "file:%p#src:%l%f"];
example = [
"--unique"
"file:%p#src:%l%f"
];
description = "Arguments to pass to the viewer.";
};
};

View file

@ -9,8 +9,8 @@
# The viewer template
template = import ./viewerTemplate.nix;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) package str listOf;
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
inherit (lib.types) str listOf;
in (
template {
inherit name moduleInheritancePackage;
@ -18,11 +18,7 @@ in (
options = {
enable = mkEnableOption "enable okular as the pdf file previewer.";
package = mkOption {
type = package;
default = pkgs.okular;
description = "okular package";
};
package = mkPackageOption pkgs "okular" {};
executable = mkOption {
type = str;
@ -32,7 +28,10 @@ in (
args = mkOption {
type = listOf str;
default = ["--unique" "file:%p#src:%l%f"];
default = [
"--unique"
"file:%p#src:%l%f"
];
description = "Arguments to pass to the viewer.";
};
};

View file

@ -9,8 +9,8 @@
# The viewer template
template = import ./viewerTemplate.nix;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) package str listOf;
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
inherit (lib.types) str listOf;
in (
template {
inherit name moduleInheritancePackage;
@ -18,11 +18,7 @@ in (
options = {
enable = mkEnableOption "enable qpdfview as the pdf file previewer.";
package = mkOption {
type = package;
default = pkgs.qpdfview;
description = "qpdfview package";
};
package = mkPackageOption pkgs "qpdfview" {};
executable = mkOption {
type = str;
@ -32,7 +28,10 @@ in (
args = mkOption {
type = listOf str;
default = ["--unique" "%p#src:%f:%l:1"];
default = [
"--unique"
"%p#src:%f:%l:1"
];
description = "Arguments to pass to the viewer.";
};
};

View file

@ -9,20 +9,16 @@
# The viewer template
template = import ./viewerTemplate.nix;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) package str listOf;
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
inherit (lib.types) str listOf;
in (
template {
inherit name moduleInheritancePackage;
options = {
enable = mkEnableOption "enable sioyek as the pdf file previewer.";
enable = mkEnableOption "sioyek as the pdf file previewer.";
package = mkOption {
type = package;
default = pkgs.sioyek;
description = "sioyek package";
};
package = mkPackageOption pkgs "sioyek" {};
executable = mkOption {
type = str;
@ -47,9 +43,9 @@ in (
description = ''
Arguments to pass to the viewer.
By default, this is the only viewer that supports the inverse search feature by
command line arguments and doesn't explicitly require extra tinkering else where
in your config.
By default, this is the only viewer that supports the inverse search
feature by command line arguments and doesn't explicitly require extra
tinkering else where in your config.
'';
};
};

View file

@ -56,7 +56,8 @@ in {
opts)
options;
# Check that the language and this pdf viewer have been enabled before making any config.
# Check that the language and this pdf viewer have been enabled before making
# any config.
config = mkIf (cfg.enable && viewerCfg.enable) {
vim.languages.tex.pdfViewer = {
inherit name;

View file

@ -9,8 +9,8 @@
# The viewer template
template = import ./viewerTemplate.nix;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) package str listOf;
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
inherit (lib.types) str listOf;
in (
template {
inherit name moduleInheritancePackage;
@ -18,11 +18,7 @@ in (
options = {
enable = mkEnableOption "enable zathura as the pdf file previewer.";
package = mkOption {
type = package;
default = pkgs.zathura;
description = "zathura package";
};
package = mkPackageOption pkgs "zathura" {};
executable = mkOption {
type = str;
@ -32,7 +28,11 @@ in (
args = mkOption {
type = listOf str;
default = ["--synctex-forward" "%l:1:%f" "%p"];
default = [
"--synctex-forward"
"%l:1:%f"
"%p"
];
description = "Arguments to pass to the viewer.";
};
};