Deploys the NoTeX LaTeX template and fonts onto the system. More...
#include <notex/installer.hpp>
Static Public Member Functions | |
| static bool | install_global (const Environment &environment, bool force=false) |
Installs the template globally, using environment to resolve the target directories inside the TeX tree. | |
| static bool | install_local (const std::filesystem::path &target_dir, bool force=false) |
Installs the template locally into target_dir. | |
| static bool | uninstall_global (const Environment &environment, bool force=false) |
Removes a global installation: every embedded LaTeX and font file's target directory inside environment's TeX tree, then refreshes the TeX filename database (a failure there is downgraded to a warning, as in install_global()). Never touches anything outside those directories. | |
| static bool | uninstall_local (const std::filesystem::path &target_dir, bool force=false) |
Removes a local installation: target_dir's settings/ and fonts/ directories, then clears installation_type in .notex/notex.json if present. Never touches the project's own documents. | |
| static bool | installation_differs (const std::filesystem::path &latex_dir, const std::filesystem::path &fonts_dir) |
Reports whether an installation at latex_dir/ from what would be freshly installed. | |
Deploys the NoTeX LaTeX template and fonts onto the system.
Every method is static: an installation is really about its target directory, not about any state an Installer instance would hold between calls, so instances of this class serve no purpose.
Definition at line 22 of file installer.hpp.
|
static |
Installs the template globally, using environment to resolve the target directories inside the TeX tree.
Writes every embedded LaTeX and font file into the TeX tree, creating intermediate directories as needed, and refreshes the TeX filename database afterwards; a failure to do so is downgraded to a warning rather than propagated, since some environments lack mktexlsr. If a previous installation already exists there and differs from what would be written, the user is asked to confirm before overwriting, unless force is set.
| environment | Resolved TeX environment to install into. |
| force | Skip the confirmation prompt when overwriting a differing installation. |
Definition at line 91 of file installer.cpp.
References notex::assets::font_files(), notex::Environment::global_fonts_dir(), notex::Environment::global_latex_dir(), notex::assets::latex_files(), notex::system::run_command(), notex::Environment::texmf_home(), and notex::ui::warning().
|
static |
Installs the template locally into target_dir.
Writes every embedded LaTeX file into <target_dir>/settings/ and every font into <target_dir>/fonts/, then records the local installation in <target_dir>/.notex/notex.json, creating that directory (with an otherwise-empty configuration) if target_dir is not already a NoTeX project, and preserving its existing configuration if it is.
| target_dir | Directory to install into. |
| force | Skip the confirmation prompt when overwriting a differing installation. |
Definition at line 117 of file installer.cpp.
References notex::Manager::config(), notex::assets::font_files(), notex::ProjectConfig::installation_type, notex::assets::latex_files(), and notex::Manager::write_config().
|
static |
Reports whether an installation at latex_dir/ from what would be freshly installed. fonts_dir differs
Used by checkhealth to note installation drift (e.g. a hand-customised local install) without needing to actually reinstall anything.
| latex_dir | Directory to compare the embedded LaTeX files against. |
| fonts_dir | Directory to compare the embedded font files against. |
latex_dir or fonts_dir. Definition at line 200 of file installer.cpp.
References notex::assets::font_files(), and notex::assets::latex_files().
|
static |
Removes a global installation: every embedded LaTeX and font file's target directory inside environment's TeX tree, then refreshes the TeX filename database (a failure there is downgraded to a warning, as in install_global()). Never touches anything outside those directories.
| environment | Resolved TeX environment to uninstall from. |
| force | Skip the confirmation prompt. |
Definition at line 144 of file installer.cpp.
References notex::ui::confirm(), notex::Environment::global_fonts_dir(), notex::Environment::global_latex_dir(), notex::system::run_command(), notex::Environment::texmf_home(), and notex::ui::warning().
|
static |
Removes a local installation: target_dir's settings/ and fonts/ directories, then clears installation_type in .notex/notex.json if present. Never touches the project's own documents.
| target_dir | Directory to uninstall from. |
| force | Skip the confirmation prompt. |
Definition at line 174 of file installer.cpp.
References notex::Manager::config(), notex::ui::confirm(), notex::ProjectConfig::installation_type, notex::Manager::save(), and notex::ui::warning().