docalign 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docalign-0.1.0/.bumpversion.cfg +8 -0
- docalign-0.1.0/.changelog/.gitkeep +0 -0
- docalign-0.1.0/.github/workflows/callable-ci.yml +39 -0
- docalign-0.1.0/.github/workflows/prs.yml +8 -0
- docalign-0.1.0/.github/workflows/push-to-main.yml +9 -0
- docalign-0.1.0/.github/workflows/release.yml +62 -0
- docalign-0.1.0/.gitignore +7 -0
- docalign-0.1.0/CHANGELOG.md +62 -0
- docalign-0.1.0/LICENSE +21 -0
- docalign-0.1.0/Makefile +22 -0
- docalign-0.1.0/PKG-INFO +188 -0
- docalign-0.1.0/README.md +175 -0
- docalign-0.1.0/docs/architecture.md +188 -0
- docalign-0.1.0/docs/cicd.md +79 -0
- docalign-0.1.0/docs/concepts.md +147 -0
- docalign-0.1.0/docs/features/arrow-alignment.md +71 -0
- docalign-0.1.0/docs/features/box-wall-checking.md +96 -0
- docalign-0.1.0/docs/features/box-width-normalization.md +74 -0
- docalign-0.1.0/docs/features/pipe-continuity.md +69 -0
- docalign-0.1.0/docs/features/rail-alignment.md +88 -0
- docalign-0.1.0/docs/features/table-alignment.md +63 -0
- docalign-0.1.0/docs/guides/cli-usage.md +130 -0
- docalign-0.1.0/docs/guides/releasing.md +53 -0
- docalign-0.1.0/docs/guides/testing-strategy.md +97 -0
- docalign-0.1.0/docs/overview.md +57 -0
- docalign-0.1.0/docs/repo.md +91 -0
- docalign-0.1.0/docs/rules.md +93 -0
- docalign-0.1.0/pyproject.toml +48 -0
- docalign-0.1.0/src/docalign/__init__.py +2 -0
- docalign-0.1.0/src/docalign/checks/__init__.py +0 -0
- docalign-0.1.0/src/docalign/checks/arrows.py +100 -0
- docalign-0.1.0/src/docalign/checks/box_padding.py +117 -0
- docalign-0.1.0/src/docalign/checks/box_spacing.py +213 -0
- docalign-0.1.0/src/docalign/checks/box_walls.py +249 -0
- docalign-0.1.0/src/docalign/checks/box_widths.py +140 -0
- docalign-0.1.0/src/docalign/checks/def_lists.py +99 -0
- docalign-0.1.0/src/docalign/checks/horiz_arrows.py +122 -0
- docalign-0.1.0/src/docalign/checks/list_descs.py +60 -0
- docalign-0.1.0/src/docalign/checks/pipes.py +90 -0
- docalign-0.1.0/src/docalign/checks/rails.py +459 -0
- docalign-0.1.0/src/docalign/checks/tables.py +91 -0
- docalign-0.1.0/src/docalign/checks/wide_chars.py +31 -0
- docalign-0.1.0/src/docalign/cli.py +273 -0
- docalign-0.1.0/src/docalign/constants.py +37 -0
- docalign-0.1.0/src/docalign/hints.py +82 -0
- docalign-0.1.0/src/docalign/parser.py +46 -0
- docalign-0.1.0/src/docalign/py.typed +0 -0
- docalign-0.1.0/src/docalign/utils.py +200 -0
- docalign-0.1.0/tests/fixtures/all-checks/expected.md +292 -0
- docalign-0.1.0/tests/fixtures/all-checks/input.md +292 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/01-v-arrow-shift/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/01-v-arrow-shift/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/02-fp-arrow-in-text/expected.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/02-fp-arrow-in-text/input.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/03-fp-already-aligned/expected.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/03-fp-already-aligned/input.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/04-embedded-arrow-in-border/check_only +0 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/04-embedded-arrow-in-border/expected.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/04-embedded-arrow-in-border/input.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/05-fp-no-embedded-arrow/expected.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/05-fp-no-embedded-arrow/input.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/06-embedded-horiz-arrow-in-border/check_only +0 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/06-embedded-horiz-arrow-in-border/expected.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/06-embedded-horiz-arrow-in-border/input.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/07-fp-no-embedded-horiz-arrow/expected.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/arrows/07-fp-no-embedded-horiz-arrow/input.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/01-inconsistent-pad/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/01-inconsistent-pad/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/02-fp-consistent/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/02-fp-consistent/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/03-nested-boxes/expected.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/03-nested-boxes/input.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/04-fp-layout-intent/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/04-fp-layout-intent/input.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/05-fp-single-content-line/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/05-fp-single-content-line/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/06-fp-tight-box/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-padding/06-fp-tight-box/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-spacing/01-content-touching-wall/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-spacing/01-content-touching-wall/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-spacing/01-fp-side-by-side-nested/check_only +0 -0
- docalign-0.1.0/tests/fixtures/checks/box-spacing/01-fp-side-by-side-nested/expected.md +16 -0
- docalign-0.1.0/tests/fixtures/checks/box-spacing/01-fp-side-by-side-nested/input.md +16 -0
- docalign-0.1.0/tests/fixtures/checks/box-spacing/02-fp-padded/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-spacing/02-fp-padded/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/01-short-wall/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/01-short-wall/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/02-inner-displaced/expected.md +11 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/02-inner-displaced/input.md +11 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/03-nested-cascade/expected.md +11 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/03-nested-cascade/input.md +11 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/04-fp-aligned-walls/expected.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/04-fp-aligned-walls/input.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/05-displaced-closing-row/expected.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/05-displaced-closing-row/input.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/06-fp-adjacent-boxes-aligned/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/06-fp-adjacent-boxes-aligned/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/07-displaced-closing-row-right/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-walls/07-displaced-closing-row-right/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/01-trailing-space/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/01-trailing-space/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/02-border-vs-content/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/02-border-vs-content/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/03-fp-consistent-width/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/03-fp-consistent-width/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/04-fp-annotation-after-box/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/04-fp-annotation-after-box/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/05-trailing-spaces-after-box/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/05-trailing-spaces-after-box/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/06-fp-consistent-trailing-spaces/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/06-fp-consistent-trailing-spaces/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/07-trailing-whitespace-after-fix/expected.md +15 -0
- docalign-0.1.0/tests/fixtures/checks/box-widths/07-trailing-whitespace-after-fix/input.md +15 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/01-basic/expected.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/01-basic/input.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/02-fp-single-item/expected.md +2 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/02-fp-single-item/input.md +2 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/03-fp-url-in-value/expected.md +3 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/03-fp-url-in-value/input.md +3 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/04-multiple-groups/expected.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/04-multiple-groups/input.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/05-indented-keys/expected.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/05-indented-keys/input.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/06-fp-inside-code-block/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/06-fp-inside-code-block/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/07-multi-word-keys/expected.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/07-multi-word-keys/input.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/08-fp-embedded-in-list/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/def-lists/08-fp-embedded-in-list/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/01-right-gap/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/01-right-gap/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/02-left-gap/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/02-left-gap/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/03-fp-touching/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/03-fp-touching/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/04-both-directions/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/04-both-directions/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/05-multiple-arrows/expected.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/05-multiple-arrows/input.md +9 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/06-fp-no-box-wall/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/06-fp-no-box-wall/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/07-fp-floating-arrow/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/horiz-arrows/07-fp-floating-arrow/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/01-basic/expected.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/01-basic/input.md +8 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/02-fp-single-item/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/02-fp-single-item/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/03-fp-hyphenated-words/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/03-fp-hyphenated-words/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/04-fp-non-consecutive/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/04-fp-non-consecutive/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/05-fp-inside-code-block/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/list-descs/05-fp-inside-code-block/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/pipes/01-pipe-drift/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/pipes/01-pipe-drift/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/pipes/02-fp-aligned-pipes/expected.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/pipes/02-fp-aligned-pipes/input.md +10 -0
- docalign-0.1.0/tests/fixtures/checks/rails/01-column-drift/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/rails/01-column-drift/input.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/rails/02-fp-aligned-rails/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/rails/02-fp-aligned-rails/input.md +5 -0
- docalign-0.1.0/tests/fixtures/checks/rails/03-multi-box-arrows/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/rails/03-multi-box-arrows/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/rails/04-connector-rail-drift/expected.md +13 -0
- docalign-0.1.0/tests/fixtures/checks/rails/04-connector-rail-drift/input.md +13 -0
- docalign-0.1.0/tests/fixtures/checks/rails/05-inner-box-passthrough-drift/expected.md +15 -0
- docalign-0.1.0/tests/fixtures/checks/rails/05-inner-box-passthrough-drift/input.md +15 -0
- docalign-0.1.0/tests/fixtures/checks/tables/01-col-mismatch/expected.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/tables/01-col-mismatch/input.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/tables/02-fp-aligned-table/expected.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/tables/02-fp-aligned-table/input.md +4 -0
- docalign-0.1.0/tests/fixtures/checks/tables/03-fp-pipe-in-text/expected.md +3 -0
- docalign-0.1.0/tests/fixtures/checks/tables/03-fp-pipe-in-text/input.md +3 -0
- docalign-0.1.0/tests/fixtures/checks/tables/04-pipe-in-backticks/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/tables/04-pipe-in-backticks/input.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/tables/05-multiple-pipes-in-backticks/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/tables/05-multiple-pipes-in-backticks/input.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/tables/06-pipes-in-multiple-columns/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/tables/06-pipes-in-multiple-columns/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/tables/07-fp-aligned-pipes-in-backticks/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/tables/07-fp-aligned-pipes-in-backticks/input.md +7 -0
- docalign-0.1.0/tests/fixtures/checks/wide-chars/01-wide-chars-in-diagram/check_only +0 -0
- docalign-0.1.0/tests/fixtures/checks/wide-chars/01-wide-chars-in-diagram/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/wide-chars/01-wide-chars-in-diagram/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/wide-chars/02-fp-no-wide-chars/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/wide-chars/02-fp-no-wide-chars/input.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/wide-chars/03-fp-safe-box-chars/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/checks/wide-chars/03-fp-safe-box-chars/input.md +6 -0
- docalign-0.1.0/tests/fixtures/general/deploy/01-pipeline-with-merge/expected.md +15 -0
- docalign-0.1.0/tests/fixtures/general/deploy/01-pipeline-with-merge/input.md +15 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/01-empty-file/expected.md +0 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/01-empty-file/input.md +0 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/02-no-code-blocks/expected.md +8 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/02-no-code-blocks/input.md +8 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/03-unclosed-code-block/expected.md +8 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/03-unclosed-code-block/input.md +8 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/04-unicode-in-box/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/04-unicode-in-box/input.md +5 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/05-empty-code-block/expected.md +2 -0
- docalign-0.1.0/tests/fixtures/general/edge-cases/05-empty-code-block/input.md +2 -0
- docalign-0.1.0/tests/fixtures/general/mixed/01-multi-issue/expected.md +10 -0
- docalign-0.1.0/tests/fixtures/general/mixed/01-multi-issue/input.md +10 -0
- docalign-0.1.0/tests/fixtures/general/multi-column/01-sequence-diagram/expected.md +13 -0
- docalign-0.1.0/tests/fixtures/general/multi-column/01-sequence-diagram/input.md +13 -0
- docalign-0.1.0/tests/fixtures/general/multi-column/02-branching-flow/expected.md +12 -0
- docalign-0.1.0/tests/fixtures/general/multi-column/02-branching-flow/input.md +12 -0
- docalign-0.1.0/tests/fixtures/general/nested/01-deep-nested/expected.md +20 -0
- docalign-0.1.0/tests/fixtures/general/nested/01-deep-nested/input.md +20 -0
- docalign-0.1.0/tests/fixtures/general/nested/02-tree-inside-box/expected.md +16 -0
- docalign-0.1.0/tests/fixtures/general/nested/02-tree-inside-box/input.md +16 -0
- docalign-0.1.0/tests/fixtures/general/nested/03-inner-box-left-padding/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/general/nested/03-inner-box-left-padding/input.md +6 -0
- docalign-0.1.0/tests/fixtures/general/nested/04-left-padding-with-connectors/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/general/nested/04-left-padding-with-connectors/input.md +6 -0
- docalign-0.1.0/tests/fixtures/general/nested/05-nested-box-expansion/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/general/nested/05-nested-box-expansion/input.md +7 -0
- docalign-0.1.0/tests/fixtures/general/nested/06-multi-box-same-line/expected.md +5 -0
- docalign-0.1.0/tests/fixtures/general/nested/06-multi-box-same-line/input.md +5 -0
- docalign-0.1.0/tests/fixtures/general/nested/07-complex-nested/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/general/nested/07-complex-nested/input.md +7 -0
- docalign-0.1.0/tests/fixtures/general/nested/09-multi-box-with-connectors/expected.md +7 -0
- docalign-0.1.0/tests/fixtures/general/nested/09-multi-box-with-connectors/input.md +7 -0
- docalign-0.1.0/tests/fixtures/general/nested/11-parent-child-connector-alignment/expected.md +11 -0
- docalign-0.1.0/tests/fixtures/general/nested/11-parent-child-connector-alignment/input.md +11 -0
- docalign-0.1.0/tests/fixtures/general/trees/01-schema-tree/expected.md +6 -0
- docalign-0.1.0/tests/fixtures/general/trees/01-schema-tree/input.md +6 -0
- docalign-0.1.0/tests/fixtures/general/trees/02-flow-tree/expected.md +10 -0
- docalign-0.1.0/tests/fixtures/general/trees/02-flow-tree/input.md +10 -0
- docalign-0.1.0/tests/test_align.py +44 -0
- docalign-0.1.0/tests/test_hints.py +84 -0
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
check:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
|
+
- uses: actions/setup-python@v5
|
|
12
|
+
with:
|
|
13
|
+
python-version: "3.12"
|
|
14
|
+
- run: pip install -e ".[dev]"
|
|
15
|
+
- run: ruff check .
|
|
16
|
+
- run: ruff format --check .
|
|
17
|
+
|
|
18
|
+
practical-test:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
- run: pip install -e ".[dev]"
|
|
26
|
+
- run: docalign --check docs/
|
|
27
|
+
|
|
28
|
+
test:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
strategy:
|
|
31
|
+
matrix:
|
|
32
|
+
python-version: ["3.9", "3.12"]
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
- uses: actions/setup-python@v5
|
|
36
|
+
with:
|
|
37
|
+
python-version: ${{ matrix.python-version }}
|
|
38
|
+
- run: pip install -e ".[dev]"
|
|
39
|
+
- run: pytest -v
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
bump:
|
|
7
|
+
description: "Version bump type"
|
|
8
|
+
required: true
|
|
9
|
+
type: choice
|
|
10
|
+
options:
|
|
11
|
+
- patch
|
|
12
|
+
- minor
|
|
13
|
+
- major
|
|
14
|
+
- initial
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
id-token: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
release:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
environment: pypi
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: "3.12"
|
|
32
|
+
|
|
33
|
+
- run: pip install bump2version towncrier hatch
|
|
34
|
+
|
|
35
|
+
- name: Configure git
|
|
36
|
+
run: |
|
|
37
|
+
git config user.name "github-actions[bot]"
|
|
38
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
39
|
+
|
|
40
|
+
- name: Bump version
|
|
41
|
+
if: inputs.bump != 'initial'
|
|
42
|
+
run: bump2version ${{ inputs.bump }}
|
|
43
|
+
|
|
44
|
+
- name: Read new version
|
|
45
|
+
id: version
|
|
46
|
+
run: echo "version=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")" >> "$GITHUB_OUTPUT"
|
|
47
|
+
|
|
48
|
+
- name: Build changelog
|
|
49
|
+
run: towncrier build --yes --version ${{ steps.version.outputs.version }}
|
|
50
|
+
|
|
51
|
+
- name: Commit and tag
|
|
52
|
+
run: |
|
|
53
|
+
git add -A
|
|
54
|
+
git commit -m "chore: release v${{ steps.version.outputs.version }}"
|
|
55
|
+
git tag "v${{ steps.version.outputs.version }}"
|
|
56
|
+
git push origin main --tags
|
|
57
|
+
|
|
58
|
+
- name: Build
|
|
59
|
+
run: hatch build
|
|
60
|
+
|
|
61
|
+
- name: Publish to PyPI
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
## 0.1.0 (2026-02-18)
|
|
2
|
+
|
|
3
|
+
No significant changes.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 0.3.3 (2026-02-17)
|
|
7
|
+
|
|
8
|
+
No significant changes.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## 0.3.2 (2026-02-16)
|
|
12
|
+
|
|
13
|
+
No significant changes.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 0.3.1 (2026-02-16)
|
|
17
|
+
|
|
18
|
+
No significant changes.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## 0.3.0 (2026-02-16)
|
|
22
|
+
|
|
23
|
+
No significant changes.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 0.2.4 (2026-02-15)
|
|
27
|
+
|
|
28
|
+
No significant changes.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## 0.2.3 (2026-02-15)
|
|
32
|
+
|
|
33
|
+
No significant changes.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## 0.2.2 (2026-02-15)
|
|
37
|
+
|
|
38
|
+
No significant changes.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## 0.2.1 (2026-02-15)
|
|
42
|
+
|
|
43
|
+
No significant changes.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 0.2.0 (2026-02-15)
|
|
47
|
+
|
|
48
|
+
No significant changes.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## 0.1.1 (2026-02-12)
|
|
52
|
+
|
|
53
|
+
### Misc
|
|
54
|
+
|
|
55
|
+
- Add README as PyPI project description (add-readme-to-pypi)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 0.1.0 (2026-02-12)
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
- Initial release with CLI support for auto-fixing markdown table alignment (initial-release)
|
docalign-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Lucas Vieira
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
docalign-0.1.0/Makefile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
install:
|
|
2
|
+
python3 -m venv .venv
|
|
3
|
+
.venv/bin/pip install -e ".[dev]"
|
|
4
|
+
|
|
5
|
+
check:
|
|
6
|
+
.venv/bin/ruff check .
|
|
7
|
+
.venv/bin/ruff format --check .
|
|
8
|
+
|
|
9
|
+
test:
|
|
10
|
+
.venv/bin/pytest -v
|
|
11
|
+
|
|
12
|
+
test-all-checks:
|
|
13
|
+
.venv/bin/pytest -v -k "all-checks"
|
|
14
|
+
|
|
15
|
+
practical-test:
|
|
16
|
+
.venv/bin/docalign docs/ --fix
|
|
17
|
+
|
|
18
|
+
changelog:
|
|
19
|
+
.venv/bin/towncrier build --yes --version $(shell python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
20
|
+
|
|
21
|
+
changelog-draft:
|
|
22
|
+
.venv/bin/towncrier build --draft --version $(shell python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
docalign-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docalign
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Auto-fix alignment in markdown docs
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Provides-Extra: dev
|
|
8
|
+
Requires-Dist: bump2version>=1; extra == 'dev'
|
|
9
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
10
|
+
Requires-Dist: ruff>=0.9; extra == 'dev'
|
|
11
|
+
Requires-Dist: towncrier>=23; extra == 'dev'
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# Overview
|
|
15
|
+
|
|
16
|
+
CLI utility that auto-fixes alignment issues in markdown documentation files - tables, box-drawing diagrams, list descriptions, and more.
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
┌────────────────────────┐ ┌────────────────────────┐
|
|
20
|
+
│ ┌────┐ ┌────┐ │ │ ┌────┐ ┌────┐ │
|
|
21
|
+
│ │ A │ │ B │ │ │ │ A │ │ B │ │
|
|
22
|
+
│ └──┬─┘ └──┬─┘ │ │ └──┬─┘ └──┬─┘ │
|
|
23
|
+
│ │ │ │ │ │ │ │
|
|
24
|
+
│ └────┬───┘ │ --> │ └────┬───┘ │
|
|
25
|
+
│ v │ │ v │
|
|
26
|
+
│ ┌──────┐ │ │ ┌──────┐ │
|
|
27
|
+
│ │ C │ │ │ │ C │ │
|
|
28
|
+
│ └──────┘ │ │ └──────┘ │
|
|
29
|
+
└────────────────────────┘ └────────────────────────┘
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
<details>
|
|
33
|
+
<summary>More examples</summary>
|
|
34
|
+
|
|
35
|
+
### [Tables](tests/fixtures/checks/tables)
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
| Service | Usage | | Service | Usage |
|
|
39
|
+
|----------------|-------------------------------| |----------------|-------------------------------|
|
|
40
|
+
| Linear API | Status transitions, comments| --> | Linear API | Status transitions, comments |
|
|
41
|
+
| GitHub API| Repo clone, PR creation | | GitHub API | Repo clone, PR creation |
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### [List descriptions](tests/fixtures/checks/list-descs)
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
- docs/repo.md - mirrors CI steps - docs/repo.md - mirrors CI steps
|
|
48
|
+
- docs/guides/testing-strategy.md - test suite --> - docs/guides/testing-strategy.md - test suite
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### [Box widths](tests/fixtures/checks/box-widths)
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
┌──────────────┐ ┌──────────────┐
|
|
55
|
+
│ Linear UI │ --> │ Linear UI │
|
|
56
|
+
│ (userscript)│ │ (userscript)│
|
|
57
|
+
└──────────────┘ └──────────────┘
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### [Rail alignment](tests/fixtures/checks/rails)
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
┌──────┬──────┐ ┌──────┬──────┐
|
|
64
|
+
│ │ │ │ │ │
|
|
65
|
+
│ │ │ --> │ │ │
|
|
66
|
+
│ │ │ │ │ │
|
|
67
|
+
└──────┴──────┘ └──────┴──────┘
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### [Arrow alignment](tests/fixtures/checks/arrows)
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
┌──────┐ ┌──────┐
|
|
74
|
+
│ step │ │ step │
|
|
75
|
+
└──┬───┘ └──┬───┘
|
|
76
|
+
│ --> │
|
|
77
|
+
v v
|
|
78
|
+
┌──────┐ ┌──────┐
|
|
79
|
+
│ next │ │ next │
|
|
80
|
+
└──────┘ └──────┘
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### [Pipe continuity](tests/fixtures/checks/pipes)
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
┌──────┬──────┐ ┌──────┬──────┐
|
|
87
|
+
│ src │ dest │ │ src │ dest │
|
|
88
|
+
└──────┴──┬───┘ └──────┴──┬───┘
|
|
89
|
+
│ --> │
|
|
90
|
+
│ │
|
|
91
|
+
│ │
|
|
92
|
+
┌─────────┴───┐ ┌─────────┴───┐
|
|
93
|
+
│ output │ │ output │
|
|
94
|
+
└─────────────┘ └─────────────┘
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### [Box spacing](tests/fixtures/checks/box-spacing)
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
┌───────────┐ ┌────────────┐
|
|
101
|
+
│ errors[] │ │ errors[] │
|
|
102
|
+
│ (strings)│ --> │ (strings) │
|
|
103
|
+
└───────────┘ └────────────┘
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### [Box walls](tests/fixtures/checks/box-walls)
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
┌──────────────────┐ ┌──────────────────┐
|
|
110
|
+
│ content here │ │ content here │
|
|
111
|
+
│ more text │ --> │ more text │
|
|
112
|
+
└────────────────┘ └──────────────────┘
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
</details>
|
|
116
|
+
|
|
117
|
+
## Motivation
|
|
118
|
+
|
|
119
|
+
In the era of agentic engineering, documentation is the most critical artifact in any codebase. It guides both humans and AI agents.
|
|
120
|
+
When docs are visually harmonious - with aligned columns, consistent box widths, and straight connector lines - they become easier to read, parse, and maintain by everyone.
|
|
121
|
+
|
|
122
|
+
## Features
|
|
123
|
+
|
|
124
|
+
- 3 modes - check (default), auto-fix in place, or unified diff
|
|
125
|
+
- flexible paths - files, directories, or glob patterns (e.g. `"docs/**/*.md"`)
|
|
126
|
+
- CI-friendly - exit code 0 when aligned, 1 when issues found
|
|
127
|
+
- 12 alignment checks:
|
|
128
|
+
- [Table columns](tests/fixtures/checks/tables) - pads cells so every column matches the separator row width
|
|
129
|
+
- [Box widths](tests/fixtures/checks/box-widths) - ensures all lines in a box group have the same total length
|
|
130
|
+
- [Box padding](tests/fixtures/checks/box-padding) - normalizes left-padding of content lines inside boxes
|
|
131
|
+
- [Horizontal arrows](tests/fixtures/checks/horiz-arrows) - closes gaps between `─>` / `<─` arrow tips and box walls
|
|
132
|
+
- [Rail alignment](tests/fixtures/checks/rails) - aligns vertically adjacent box chars to the same column
|
|
133
|
+
- [Arrow alignment](tests/fixtures/checks/arrows) - aligns standalone `v`/`^` arrows; detects `v`/`^` embedded in borders
|
|
134
|
+
- [Pipe continuity](tests/fixtures/checks/pipes) - traces from T-junctions to detect drifted connector pipes
|
|
135
|
+
- [Box spacing](tests/fixtures/checks/box-spacing) - ensures minimum right-side spacing between content and box wall
|
|
136
|
+
- [Box walls](tests/fixtures/checks/box-walls) - verifies nested box right walls match their opening/closing borders
|
|
137
|
+
- [List descriptions](tests/fixtures/checks/list-descs) - aligns the separator dash in list item descriptions
|
|
138
|
+
- [Definition lists](tests/fixtures/checks/def-lists) - aligns the `:` separator in `key: value` list items
|
|
139
|
+
- [Wide chars](tests/fixtures/checks/wide-chars) - detects ambiguous/double-width Unicode chars in code blocks
|
|
140
|
+
|
|
141
|
+
## Commands
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
docalign <path> # check-only (default) - detect issues, no writes
|
|
145
|
+
docalign --check <path> # explicit check-only (same as default)
|
|
146
|
+
docalign --fix <path> # auto-fix files in place
|
|
147
|
+
docalign --diff <path> # show unified diff of what would change
|
|
148
|
+
docalign --verbose <path> # show actionable hints with each error
|
|
149
|
+
docalign --ignore tables,pipes <path> # skip specific checks
|
|
150
|
+
docalign --help # show help
|
|
151
|
+
docalign --version # show version
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Paths can be files, directories, or glob patterns (e.g. `"docs/**/*.md"`).
|
|
155
|
+
|
|
156
|
+
Check names for `--ignore`: tables, box-widths, box-padding, box-spacing, horiz-arrows, box-walls, rails, arrows, pipes, list-descs, def-lists, wide-chars.
|
|
157
|
+
|
|
158
|
+
Exit codes: 0 = all aligned, 1 = issues found.
|
|
159
|
+
|
|
160
|
+
### Install
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
pipx install docalign
|
|
164
|
+
# pip install docalign
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Update
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
pipx upgrade docalign
|
|
171
|
+
# pip install --upgrade docalign
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Uninstall
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
pipx uninstall docalign
|
|
178
|
+
# pip uninstall docalign
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Development
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
python3 -m venv .venv
|
|
185
|
+
source .venv/bin/activate
|
|
186
|
+
pip install -e ".[dev]"
|
|
187
|
+
pytest -v
|
|
188
|
+
```
|
docalign-0.1.0/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
CLI utility that auto-fixes alignment issues in markdown documentation files - tables, box-drawing diagrams, list descriptions, and more.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
┌────────────────────────┐ ┌────────────────────────┐
|
|
7
|
+
│ ┌────┐ ┌────┐ │ │ ┌────┐ ┌────┐ │
|
|
8
|
+
│ │ A │ │ B │ │ │ │ A │ │ B │ │
|
|
9
|
+
│ └──┬─┘ └──┬─┘ │ │ └──┬─┘ └──┬─┘ │
|
|
10
|
+
│ │ │ │ │ │ │ │
|
|
11
|
+
│ └────┬───┘ │ --> │ └────┬───┘ │
|
|
12
|
+
│ v │ │ v │
|
|
13
|
+
│ ┌──────┐ │ │ ┌──────┐ │
|
|
14
|
+
│ │ C │ │ │ │ C │ │
|
|
15
|
+
│ └──────┘ │ │ └──────┘ │
|
|
16
|
+
└────────────────────────┘ └────────────────────────┘
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
<details>
|
|
20
|
+
<summary>More examples</summary>
|
|
21
|
+
|
|
22
|
+
### [Tables](tests/fixtures/checks/tables)
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
| Service | Usage | | Service | Usage |
|
|
26
|
+
|----------------|-------------------------------| |----------------|-------------------------------|
|
|
27
|
+
| Linear API | Status transitions, comments| --> | Linear API | Status transitions, comments |
|
|
28
|
+
| GitHub API| Repo clone, PR creation | | GitHub API | Repo clone, PR creation |
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### [List descriptions](tests/fixtures/checks/list-descs)
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
- docs/repo.md - mirrors CI steps - docs/repo.md - mirrors CI steps
|
|
35
|
+
- docs/guides/testing-strategy.md - test suite --> - docs/guides/testing-strategy.md - test suite
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### [Box widths](tests/fixtures/checks/box-widths)
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
┌──────────────┐ ┌──────────────┐
|
|
42
|
+
│ Linear UI │ --> │ Linear UI │
|
|
43
|
+
│ (userscript)│ │ (userscript)│
|
|
44
|
+
└──────────────┘ └──────────────┘
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### [Rail alignment](tests/fixtures/checks/rails)
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
┌──────┬──────┐ ┌──────┬──────┐
|
|
51
|
+
│ │ │ │ │ │
|
|
52
|
+
│ │ │ --> │ │ │
|
|
53
|
+
│ │ │ │ │ │
|
|
54
|
+
└──────┴──────┘ └──────┴──────┘
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### [Arrow alignment](tests/fixtures/checks/arrows)
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
┌──────┐ ┌──────┐
|
|
61
|
+
│ step │ │ step │
|
|
62
|
+
└──┬───┘ └──┬───┘
|
|
63
|
+
│ --> │
|
|
64
|
+
v v
|
|
65
|
+
┌──────┐ ┌──────┐
|
|
66
|
+
│ next │ │ next │
|
|
67
|
+
└──────┘ └──────┘
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### [Pipe continuity](tests/fixtures/checks/pipes)
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
┌──────┬──────┐ ┌──────┬──────┐
|
|
74
|
+
│ src │ dest │ │ src │ dest │
|
|
75
|
+
└──────┴──┬───┘ └──────┴──┬───┘
|
|
76
|
+
│ --> │
|
|
77
|
+
│ │
|
|
78
|
+
│ │
|
|
79
|
+
┌─────────┴───┐ ┌─────────┴───┐
|
|
80
|
+
│ output │ │ output │
|
|
81
|
+
└─────────────┘ └─────────────┘
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### [Box spacing](tests/fixtures/checks/box-spacing)
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
┌───────────┐ ┌────────────┐
|
|
88
|
+
│ errors[] │ │ errors[] │
|
|
89
|
+
│ (strings)│ --> │ (strings) │
|
|
90
|
+
└───────────┘ └────────────┘
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### [Box walls](tests/fixtures/checks/box-walls)
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
┌──────────────────┐ ┌──────────────────┐
|
|
97
|
+
│ content here │ │ content here │
|
|
98
|
+
│ more text │ --> │ more text │
|
|
99
|
+
└────────────────┘ └──────────────────┘
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
</details>
|
|
103
|
+
|
|
104
|
+
## Motivation
|
|
105
|
+
|
|
106
|
+
In the era of agentic engineering, documentation is the most critical artifact in any codebase. It guides both humans and AI agents.
|
|
107
|
+
When docs are visually harmonious - with aligned columns, consistent box widths, and straight connector lines - they become easier to read, parse, and maintain by everyone.
|
|
108
|
+
|
|
109
|
+
## Features
|
|
110
|
+
|
|
111
|
+
- 3 modes - check (default), auto-fix in place, or unified diff
|
|
112
|
+
- flexible paths - files, directories, or glob patterns (e.g. `"docs/**/*.md"`)
|
|
113
|
+
- CI-friendly - exit code 0 when aligned, 1 when issues found
|
|
114
|
+
- 12 alignment checks:
|
|
115
|
+
- [Table columns](tests/fixtures/checks/tables) - pads cells so every column matches the separator row width
|
|
116
|
+
- [Box widths](tests/fixtures/checks/box-widths) - ensures all lines in a box group have the same total length
|
|
117
|
+
- [Box padding](tests/fixtures/checks/box-padding) - normalizes left-padding of content lines inside boxes
|
|
118
|
+
- [Horizontal arrows](tests/fixtures/checks/horiz-arrows) - closes gaps between `─>` / `<─` arrow tips and box walls
|
|
119
|
+
- [Rail alignment](tests/fixtures/checks/rails) - aligns vertically adjacent box chars to the same column
|
|
120
|
+
- [Arrow alignment](tests/fixtures/checks/arrows) - aligns standalone `v`/`^` arrows; detects `v`/`^` embedded in borders
|
|
121
|
+
- [Pipe continuity](tests/fixtures/checks/pipes) - traces from T-junctions to detect drifted connector pipes
|
|
122
|
+
- [Box spacing](tests/fixtures/checks/box-spacing) - ensures minimum right-side spacing between content and box wall
|
|
123
|
+
- [Box walls](tests/fixtures/checks/box-walls) - verifies nested box right walls match their opening/closing borders
|
|
124
|
+
- [List descriptions](tests/fixtures/checks/list-descs) - aligns the separator dash in list item descriptions
|
|
125
|
+
- [Definition lists](tests/fixtures/checks/def-lists) - aligns the `:` separator in `key: value` list items
|
|
126
|
+
- [Wide chars](tests/fixtures/checks/wide-chars) - detects ambiguous/double-width Unicode chars in code blocks
|
|
127
|
+
|
|
128
|
+
## Commands
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
docalign <path> # check-only (default) - detect issues, no writes
|
|
132
|
+
docalign --check <path> # explicit check-only (same as default)
|
|
133
|
+
docalign --fix <path> # auto-fix files in place
|
|
134
|
+
docalign --diff <path> # show unified diff of what would change
|
|
135
|
+
docalign --verbose <path> # show actionable hints with each error
|
|
136
|
+
docalign --ignore tables,pipes <path> # skip specific checks
|
|
137
|
+
docalign --help # show help
|
|
138
|
+
docalign --version # show version
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Paths can be files, directories, or glob patterns (e.g. `"docs/**/*.md"`).
|
|
142
|
+
|
|
143
|
+
Check names for `--ignore`: tables, box-widths, box-padding, box-spacing, horiz-arrows, box-walls, rails, arrows, pipes, list-descs, def-lists, wide-chars.
|
|
144
|
+
|
|
145
|
+
Exit codes: 0 = all aligned, 1 = issues found.
|
|
146
|
+
|
|
147
|
+
### Install
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
pipx install docalign
|
|
151
|
+
# pip install docalign
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Update
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
pipx upgrade docalign
|
|
158
|
+
# pip install --upgrade docalign
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Uninstall
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
pipx uninstall docalign
|
|
165
|
+
# pip uninstall docalign
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Development
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
python3 -m venv .venv
|
|
172
|
+
source .venv/bin/activate
|
|
173
|
+
pip install -e ".[dev]"
|
|
174
|
+
pytest -v
|
|
175
|
+
```
|