SyntaxHighlight: Difference between revisions

From Leo's Notes
This page was last edited on 31 August 2019, at 22:44.
No edit summary
Line 14: Line 14:


== Issues ==
== Issues ==
Any highlight issues should go here.


=== Shell prompt shows partially as command if it contains a space ===
=== Shell prompt shows partially as command if it contains a space ===
Line 21: Line 22:
kubernetes-dashboard  ClusterIP  10.108.158.128  <none>        443/TCP        2m36s
kubernetes-dashboard  ClusterIP  10.108.158.128  <none>        443/TCP        2m36s
}}
}}
=== Shell prompt's leading space should not be part of the command. ===
{{highlight|lang=terminal|code=
# something something
something
}}


=== Support heredoc ===
=== Support heredoc ===
Line 50: Line 43:
These are issues that have been fixed. Leaving these up as a crude unit test.
These are issues that have been fixed. Leaving these up as a crude unit test.


=== Shell prompt's leading space should not be part of the command. ===
{{highlight|lang=terminal|code=
# something something
something
}}


=== The ESXi default shell and zsh {{code|%}} shell are not highlighting properly  ===
=== The ESXi default shell and zsh {{code|%}} shell are not highlighting properly  ===
Line 59: Line 57:
backup_vms  esxi-backup/  ghettoVCB.conf  ghettoVCB.sh*
backup_vms  esxi-backup/  ghettoVCB.conf  ghettoVCB.sh*
}}
}}


=== Empty # will cause the next # to be a comment, even if they are on different lines: ===
=== Empty # will cause the next # to be a comment, even if they are on different lines: ===

Revision as of 22:44, 31 August 2019

The plugin being used is from http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi Terminal code uses a custom pygment.

Usage

To use SyntaxHighlight on this wiki, use the Highlight template.

{{highlight|lang=terminal|code=
code goes here
}}

Issues

Any highlight issues should go here.

Shell prompt shows partially as command if it contains a space

[root@kube ~]# kubectl get services --namespace=kube-system kubernetes-dashboard
NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)         AGE
kubernetes-dashboard   ClusterIP   10.108.158.128   <none>        443/TCP         2m36s

Support heredoc

# cat <<EOF > /somewhere/something.txt
[something something]
this should all be grey text.
everything until the line with
a single EOF.
This should be grey too.
EOF
# this should be a command
## and comments should work
# cat /somewhere/something.txt
[something something]
...

Fixed Issues

These are issues that have been fixed. Leaving these up as a crude unit test.

Shell prompt's leading space should not be part of the command.

# something something
something

The ESXi default shell and zsh % shell are not highlighting properly

[root@server:/vmfs/volumes/ee8ff6f0-af4dbc98] sh ./ghettoVCB.sh -f backup_vms

leo@nas:/data/vm% ls
backup_vms  esxi-backup/  ghettoVCB.conf  ghettoVCB.sh*

Empty # will cause the next # to be a comment, even if they are on different lines:

# gpart create -s GPT /dev/ada1
# gpart add -b 2048 -s 1953113520 -t freebsd-zfs -l disk01 /dev/ada1
#
# gpart create -s GPT /dev/ada2
# gpart add -b 2048 -s 1953113520 -t freebsd-zfs -l disk02 /dev/ada2
#
# gpart create -s GPT /dev/ada3
# gpart add -b 2048 -s 1953113520 -t freebsd-zfs -l disk03 /dev/ada3