[syslinux] Syntax highlighted configuration files

Collins, Jeremy Collins_Jeremy at sccollege.edu
Wed Sep 1 09:51:28 PDT 2010


I have occasional need to view my Syslinux configuration files via a
browser, mainly to check if they have an error. When I viewed a
configuration file in the browser it lost all of the formatting and
become one really long paragraph, just as you'd expect plain text to do.
It was very hard to follow so I did the obvious and started adding a
commented <pre> and </pre> tag at the start and end of each
configuration file. This gave the file some reasonable formatting and I
was happy with that for a while. Eventually I felt the need to improve
the formatting further and I decided to add syntax highlighting. 

Since I'm typically trying to check if/where the syntax in a file is
wrong, syntax highlighting was a fairly obvious choice. Now I have
progressed to the point where I add a 5 line commented html header to
each file and a closing commented line. This header adds syntax
highlighting using SyntaxHighlighter
(http://alexgorbatchev.com/SyntaxHighlighter/) and a brush I made to
handle the Syslinux configuration files
(http://pileus.TinFlower.com/webroot/syntaxhighlighter/scripts/shBrushSy
slinux.js). I wanted to share this file and my setup in case anyone on
the list has a similar need and also wanted to use syntax highlighting. 

If you want to use it and you have internet access you can copy and
paste the lines below which point to my server, no modification needed.
If you want or need to host the files locally: download
SyntaxHighlighter (link above) then add the brush file (link above) to
the 'scripts' subfolder. Add the lines below and adjust the 4 URLs to
match your hosting location. To add syntax highlighting wrap I wrap my
existing configurations in these commented lines:


# <html><head><script type="text/javascript"
src="http://pileus.TinFlower.com/webroot/syntaxhighlighter/scripts/shCor
e.js"></script>
# <script type="text/javascript"
src="http://pileus.TinFlower.com/webroot/syntaxhighlighter/scripts/shBru
shSyslinux.js"></script>
# <link
href="http://pileus.TinFlower.com/webroot/syntaxhighlighter/styles/shCor
eFadeToGrey.css" rel="stylesheet" type="text/css" />
# <link
href="http://pileus.TinFlower.com/webroot/syntaxhighlighter/styles/shThe
meFadeToGrey.css" rel="stylesheet" type="text/css" />
# </head><body><pre class="brush: syslinux;">

...Normal Syslinux configuration here...

# </pre><script
type="text/javascript">SyntaxHighlighter.all();</script></body></html>


Jeremy Collins
Technical Specialist 3
Orange Education Center
Santiago Canyon College



  




More information about the Syslinux mailing list