Xeeg Documentation

website·Indexed 30 days ago

https://mellarchy.github.io/xeeg/docs/intro

A 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.

Tokens
2.8K
Snippets
16
Records
20
Agent score
75%

What's inside Xeeg

  1. Overview of Xeeg static file generation

    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.
  2. 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.
  3. 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-config to find its location.
    • Project Config: Created by running xeeg init in the project root. This allows different settings per project.
    • Active Config: Use xeeg which:config to 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
  4. Install xeeg manually on Windows

    Install xeeg on Windows by downloading the .exe binary 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.exe

    Adding to PATH:

    1. Run control sysdm.cpl in the terminal.
    2. Go to the Advanced tab $\rightarrow$ Environment Variables...
    3. Add %USERPROFILE%\xeeg xeeg.exe to the PATH variable of your account.
  5. 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 -
  6. Submit code changes to Xeeg using GitHub Flow

    Xeeg uses GitHub Flow for all code changes. To propose changes to the codebase, follow these steps:

    1. Fork the repository and create a new branch from master.
    2. Add tests for any new code.
    3. Update documentation if APIs were changed.
    4. Verify that the test suite passes.
    5. Ensure the code passes linting.
    6. Submit a pull request.
  7. Build xeeg from source

    You can build the xeeg binary locally from source using the Rust toolchain. This requires rustup (Rust installer) and cargo (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 --release
  8. Install 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 xeeg
  9. Define 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 .stub extension, 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,
        }),
    };
  10. Configure needle replacement keys

    The needles section 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]"