Recently I had the pleasure of succeeding in enabling syntax
with that success I still found some things that could make the process
and more robust.
One major issue would be that fossil by default inserts the following in
<meta http-equiv="Content-Security-Policy" content="default-src 'self'
This is fairly prohibitive towards trying to get outside resources
as to allow syntax highlighting. The solution? Download jquery,
a CSS file to the directory that fossil server is serving up and tell it
the "--files" glob pattern to serve those sorts of files. Even so, I
it's perhaps useful when running as it's own http server during local
development but truthfully when ran with say the "--scgi" parameter I'm
that it does any good setting things that can be set in headers by the
server that is proxying it. In my case I use nginx and had my own set of
headers defined that I use across quite a few different resources. This
me for a good minute when trying to use a CDN for highlightjs.
The next major issue is that the "Artifact Content" pages use
"<blockquote><pre>" instead of "<pre><code>". This means that there are
few syntax highlighting tools that will absolutely not work. These tools
on the latter (think prism.js). Luckilly highlightjs doesn't insist.
even if its "<blockquote><pre><code>", utilizing "<pre><code>" would be
better. I've looked at the function in "src/info.c" and I also notice
area where this could be improved if it were to move to "<pre><code>".
function already knows the file name and thereby could ascertain the
extension quite easily. That said, say the file name is "bla.lua", it
detect the extension "lua", and set the class of the code block to it
Having the ability to utilize syntax highlighting would greatly enhance
and I'd love to see the previous paragraph's proposal implemented
syntax highlighting detection engines will be more than horribly
played with highlightjs and have had nothing but incorrect detection).
Finaly, I'd love to contribute, and had thought to go ahead and write a
horrible patch considering I haven't read the entirety of the code base
ultimately not up to speed with the project from a programming
saw on the site that a contributors agreement is needed but I also
didn't see a
way to submit the agreement even if I did fill it out. I at the moment
someone other than myself could implement this feature correctly and
horribly than I could before I could manage to appropriately submit such
agreement. Even so, I'd like to get a contributors agreement on file so
anyone can help with that.
Lester L. Martin II
fossil-users mailing list