Slightly modify Julia banner in order to enhance syntax highlighting.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Slightly modify Julia banner in order to enhance syntax highlighting.

Ismael Venegas Castelló
I'd like to propose changing the back tick for a single quote or something similar, this little change makes every syntax highlighting tool I've tested, work with a snippet of Julia code that includes the Julia Banner. Notice how with the back tick in the default banner, syntax highlighting is messed up, this happens in many editors too.

original with a back-tick:

* https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-backtick-jl

  __ _
 / _` |
| (_| |
 \__'_|

with a single quote:

* https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-single_quote-jl

  __ _
 / _' |
| (_| |
 \__'_|

with an accent:

* https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-accent-jl

  __ _
 / _´ |
| (_| |
 \__'_|

It's barely noticable and the advantage is great IMHO, if you agree I can make a PR.
Reply | Threaded
Open this post in threaded view
|

Re: Slightly modify Julia banner in order to enhance syntax highlighting.

Avik Sengupta
I like this idea, and would like to see this done. The current banner does make most syntax highlighting tools choke. 

Regards
-
Avik

On Saturday, 30 April 2016 12:42:24 UTC+1, Ismael Venegas Castelló wrote:
I'd like to propose changing the back tick for a single quote or something similar, this little change makes every syntax highlighting tool I've tested, work with a snippet of Julia code that includes the Julia Banner. Notice how with the back tick in the default banner, syntax highlighting is messed up, this happens in many editors too.

original with a back-tick:

* <a href="https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-backtick-jl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2FIsmael-VC%2F57a6c99531579f29c4c77ff8859ea545%23file-backtick-jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEGaA0AUepDem8PWk1Q6CdEGGf-Kw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2FIsmael-VC%2F57a6c99531579f29c4c77ff8859ea545%23file-backtick-jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEGaA0AUepDem8PWk1Q6CdEGGf-Kw&#39;;return true;">https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-backtick-jl

  __ _
 / _` |
| (_| |
 \__'_|

with a single quote:

* <a href="https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-single_quote-jl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2FIsmael-VC%2F57a6c99531579f29c4c77ff8859ea545%23file-single_quote-jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFw8IV1nQjvW3HgYD-9MFsGSouu_g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2FIsmael-VC%2F57a6c99531579f29c4c77ff8859ea545%23file-single_quote-jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFw8IV1nQjvW3HgYD-9MFsGSouu_g&#39;;return true;">https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-single_quote-jl

  __ _
 / _' |
| (_| |
 \__'_|

with an accent:

* <a href="https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-accent-jl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2FIsmael-VC%2F57a6c99531579f29c4c77ff8859ea545%23file-accent-jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFTyrJ0StPwCY226MsWQLivV5bK7A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2FIsmael-VC%2F57a6c99531579f29c4c77ff8859ea545%23file-accent-jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFTyrJ0StPwCY226MsWQLivV5bK7A&#39;;return true;">https://gist.github.com/Ismael-VC/57a6c99531579f29c4c77ff8859ea545#file-accent-jl

  __ _
 / _´ |
| (_| |
 \__'_|

It's barely noticable and the advantage is great IMHO, if you agree I can make a PR.
Reply | Threaded
Open this post in threaded view
|

Re: Slightly modify Julia banner in order to enhance syntax highlighting.

Hans-Peter
In reply to this post by Ismael Venegas Castelló
A possible solution could be to use code point U+0300 (COMBINING GRAVE ACCENT) instead of U+0060 (Backtick/GRAVE ACCENT). Thus the banner looks as nice as today (both in code and terminal) but does not disturb syntax highlighting.

Tested with Vim, Neovim, Atom and Sublime. The latter obviously has a (general accent) problem, don't know if the suggested config works (https://forum.sublimetext.com/t/how-to-make-acute-accent-over-a-character/13655).

Here the fixed/original banners for test-pasting:

julia> mybanner()
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _ ̀ |  |
  | | |_| | | | (_| |  |  Version 0.4.3 (2016-01-12 21:37 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0


julia> Base.banner()
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.3 (2016-01-12 21:37 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

Reply | Threaded
Open this post in threaded view
|

Re: Slightly modify Julia banner in order to enhance syntax highlighting.

Hans-Peter
Unfortunately I later noticed some issues with my U+0300 (COMBINING GRAVE ACCENT) proposition. While the visual defects are not too noticeable I don't know if there lurk more grave problems somewhere behind. Issues:

- (Ubuntu 14.04) in Firefox and Chrome the Grave Accent will be displayed one position to the right. The vertical divider lines stayed on the original position. After copying the banner text from the browsers to Vim/GVim the Accent was at the correct position. In Eclipse the Accent has also moved one position to the right and dividers appear on original position.

- (Windows 10 in a VM) in Firefox and Windows Edge same as above, in the browsers the Grave Accent appears one position to the right, dividers as in original banner text. After copying to Vim the Accent is correct (in GVim there was only a box, maybe something with encoding is wrong).
Reply | Threaded
Open this post in threaded view
|

Re: Slightly modify Julia banner in order to enhance syntax highlighting.

Stefan Karpinski
I vote for just using a normal ' character.

On Thu, May 5, 2016 at 5:14 PM, Hans-Peter <[hidden email]> wrote:
Unfortunately I later noticed some issues with my U+0300 (COMBINING GRAVE ACCENT) proposition. While the visual defects are not too noticeable I don't know if there lurk more grave problems somewhere behind. Issues:

- (Ubuntu 14.04) in Firefox and Chrome the Grave Accent will be displayed one position to the right. The vertical divider lines stayed on the original position. After copying the banner text from the browsers to Vim/GVim the Accent was at the correct position. In Eclipse the Accent has also moved one position to the right and dividers appear on original position.

- (Windows 10 in a VM) in Firefox and Windows Edge same as above, in the browsers the Grave Accent appears one position to the right, dividers as in original banner text. After copying to Vim the Accent is correct (in GVim there was only a box, maybe something with encoding is wrong).

Reply | Threaded
Open this post in threaded view
|

Re: Slightly modify Julia banner in order to enhance syntax highlighting.

Erik Schnetter
Instead of using ASCII characters, it would be kind-of cool to use UTF-8 graphical characters here that avoid the small spaces around the characters <https://en.wikipedia.org/wiki/Box-drawing_character>:


-erik


On Thu, May 5, 2016 at 5:19 PM, Stefan Karpinski <[hidden email]> wrote:
I vote for just using a normal ' character.

On Thu, May 5, 2016 at 5:14 PM, Hans-Peter <[hidden email]> wrote:
Unfortunately I later noticed some issues with my U+0300 (COMBINING GRAVE ACCENT) proposition. While the visual defects are not too noticeable I don't know if there lurk more grave problems somewhere behind. Issues:

- (Ubuntu 14.04) in Firefox and Chrome the Grave Accent will be displayed one position to the right. The vertical divider lines stayed on the original position. After copying the banner text from the browsers to Vim/GVim the Accent was at the correct position. In Eclipse the Accent has also moved one position to the right and dividers appear on original position.

- (Windows 10 in a VM) in Firefox and Windows Edge same as above, in the browsers the Grave Accent appears one position to the right, dividers as in original banner text. After copying to Vim the Accent is correct (in GVim there was only a box, maybe something with encoding is wrong).




--