I am using Alectryon to render some coq source file but I would love the pretty-printer to use more characters in a single line before inserting a newline. Is it possible?
Set Printing Width does not seem to have an impact on sertop
output.
@Yann Régis Gianas indeed SerAPI printing protocol is stateless
each Print
call takes the full set of format parameters, so likely you need to tweak Alectryon so it increases the Width
Indeed this https://github.com/cpitclaudel/alectryon/blob/df5664e71c1026af4aaf69e6b227d427a728e7c6/alectryon/core.py#L81 looks like very limited in terms of width
@Clément Pit-Claudel may know more
I can add a user-level setting if you want; otherwise you can use the following custom driver:
#!/usr/bin/env python3
from alectryon.cli import main
from alectryon.core import SerAPI
SerAPI.DEFAULT_PP_ARGS['pp_margin'] = 55
if __name__ == "__main__":
main()
(This assumes that Alectryon is in your python path; if it's not, then you can add the following:)
import sys
from os.path import join, dirname
root = join(dirname(__file__), "alectryon") # Or wherever Alectryon is
sys.path.insert(0, root)
It worked like a charm. Thank you very much!
Note that work on a new printer that is layout-friendly is getting ready, this will allow for direct reflow-friendly display
Last updated: May 31 2023 at 03:30 UTC