Xeeg Documentation
website·Indexed 30 days ago
https://mellarchy.github.io/xeeg/docs/introA tool designed to be easily configured for dynamically generating static files for projects. Includes documentation on CLI usage, installation, configuration, and the use of needles for file generation.
What's inside Xeeg
- Xeeg is a cross-platform markup file generator designed to dynamically generate static files for projects. It is built to be easily configured and aims to remove OS and code stack barriers, allowing it to be packaged and executed on any platform to fit specific branding or project requirements.
Xeeg coding style and licensing requirements
When contributing to Xeeg, adhere to the following standards:
- Coding Style: Use 2 spaces for indentation instead of tabs.
- Licensing: All contributions are submitted under the ISC Software License.
Manage Xeeg configuration files
Xeeg uses YAML configuration files to define how files are generated. It supports both a global configuration (shared across the OS) and project-specific configurations (located in the project root).
- Global Config: Generated automatically the first time a file is generated. Use
xeeg where:global-configto find its location. - Project Config: Created by running
xeeg initin the project root. This allows different settings per project. - Active Config: Use
xeeg which:configto identify which configuration file is currently being used for the current directory.
# Find the global config path xeeg where:global-config # Initialize a project-specific config file xeeg init # Check which config is currently active xeeg which:config- Global Config: Generated automatically the first time a file is generated. Use
Install xeeg manually on Windows
Install xeeg on Windows by downloading the.exebinary and adding its location to the system Environment Variables PATH.:: Create the directory md %USERPROFILE%\xeeg :: (Copy the downloaded xeeg.exe to %USERPROFILE%\xeeg\) :: To verify the path: echo %USERPROFILE%\xeeg\xeeg.exeAdding to PATH:
- Run
control sysdm.cplin the terminal. - Go to the Advanced tab $\rightarrow$ Environment Variables...
- Add
%USERPROFILE%\xeeg xeeg.exeto the PATH variable of your account.
- Run
Install xeeg automatically on Linux
You can install xeeg on Linux using an automatic installation script. Note that this method is experimental and has currently only been tested on Ubuntu 20.04.curl https://raw.githubusercontent.com/mellarchy/xeeg/main/xeeg-cli/scripts/linux-auto-installation.sh | sudo bash -s -Install xeeg manually on Linux via .deb package
To install xeeg manually on Linux, download the.debbinary installer from the binary downloads page and install it globally using theaptpackage manager.sudo apt install ./xeeg-0.1.0.debSubmit code changes to Xeeg using GitHub Flow
Xeeg uses GitHub Flow for all code changes. To propose changes to the codebase, follow these steps:
- Fork the repository and create a new branch from
master. - Add tests for any new code.
- Update documentation if APIs were changed.
- Verify that the test suite passes.
- Ensure the code passes linting.
- Submit a pull request.
- Fork the repository and create a new branch from
Build xeeg from source
You can build the xeeg binary locally from source using the Rust toolchain. This requiresrustup(Rust installer) andcargo(Rust build system) to be installed on your system.# Clone the project git clone https://github.com/mellarchy/xeeg # Navigate to the project directory cd xeeg # Build the project in release mode cargo build --releaseInstall xeeg manually on MacOS
Install the xeeg binary on MacOS by placing it in a local bin directory and updating your shell's PATH variable.# Create the bin directory mkdir -p ${HOME}/bin # (Save the xeeg binary to ${HOME}/bin manually) # Make the binary executable chmod 755 ${HOME}/bin/xeeg # Add to shell config file (e.g., .zshrc or .bash_profile) export PATH="${HOME}/bin:${PATH}" # Verify installation command -v xeegDefine templates using stub files in Xeeg
Xeeg uses 'stub files' as templates for generating code. A stub file is a placeholder file containing 'needles'—special strings that Xeeg replaces with formatted versions of a provided input string during the generation process. By default, Xeeg looks for files with the.stubextension, though this can be configured.// Example: ./stubs/action.stub // [NEEDLE_CAMEL], [NEEDLE_PASCAL], [NEEDLE_UPPER_SNAKE], etc., are needles const [NEEDLE_CAMEL]Actions = { fetch[NEEDLE_PASCAL_PLURAL]: (data?) => ({ type: 'FETCH_[NEEDLE_UPPER_SNAKE_PLURAL]', data, }), };Report bugs in Xeeg
Bugs are tracked via GitHub issues. To report a bug, open a new issue at https://github.com/mellarchy/xeeg/issues/new/choose.
For a high-quality bug report, include:
- A quick summary and background.
- Specific steps to reproduce the issue, including sample code that can be run to replicate the behavior.
- The expected outcome versus the actual outcome.
- Any additional notes on potential causes or attempted fixes.
Configure needle replacement keys
Theneedlessection of the configuration file defines the placeholders that Xeeg will find and replace during file generation. You can map a custom key to a specific needle token.needles: needle: "[NEEDLE]" needle_plural: "[NEEDLE_PLURAL]" needle_lower: "[NEEDLE_LOWER]" needle_lower_plural: "[NEEDLE_LOWER_PLURAL]" needle_upper: "[NEEDLE_UPPER]" needle_upper_plural: "[NEEDLE_UPPER_PLURAL]" needle_title: "[NEEDLE_TITLE]" needle_title_plural: "[NEEDLE_TITLE_PLURAL]" needle_upper_spaced: "[NEEDLE_UPPER_SPACED]" needle_upper_plural_spaced: "[NEEDLE_UPPER_PLURAL_SPACED]" needle_lower_spaced: "[NEEDLE_LOWER_SPACED]" needle_lower_plural_spaced: "[NEEDLE_LOWER_PLURAL_SPACED]" needle_pascal: "[NEEDLE_PASCAL]" needle_pascal_plural: "[NEEDLE_PASCAL_PLURAL]" needle_camel: "[NEEDLE_CAMEL]" needle_camel_plural: "[NEEDLE_CAMEL_PLURAL]" needle_upper_camel: "[NEEDLE_UPPER_CAMEL]" needle_upper_camel_plural: "[NEEDLE_UPPER_CAMEL_PLURAL]" needle_snake: "[NEEDLE_SNAKE]" needle_snake_plural: "[NEEDLE_SNAKE_PLURAL]" needle_upper_snake: "[NEEDLE_UPPER_SNAKE]" needle_upper_snake_plural: "[NEEDLE_UPPER_SNAKE_PLURAL]" needle_screaming_snake: "[NEEDLE_SCREAMING_SNAKE]" needle_screaming_snake_plural: "[NEEDLE_SCREAMING_SNAKE_PLURAL]" needle_kebab: "[NEEDLE_KEBAB]" needle_kebab_plural: "[NEEDLE_KEBAB_PLURAL]" needle_cobol: "[NEEDLE_COBOL]" needle_cobol_plural: "[NEEDLE_COBOL_PLURAL]" needle_train: "[NEEDLE_TRAIN]" needle_train_plural: "[NEEDLE_TRAIN_PLURAL]" needle_flat: "[NEEDLE_FLAT]" needle_flat_plural: "[NEEDLE_FLAT_PLURAL]" needle_upper_flat: "[NEEDLE_UPPER_FLAT]" needle_upper_flat_plural: "[NEEDLE_UPPER_FLAT_PLURAL]"