Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center text #233

Closed
makew0rld opened this issue May 3, 2021 · 2 comments
Closed

Center text #233

makew0rld opened this issue May 3, 2021 · 2 comments
Labels
enhancement New feature or request UI Deals with the visual user interface
Milestone

Comments

@makew0rld
Copy link
Owner

makew0rld commented May 3, 2021

Currently there are two config options controlling how text is formatted overall:

# A number from 0 to 1, indicating what percentage of the terminal width the left margin should take up.
left_margin = 0.15

# The max number of columns to wrap a page's text to. Preformatted blocks are not wrapped.
max_width = 100

I propose max_width default to 80 now, and then left_margin be removed in favor of an algorithm that gets the current text width and always centers it.

@makew0rld makew0rld added enhancement New feature or request UI Deals with the visual user interface labels May 3, 2021
@makew0rld makew0rld added this to the v1.10.0 milestone May 3, 2021
@justjosias
Copy link
Contributor

Does the algorithm have to get the current text width or can it simply assume max_width?

@makew0rld
Copy link
Owner Author

Actually, since the max width and the terminal width are known, centering the text (setting the left margin) can be done easily without looking at the current text width. Good point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UI Deals with the visual user interface
Projects
None yet
Development

No branches or pull requests

2 participants