Add your description here
Project description
AsciiDoc Table Width Adjuster
A Python utility that automatically adjusts table column widths in AsciiDoc files based on content.
Description
This tool analyzes tables in AsciiDoc files and automatically calculates appropriate column widths based on the content in each column. It adds a cols attribute to each table with percentage-based column widths, making the tables more readable and properly formatted.
Features
- Automatically detects tables in AsciiDoc files
- Calculates optimal column widths based on content
- Adds percentage-based
colsattribute to tables - Preserves the original file content
Installation
Install via pip
pip install column-width
Usage
Command Line
# Adjust tables in a specific file
column-width path/to/your/file.adoc
# Get help
column-width --help
As a Python Module
from asciidoc_table_width_adjuster import adjust_table_widths
# Adjust tables in a file
adjust_table_widths('path/to/your/file.adoc')
Example
Input file with a table:
|===
|Name |Age |Occupation
|John Smith
|35
|Software Engineer
|Jane Doe
|28
|Data Scientist
|===
Output file with adjusted table:
[cols="40%,20%,40%"]
|===
|Name |Age |Occupation
|John Smith
|35
|Software Engineer
|Jane Doe
|28
|Data Scientist
|===
License
MIT
Author
Puneet Bajaj
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file column_width-0.1.0.tar.gz.
File metadata
- Download URL: column_width-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d082844a54a45a98eaf0d5d7edf0c5ab6f1ff5909711a42ffe37bd7ef1114a78
|
|
| MD5 |
df56d2a2c23a0a636d5e44378a978391
|
|
| BLAKE2b-256 |
969320741fc4d3e652997dc92c16bad0a0d702b72746d82d844891afcc665c69
|
File details
Details for the file column_width-0.1.0-py3-none-any.whl.
File metadata
- Download URL: column_width-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea40cf2fad6bb5f72bd92de97087239b8ff865401d3b1f420a8f372c188cd839
|
|
| MD5 |
e5a0d8196ce0abfddebb26d516c90fac
|
|
| BLAKE2b-256 |
c69a2d0eb9dfda171939eb10d4a641916a3316355ef8e4f368d47c64676ae211
|