1. 6
  1. 1
    1. 0

      If you were to get rid of prism.js and use static highlighting, how would you go about it?

      1. 3

        My personal static website generator uses gomarkdown and I just modified the renderer to pass through to chroma, which ends up looking like this. Obviously you could also use the original python pygments project this too, which is what I used to do when doing “staged” shell based rendering.

        1. 2

          I was also looking at https://www.gnu.org/software/src-highlite/ and considering building one myself in C (pretty sure I will at some point), but for web sites, I prefer to keep it on the client side in order to keep a clean HTML file.

          1. 2

            That highlighting where package is colored as a keyword but function isn’t hurts to look at. ;) Since they list Ada in supported languages, it clearly warrants a pull request. Maybe I should make one.

            1. 1

              I actually attempt to auto-detect the language using Chroma in an effort to backport some colors into my older posts (like the one linked), it detected incorrectly. I gave it a hint and now it should look better, thanks for pointing it out.

          2. 2

            Can you recommend me a good static highlighter? I think prism.js fits well for progressive ehancement,it doesn’t mess up the mark up for presentation.

            1. 3

              highlight is nice. I’m mostly asking about the workflow, what it would look like in the page source.

              Ever since I’ve joined IASSGA[1] I’ve been thinking about generator workflows and their implications quite a lot. In soupault 1.7 we’ve added a function for piping element content through an external process, that was meant to enable using any syntax highlighter. Then I realized that you could also use it for adding a rendered version of that content alongside the source, instead of replacing the content.

              [1] International Association of Static Site Generator Authors

              1. 1

                I’m mostly asking about the workflow, what it would look like in the page source.

                I wouldn’t, haha, but probably an HEREDOC:

                <h1>Highlight example</h1>
                <code class=js>
                hl << EOF
                function foo() {
                        var a = 1
              2. 1

                Chroma is nice

                  1. 0

                    I really like microlight.js and it’s simple enough to port it to other programming languages (and use it for static highlighting).

                Stories with similar links:

                1. New mkws website and doc pages authored by adi_onl 1 year ago | 1 point | 2 comments
                2. mkws(1) - Added Linux version and updated the website authored by adi_onl 1 year ago | 22 points | 3 comments