Commit 38f600fa authored by Christoph Cullmann's avatar Christoph Cullmann

add some page listing all supported syntax highlightings

parent 321fc727
......@@ -143,11 +143,17 @@ enableRobotsTXT = true
url = "/the-team/"
weight = 110
[[menu.main]]
parent = "menu"
name = "Syntax Highlighting"
url = "/syntax/"
weight = 120
[[menu.main]]
parent = "menu"
name = "Impressum"
url = "/impressum/"
weight = 120
weight = 130
# maximal privacy
[privacy]
......
This diff is collapsed.
......@@ -38,6 +38,7 @@ print "Current version of syntax-highlighting: $currentVersion\n";
# read all syntax files and remember for their version infos!
# Xml::Simple is not the fastest variant, but good enough for one single pass over all files
my %metaInfo;
my %nameToFile;
foreach my $xmlFile (<data/syntax/*.xml>) {
# parse the full file, we need a name!
my $xml = XMLin($xmlFile, keyattr => {});
......@@ -64,6 +65,7 @@ foreach my $xmlFile (<data/syntax/*.xml>) {
$metaInfo{$xmlFile}{"name"} = $name;
$metaInfo{$xmlFile}{"version"} = $version;
$metaInfo{$xmlFile}{"kateversion"} = $kateversion;
$nameToFile{$name} = $xmlFile;
}
# now: generate all needed update-*.xml files
......@@ -94,3 +96,23 @@ while ($minorVersion <= $currentVersion) {
# next one
++$minorVersion;
}
# we create some overview page, too, as markdown to brag about the amount of stuff we know .P
my $syntax_md = "../../content/syntax.md";
open (my $syntax_page, ">$syntax_md");
print $syntax_page
"---\n".
"title: Syntax Highlightings\n".
"author: Christoph Cullmann\n".
"date: 2019-08-24T12:12:12+00:00\n".
"---\n".
"Kate's highlighting powered by [KSyntaxHighlighting](https://api.kde.org/frameworks/syntax-highlighting/html/) supports the follow languages:\n\n";
foreach my $name (sort keys %nameToFile) {
my $file = $nameToFile{$name};
my $version = $metaInfo{$file}{version};
print $syntax_page "* [$name](/syntax/$file)\n";
}
close($syntax_page);
# add to git
system("git add $syntax_md") == 0 || die "Failed to add $syntax_md to git!\n";
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment