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

Feature: Let user choose/disable maximum line length for presentation #119

Closed
iacore opened this issue Aug 19, 2022 · 4 comments
Closed

Comments

@iacore
Copy link

iacore commented Aug 19, 2022

When exporting URL, it likes to butcher the output.

import yaml/serialization, std/streams

type A = object
  foo: string

let a = A(foo:"/sites/default/files/styles/square/public/media_2022/07/202207africa_angola_dossantos.jpg?h=1305ebec&itok=GSD3Irma")

var s = newFileStream("/tmp/test7.yaml", fmWrite)
dump(@[a], s)
s.close()

output:

> cat /tmp/test7.yaml
%YAML 1.2
%TAG !n! tag:nimyaml.org,2016:
--- !n!system:seq(tag:nimyaml.org;2016:custom:A) 
- 
  foo: "/sites/default/files/styles/square/public/media_2022/07/202207africa_angol\
    a_dossantos.jpg?h=1305ebec&itok=GSD3Irma"⏎ 

Is there any way to make it not do that? It also does that with psMinimal.

@flyx
Copy link
Owner

flyx commented Aug 19, 2022

Can you be more precise about what bothers you? Perhaps show what output you expect?

@flyx
Copy link
Owner

flyx commented Aug 19, 2022

If this is simply about the newline, I'm afraid there currently isn't an option to disable it. When I wrote this code apparently I was appalled by lines having more than 80 characters so I hardcoded that limit. This is not a good state of affairs.

Transforming this into a feature request for the user to be able to set or disable line wrapping.

@flyx flyx changed the title How to disable line wrap Feature: Let user choose/disable maximum line length for presentation Aug 19, 2022
@iacore
Copy link
Author

iacore commented Aug 19, 2022

Can you be more precise about what bothers you? Perhaps show what output you expect?

It makes URL hard to read (they shouldn't be broken in the middle).

@flyx flyx closed this as completed in 5f7677d Sep 7, 2022
@flyx
Copy link
Owner

flyx commented Sep 7, 2022

This feature has been implemented and can now be used like this:

dump(@[a], s, options = defineOptions(maxLineLength = none(int)))

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