HappenApps / Quiver

Quiver documentation and issue tracker
2.26k stars 109 forks source link

Add syntax highligting for bash/shell/commandline #306

Closed swoopdk closed 8 years ago

swoopdk commented 8 years ago

Hi I would be absolutely awesome for us sysadmins to have syntax highlighting for code cells for bash shell. Not actual bash scripting but simple format the output from the shell with some basic colors.

Alternatively (additionally perhaps) it would be awesome to be able to have a quote cell readily available. Example when i copy paste output from my terminal to personal notes. It would be nice to not have to format using markdown but a pre-formatted cell that just encloses the content in on both sides .

JMichaelTX commented 8 years ago

Example when i copy paste output from my terminal to personal notes. It would be nice to not have to format using markdown but a pre-formatted cell that just encloses the content in on both sides .

You could probably automate this using AppleScript or JXA, today. Just create the AppleScript to copy the selection to the clipboard, read the clipboard, add the text you want, and put back on the clipboard. It's then ready for you to paste into Quiver.

swoopdk commented 8 years ago

It would be much better to have directly in the app. The second solution is a super simple (i'm assuming without knowing the app of course) as i can copy paste and then select a nice markup for shell snippets :)

But i will look into having some sort of automatic scripting format before pasting for me. Though it's not an optimal solution :(

ylian commented 8 years ago

Bash syntax highlighting is already there. It's named "Shell" in the list of languages.

Correction: actually it's named "Bash".

swoopdk commented 8 years ago

Hmm maybe i'm blind but i cannot find "Shell" anywhere in my list of languages

On Fri, Dec 11, 2015 at 12:07 PM, Yaogang Lian notifications@github.com wrote:

Bash syntax highlighting is already there. It's named "Shell" in the list of languages.

— Reply to this email directly or view it on GitHub https://github.com/HappenApps/Quiver/issues/306#issuecomment-163911784.

swoopdk commented 8 years ago

Here is a screenshot of the available ones... screen shot 2015-12-11 at 12 12 21

ylian commented 8 years ago

See my correction: it's named "Bash".

swoopdk commented 8 years ago

Ah but doesn't that only highlight actual Bash scripting and not the Bash terminal/shell syntax stuff ?

It certainly highlights somestrange things from what i have usually seen under Shell syntax highlighting.

ylian commented 8 years ago

Is there a good package for Sublime Text or TextMate for what you need?

swoopdk commented 8 years ago

OKay been looking through it and perhaps i have been wrong. I was sure i have seen editors with very nice formatting for "shell". But looking through sublime it formats the exact same (though i would expect since it's also bash scrip as the name of the syntax highlighter).

So perhaps i have been mistaken or it's been a copy paste of formatting from the actual terminal i have seen. So unless i find further information lets just say it's my mistake and sorry for wasting anybodys time :(

ylian commented 8 years ago

@swoopdk No worries. If you find a nice syntax highlighting package for what you need, let me know and I might be able to convert. I do see the difference between bash script and terminal output (probably the syntax highlighting package should be called "terminal").

The quote cell is an interesting idea, but probably the use case is too narrow. I try to be very careful about introducing new cell types. Keeping the app lightweight and easy to use is more important than supporting every use case.

swoopdk commented 8 years ago

I totally understand with the new call use case and in general i'm sure most people would have more use of the more general markdown cell. However of course the use case would be useful for pretty much anything that needs to be quoted quickly.

And yeah if i find anything i will let you know. The current one i think fits bash shell scripting, but a new one should propably be terminal or shell in general to match terminal output. But right now all i can find i various color hacks for the terminal and doubt they are all that useful :(

On Fri, Dec 11, 2015 at 12:37 PM, Yaogang Lian notifications@github.com wrote:

@swoopdk https://github.com/swoopdk No worries. If you find a nice syntax highlighting package for what you need, let me know and I might be able to convert. I do see the difference between bash script and terminal output (probably the syntax highlighting package should be called "terminal").

The quote cell is an interesting idea, but probably the use case is too narrow. I try to be very careful about introducing new cell types. Keeping the app lightweight and easy to use is more important than supporting every use case.

— Reply to this email directly or view it on GitHub https://github.com/HappenApps/Quiver/issues/306#issuecomment-163916658.