#1269 Tag specfile blocks for syntax highlighting
Merged by tibbs. Opened by ferdnyc.
ferdnyc/packaging-committee alternatives-highlight  into  master

Download 1269.patch

rpm-spec syntax highlighting for:

  • guidelines/modules/ROOT/pages/Alternatives.adoc
  • guidelines/modules/ROOT/pages/AutoProvidesAndRequiresFiltering.adoc
  • guidelines/modules/ROOT/pages/CMake.adoc
  • guidelines/modules/ROOT/pages/Conflicts.adoc
  • guidelines/modules/ROOT/pages/CronFiles.adoc
  • guidelines/modules/ROOT/pages/Tmpfiles.d.adoc

Not included (Moved):

  • guidelines/modules/ROOT/pages/Web_Assets.adoc

6 new commits added

  • TmpFiles: Tag specfile blocks as rpm-spec
  • CronFiles: Tag specfile blocks as rpm-spec
  • Conflicts: Tag specfile blocks as rpm-spec
  • CMake: Tag specfile blocks as rpm-spec
  • Filtering: Tag specfile code blocks as rpm-spec
  • Alternatives: Tag specfile code blocks as rpm-spec

Actually, since I have #1268 open which makes major changes to the Web Assets doc, i moved the syntax highlighting changes over there as well, to avoid conflicts.

I was unaware that we actually had specfile syntax highlighting available, as we didn't originally. Seems reasonable to me that we should be trying to use it where possible.

rebased onto 7c35b1f653a16f3b246f3d5f064e0c29758dd3d9

Pull-Request has been merged by tibbs

@tibbs

I was unaware that we actually had specfile syntax highlighting available, as we didn't originally.

Yeah, it was a late addition; highlight.js doesn't have native support, but I tracked down a plugin which @darknao was nice enough to integrate into the Docs templates... almost exactly a year ago, looks like.

It's slightly imperfect, in non-catastrophic ways...

  1. The un-highlighted text in the listing switches from black-on-light-gray to light-gray-on-dark-blueish-gray, when the theme is flipped... but the syntax-highlighting colors are all the same for both modes. So that leaves some text a bit hard to make out, in dark mode. Fortunately that affects very little of the content, since most of the highlighting uses primary reds, blues, greens, oranges, etc. that show up fine against either background.
  2. That hljs plugin I mentioned uses a buggy, badly-ordered regex for keyword matching. It gives certain compound keywords like %ifarch two-tone highlighting: the %if is highlighted green, but the arch is left unhighlighted. That's fixed upstream now, but we haven't updated since.

But overall it mostly works, and it's a lot more comfortable than reading seas of black/white monospace text.

Metadata