[erlang-questions] Pretty print list of strings in tabular way

Richard Carlsson carlsson.richard@REDACTED
Mon Oct 23 11:09:03 CEST 2017


The erl_prettypr.erl module uses the prettypr.erl module to do the
formatting, so you can look at that as an example.

Generating nice-looking tables is however not something that fits well with
how prettypr.erl works. It wants to be able to make local choices between
vertical or horizontal alignment, and a table requires that the lines
separating cells are aligned both horizontally and vertically across the
whole table. Maybe it would be straightforward to add such grid alignment
as an extra capability to prettypr.erl though. Otherwise, you could use it
to format individual pieces of text to fit into the cells of the table once
you have chosen the cell sizes.

        /Richard

2017-10-23 10:42 GMT+02:00 Frank Muller <frank.muller.erl@REDACTED>:

> What I would like to achieve is something similar to Scribe but in pure
> Erlang:
>
> https://github.com/codedge-llc/scribe
>
> /Frank
>
>
> erlang/19.1/lib/syntax_tools-2.1/src/prettypr.erl
>>
>> http://erlang.org/doc/man/prettypr.html
>>
>>
>> Greetings,
>>>
>>> Where did you find a module called prettyptr? Searching for it I found
>>> nothing.
>>> I have used the module erl_prettypr for code, but I do not think that is
>>> what you want.
>>> Would you mind explaining slightly more about what you are trying to
>>> achieve?
>>>
>>> bengt
>>>
>>> On Mon, Oct 23, 2017 at 10:23 AM, Frank Muller <
>>> frank.muller.erl@REDACTED> wrote:
>>>
>>>> Hey guys,
>>>>
>>>> Is there any library which helps pretty print list of “list of strings”
>>>> into a nice table?
>>>>
>>>> I’ve found this module prettyptr shipped with the VM. But I couldn’t
>>>> find any example on how to use it.
>>>>
>>>> Any idea is very welcome.
>>>>
>>>> Thanks
>>>> /Frank
>>>>
>>>> _______________________________________________
>>>> erlang-questions mailing list
>>>> erlang-questions@REDACTED
>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>>
>>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171023/409e9660/attachment.htm>


More information about the erlang-questions mailing list