{"id":16499477,"url":"https://github.com/tpapp/autoaligns.jl","last_synced_at":"2025-10-08T22:59:32.122Z","repository":{"id":48511568,"uuid":"56974577","full_name":"tpapp/AutoAligns.jl","owner":"tpapp","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-20T09:13:05.000Z","size":15,"stargazers_count":9,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T16:20:08.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-24T14:01:26.000Z","updated_at":"2022-02-14T12:30:52.000Z","dependencies_parsed_at":"2022-09-06T02:30:09.046Z","dependency_job_id":null,"html_url":"https://github.com/tpapp/AutoAligns.jl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FAutoAligns.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FAutoAligns.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FAutoAligns.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FAutoAligns.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpapp","download_url":"https://codeload.github.com/tpapp/AutoAligns.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241405079,"owners_count":19957764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T14:53:06.515Z","updated_at":"2025-10-08T22:59:27.058Z","avatar_url":"https://github.com/tpapp.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoAligns\n\n[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip)\n[![Build Status](https://travis-ci.org/tpapp/AutoAligns.jl.svg?branch=master)](https://travis-ci.org/tpapp/AutoAligns.jl)\n[![Coverage Status](https://coveralls.io/repos/github/tpapp/AutoAligns.jl/badge.svg?branch=master\u0026bust=1)](https://coveralls.io/github/tpapp/AutoAligns.jl?branch=master)\n\nThis [Julia](https://julialang.org) package helps align text for printing with a monospace font, by keeping track of the maximum width of each column. It is useful for printing matrices, tables, and analogous structures, and in particular for writing methods for `Base.print`.\n\n## Installation\n\nThis package is not yet registered on Julia's [METADATA.jl](https://github.com/JuliaLang/METADATA.jl/).\nTo install it, you must use the [usual procedure for unregistered packages](https://docs.julialang.org/en/stable/manual/packages/#Installing-Unregistered-Packages-1):\n\n```julia\nPkg.clone(\"git://github.com/tpapp/AutoAligns.jl.git\")\n```\n\nNote that the [minimum required version](https://github.com/tpapp/AutoAligns.jl/blob/master/REQUIRE) of Julia is 0.6.\n\n## Usage\n\nCreate an `AutoAlign` object, then use `print` to save values into it, which are strings or converted to strings. The `AutoAlign` object keeps track of the current column (which you can query with `position`, but that is rarely necessary), and you can also provide a default alignment, or specify it before printing, using the methods\n\n```julia\nprint(aa::AutoAlign, xs...)\nprintln(aa::AutoAlign, xs...)\n```\nwhere the latter starts a new line after saving the values. Both accept a keyword argument `align`, for specifying alternate alignent for the preceding arguments.\n\nAlignment can be specified as follows:\n\n1. an atom `left`, `right`, or `center`, or any other user extension which is a subtype of `Alignment`,\n\n2. a vector of alignment specifiers: for positions outside the length of the vector, the last element is used,\n\n3. a `Dict` of `position =\u003e alignment` pairs, where the position `:default` provides the alignment for items not in the `Dict`.\n\n## Example\n\n\u003c!--- pasted manually from the output of test/examples.jl --\u003e\n\n```julia\njulia\u003e using AutoAligns\n\njulia\u003e aa = AutoAlign(align = Dict(1 =\u003e left, :default =\u003e right));\n\njulia\u003e for (i, r) in zip([1, 100, 10000], [\"a\", \"bb\", \"ccc\"])\n           print(aa, r)\n           for j in 1:5\n               print(aa, \"  \", i + j) # padding\n           end\n           println(aa)\n       end\n\njulia\u003e print(STDOUT, aa)\na        2      3      4      5      6\nbb     101    102    103    104    105\nccc  10001  10002  10003  10004  10005\n```\n\n## Notes\n\nSpaces or separators such as `|` are not treated in a special way, and therefore should be accounted for when specifying positions for alignment.\n\nPrinting an `AutoAlign` object to a stream pads the strings with spaces so as to achieve the desired alignment.\n\nAn `AutoAlign` object is **not a subtype of `IO`,** as it does not implement a `write(::AutoAlign, x::UInt8)` method. Unlike `IOBuffer`, printing does not delete the contents.\n\nCustom alignment types can be defined as subtypes of `Alignment`, by implementing `align_string`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpapp%2Fautoaligns.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpapp%2Fautoaligns.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpapp%2Fautoaligns.jl/lists"}