Dispositio - Résumé du Projet Shell POSIX
Dispositio is a POSIX-compliant shell script designed for displaying tabular data from CSV, JSON, and YAML files in the terminal. It offers advanced formatting, color support, and can be used as a standalone command-line tool or as a shell library for programmatic table generation. Key features include multiple input/output formats (Terminal, Markdown, Textile), rich terminal output with customizable alignment and styling, header support, and intelligent color mixing. It depends on jq
, yq
, and auxilium.sh
.
Fonctionnalités - Script Shell Données Tabulaires
Multiple Input Formats
Support for CSV, JSON, and YAML files.
Library Usage
Can be sourced and used programmatically with dispositio_add_*
functions.
Colorized Output
Colored table output with customizable alignment options.
Output Formats
Terminal display, Markdown (with CSS, not for Github) and Textile (Redmine) output formats.
Advanced Formatting
- Multi-line cell content support
- Column and row color customization
- Text alignment (left, center, right)
- Vertical alignment (top, center, bottom)
- Text styling (bold, italic, underline)
Header Support
Optional header processing for CSV files.
Color Mixing
Intelligent color combination for row and column intersections.
POSIX Compliance
Works across different Unix-like systems.
Installation Dispositio - Script Shell POSIX
$ # Ensure you have the required dependencies: $ # jq for JSON processing $ # yq for YAML processing $ # auxilium.sh library (should be available at /usr/share/auxilium/auxilium.sh) $ # Download from: https://codeberg.org/spn109/auxilium $ $ # Make the script executable: $ chmod +x dispositio.sh $ $ # Optionally, create a symlink or copy to a directory in your PATH: $ ln -s /path/to/dispositio.sh /usr/local/bin/dispositio
Utilisation - Guide Dispositio Shell
Command Line Usage
Basic Usage
$ ./dispositio.sh [OPTIONS]
Command Line Options
-H, --with_header
: Treat the first line of CSV as column headers-s, --noseparate
: Disable separator lines between rows-m, --markdown
: Output in Markdown format-t, --textile
: Output in Textile formatfile
: Input file path (required)
Examples
Display a CSV file with headers
$ ./dispositio.sh -H examples/example.csv
Export to Markdown format
$ ./dispositio.sh -m examples/example.json > output.md
Display a YAML file
$ ./dispositio.sh examples/example.yml
Library Usage
Dispositio can be sourced and used as a library to programmatically create tables in your shell scripts.
Basic Library Setup
#!/bin/bash # Source the dispositio library . ./dispositio.sh # Initialize dispositio dispositio_init # Create your table programmatically # ... (see examples below) # Clean up dispositio_close