mandown icon indicating copy to clipboard operation
mandown copied to clipboard

Design: leave paging to less(1)?

Open kiedtl opened this issue 5 years ago • 7 comments

From what I see this tool is doing two things: markdown parsing/formatting and paging.

Why not just do md formatting and leave the rest for less? That way users are free to use a pager of choice (or none at all) and you don't need to duplicate the functionality of less.

Thoughts?

kiedtl avatar May 10 '20 11:05 kiedtl

I’m planning on adding -o flag for simply format the buffer and output it to file if anyone wants to use other pager or no pager at all.

Honestly, the reason that flag wasn’t in the functionality is because I’m not too familiar with the syntax and functionality of less/more.

Titor8115 avatar May 10 '20 14:05 Titor8115

I would prefer if it would respect PAGER variable

alexmyczko avatar May 12 '20 13:05 alexmyczko

Syntax of less commands is not hard - you can get inspiration from pspg - https://github.com/okbob/pspg. Is good to know a less functionality because defacto it is UNIX (Linux) standard - so it is good to respect keyboard commands, options, .. It is good source of inspiration, although it is not based on ncurses.

I think so the decision to use or not to use less is not easy. Less is great pager - but it is generic pager. It cannot to support special formats, special searching, walk through document structure.

okbob avatar May 12 '20 13:05 okbob

The point is one can use PAGER or pipe it to a printer or grep it or whatever.

alexmyczko avatar May 12 '20 14:05 alexmyczko

Syntax of less commands is not hard - you can get inspiration from pspg - https://github.com/okbob/pspg. Is good to know a less functionality because defacto it is UNIX (Linux) standard - so it is good to respect keyboard commands, options, .. It is good source of inspiration, although it is not based on ncurses.

I think so the decision to use or not to use less is not easy. Less is great pager - but it is generic pager. It cannot to support special formats, special searching, walk through document structure.

Thanks for the resources!

Update on current todo list:

  • Piping capability
  • Line fold/wrap on white space
  • Optimized resizing

Meanwhile, anyone have any idea about Mac OS? There is an issue where A_ITALIC macro not detected while compiling.

Titor8115 avatar May 12 '20 14:05 Titor8115

I have access to macOS can try to create a macbrew port

alexmyczko avatar May 12 '20 15:05 alexmyczko

I have access to macOS can try to create a macbrew port

That would be greatly appreciated!

Titor8115 avatar May 12 '20 15:05 Titor8115