Format codebase in documentation 🦤

Related tags

Command-line gelatyx
Overview

Gelatyx

Format codebase in documentation 🦤

Build status Sponsor me

Features

  • Format language code block inside documentation files
  • Check mode. Ask Gelatyx is the documentation has been formatted.
  • Glob support.
  • Configure the formatter via configuration file.
  • Supported languages

Usage

Usage Examples

$ gelatyx lua --file input.md                                 Format a file with lua formatter
$ gelatyx lua --file *.md                                     Format multiple files ...
$ gelatyx lua --file input.md --check                         Check if the docs has been formatted.
$ gelatyx lua --file input.md --language-config config.toml   Configure the formatter.

Command-line options

gelatyx [version] 
Gelatyx 🦤.

            Format codebease inside the docs

USAGE:
    gelatyx [OPTIONS] --file <file>... <LANGUAGE>

ARGS:
    <LANGUAGE>    Language used in code block. [possible values: lua]

OPTIONS:
    -f, --file <file>...    File(s) to format.
        --color <color>     When to use colors (*auto*, never, always). [default: auto] [possible
                            values: auto, never, always]
        --check             Check if the docs has been formatted.
        --language-config <language-config> Specify an alternate configuration file
    -h, --help              Print help information
    -V, --version           Print version information

Note: `gelatyx -h` prints a short and concise overview while `gelatyx --help` gives all details.

If you like gelatyx to support your favorite language, feel free to open new issue.

Installation

From binaries

The release page includes pre-compiled binaries for GNU/Linux, macOS and Windows.

From source

Using Rust's package manager cargo:

$ cargo install gelatyx

Development

$ clone the repository 

$ # Run unit tests and integration tests
$ cargo test

$ # Install
$ cargo install --path .

Origin of the name

The name Gelatyx is a played version of Gelatik. A beautiful bird from Indonesia.

Credits

You might also like...
⚗️ Superfast CLI interface for the conventional commits commit format
⚗️ Superfast CLI interface for the conventional commits commit format

resin ⚗️ Superfast CLI interface for the conventional commits commit format ❓ What is resin? resin is a CLI (command-line interface) tool that makes i

⚗️ Superfast CLI interface for the conventional commits commit format
⚗️ Superfast CLI interface for the conventional commits commit format

resin ⚗️ Superfast CLI interface for the conventional commits commit format ❓ What is resin? resin is a CLI (command-line interface) tool that makes i

Crate to generate files in ROFF format (Rust)

roffman A crate to generate roff man pages. Usage Add the following to the Cargo.toml: [dependencies] roffman = "0.3" Example use roffman::{Roff, Roff

CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a plotable format.

Lighthouse Aggregator CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" f

Single File Assets is a file storage format for images

SFA (Rust) Single File Assets is a file storage format for images. The packed images are not guaranteed to be of same format because the format while

CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.
CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.

run_clang_format CLI application for running clang-format for an existing .clang-format file on a set of files, specified using globs in a .json confi

A low-level MVCC file format for storing blobs.

Sediment This repository isn't ready for public consumption. It just reached a stage where I wanted to start sharing ideas with others as well as usin

Databento Binary Encoding (DBZ) - Fast message encoding and storage format for market data

dbz A library (dbz-lib) and CLI tool (dbz-cli) for working with Databento Binary Encoding (DBZ) files. Python bindings for dbz-lib are provided in the

UniSBOM is a tool to build a software bill of materials on any platform with a unified data format.

UniSBOM is a tool to build a software bill of materials on any platform with a unified data format. Work in progress Support MacOS Uses system_profile

Comments
  • --check fails in some cases after formatting

    --check fails in some cases after formatting

    gelatyx lua --file $tracked_markdown --language-config ci/stylua.toml
    gelatyx lua --file $tracked_markdown --language-config ci/stylua.toml --check || exit 1
    

    outputs:

    ...
    Skipping docs/contributing.md
    Formatting docs/copymode.md
    Skipping docs/escape-sequences.md
    ...
    docs/contributing.md is formatted
    docs/copymode.md is unformatted
    docs/escape-sequences.md is formatted
    

    and then exits with status 1.

    Running gelatyx a second time without passing --check will perform another pass of formatting and satisfy the check.

    The first run does apply some formatting. The second run applies an additional diff on top.

    It feels non-deterministic if the instruction to format doesn't satisfy --check.

    opened by wez 1
  • error output is confusing when multiple files are being processed

    error output is confusing when multiple files are being processed

    It's unclear which file the error belongs to; could you explicitly put the filename in the context? In addition, I think it would be helpful to also print the snippet that is being formatted, as there could be a number of similar snippets in any given file

    docs/config/lua/wezterm/config_file.md is formatted
    error parsing: error occurred while creating ast: unexpected token `{`. (starting from line 1, character 1 and ending on line 1, character 2)
    additional information: leftover token
    docs/config/lua/wezterm/default_wsl_domains.md is formatted
    
    opened by wez 2
Owner
azzamsa
I love solving hard things to make people live happily
azzamsa
Codemod - Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention

Codemod - Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention. Codemod was developed at Facebook and released as open source.

Meta Archive 4k Dec 29, 2022
Ethereum transaction simulator leveraging Foundry's codebase

Enso Transaction ?? Simulator ?? A simple API which simulates a given transaction request. ?? API ?? POST /api/v1/simulate Simulates a single transact

null 162 Jun 4, 2023
Local-first high performance codebase index engine designed for AI

CodeIndex CodeIndex is a local-first high performance codebase index engine designed for AI. It helps your LLM understand the structure and semantics

Jipiti AI 9 Aug 30, 2023
Sensorial System's Stable Diffusion codebase

Stable Diffusion XL LoRA Trainer Welcome to the official codebase for the Sensorial System's Stable Diffusion projects. For now, this only hosts the c

null 8 Mar 2, 2024
Tight Model format is a lossy 3D model format focused on reducing file size as much as posible without decreasing visual quality of the viewed model or read speeds.

What is Tight Model Format The main goal of the tmf project is to provide a way to save 3D game assets compressed in such a way, that there are no not

null 59 Mar 6, 2023
Given a set of kmers (fasta format) and a set of sequences (fasta format), this tool will extract the sequences containing the kmers.

Kmer2sequences Description Given a set of kmers (fasta / fastq [.gz] format) and a set of sequences (fasta / fastq [.gz] format), this tool will extra

Pierre Peterlongo 22 Sep 16, 2023
WIP GUI for NixOS documentation + configuration

nixos-druid Highly experimental GUI for NixOS. For now I expect to frequently make large changes and break stuff whenever I'm working on this. Screens

Sybrand Aarnoutse 6 Aug 23, 2022
Simple, omniglot, markdown-based literate programming and living documentation

Betwixt Simple, markdown-based, polyglot literate programming and documentation tests. Read code between the lines Summary Betwixt is heavily inspired

Zach 3 Dec 15, 2022
A CLI tool you can pipe code and then ask for changes, add documentation, etc, using the OpenAI API.

AiBro This is your own little coding bro, immersed in the world of AI, crypto, and all other types of over hyped tech trends. You can pipe it code and

Josh Bainbridge 5 Sep 5, 2023
The official documentation for Njord.

Docs The docs for Njord using mdBook. Not being used yet, will update this later. We refer to the API docs for now and examples. Contributors The foll

Njord 4 Dec 16, 2023