MacDownApp / macdown

Open source Markdown editor for macOS.
https://macdown.uranusjr.com/
9.45k stars 1.09k forks source link

macdown CLI pane visibility options #761

Open niklasberglund opened 7 years ago

niklasberglund commented 7 years ago

Thinking of implementing this and creating a PR but want to check first whether you also think the functionality makes sense. I'd like to implement pane options for the macdown shell utility. Flags such as --hide-editor etc. Maybe flags for all the pane-related options under the View menu in MacDown:

That would probably cover what's requested in #350. Not sure whether they're asking for a setting in the preferences or options for the macdown tool but I think command line options is the way to go.

FranklinYu commented 7 years ago

I'm curious what would user expect when one pass in conflicting flags; warning and go on with some default, or error and quit?

niklasberglund commented 7 years ago

Yea that's an issue. One way to avoid this issue could be for example: macdown --hide-editor --show-preview

Could instead be: macdown --show-preview-only

uranusjr commented 7 years ago

Common practices:

FranklinYu commented 7 years ago

First approach may be easier? I love second approach, where #350 can be (partially) solved by alias macdown='macdown --editor-only'.

uranusjr commented 7 years ago

The utility uses a argument parsing library. I don’t remember the internals, but if it works like Python’s argparse module (which I am familiar with), option 2 would not be much more complicate than option 1. I also like option 2 better, but that’s not universal preference.

hmenzi commented 4 years ago

I get the command line stuff but can these options just be added contextually to the existing "Layout" toolbar dropdown?