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

setting table width ? #247

Closed
pgalbavy-itrs opened this issue Jul 27, 2023 · 1 comment
Closed

setting table width ? #247

pgalbavy-itrs opened this issue Jul 27, 2023 · 1 comment

Comments

@pgalbavy-itrs
Copy link

I'm using glamour as the renderer for help text in my program (which is also rendered on web and in PDF by other methods). I want to use tables for typical settings/defaults/description lists instead of layers of bullet points.

I am setting the wordwrap based on the term width (from term.GetSize()) but the table is always rendered as 74 chars wide. e.g.

	var width int
	var err error

	if !term.IsTerminal(int(os.Stdout.Fd())) {
		style = glamour.WithStandardStyle("ascii")
	}
	width, _, err = term.GetSize(int(os.Stdout.Fd()))
	if err != nil {
		width = 80
	}

	tr, err := glamour.NewTermRenderer(
		style,
		glamour.WithStylesFromJSONBytes([]byte(`{ "document": { "margin": 0 } }`)),
		glamour.WithWordWrap(width),
		glamour.WithEmoji(),
	)

Is there a was to filter down the width setting for tables that I have simply missed or is it a restriction in the use of tablewriter?

@bashbunni bashbunni linked a pull request Apr 4, 2024 that will close this issue
4 tasks
@bashbunni bashbunni removed a link to a pull request Apr 4, 2024
4 tasks
@bashbunni
Copy link
Member

Hey @pgalbavy-itrs this is fixed in the latest release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants