The Discourse forum can do syntax highlighting for various languages and formats. For example, for HTML:
<a href="https://mattdm.org">mattdm.org</a>
One of the people at Discourse was kind enough to create an add on (a “theme component”) for this site which enables RPM syntax highlighting, using GitHub - highlightjs/highlightjs-rpm-specfile. (The theme component source is https://github.com/discourse/discourse-highlightjs-rpm.)
This seems to sort of work
Name: dateutils
Version: 0.4.10
Release: %autorelease
Summary: Command-line date and time calculation, conversion, and comparison
License: BSD
URL: http://www.fresse.org/dateutils/
Source0: https://github.com/hroptatyr/dateutils/releases/download/v%{version}/%{name}-%{version}.tar.xz
BuildRequires: gcc
BuildRequires: make
%description
Tools which revolve around fiddling with dates and times on the command
line, with a strong focus on use cases that arise when dealing with large
amounts of financial data.
%prep
%autosetup -p1
… in that it’s identifying and bolding %description
and %prep
and so on. But looking at discourse-highlightjs-rpm/rpm-highlightjs.js at main · discourse/discourse-highlightjs-rpm · GitHub makes me think it should be handling Name:, Release:, etc. and other things too. Because:
{
className: "type",
begin: /^(Name|BuildRequires|BuildConflicts|Version|Release|Epoch|Summary|Group|License|Packager|Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|Requires\(?[a-z]*\)?|[a-zA-Z]+Req|Obsoletes|Recommends|Suggests|Supplements|Enhances|Provides|Conflicts|RemovePathPostfixes|Build[a-zA-Z]+|[a-zA-Z]+Arch|Auto[a-zA-Z]+)(:)/,
},
… and there are other sections too.
Could someone take a look and see if there’s some obvious reason this isn’t happening?
Thank you!