Commit fe5e9641 authored by Christoph Cullmann's avatar Christoph Cullmann

nicer output, inside the normal sections

parent 6b2a1069
This diff is collapsed.
......@@ -39,6 +39,7 @@ print "Current version of syntax-highlighting: $currentVersion\n";
# Xml::Simple is not the fastest variant, but good enough for one single pass over all files
my %metaInfo;
my %nameToFile;
my $count = 0;
foreach my $xmlFile (<data/syntax/*.xml>) {
# parse the full file, we need a name!
my $xml = XMLin($xmlFile, keyattr => {});
......@@ -65,7 +66,12 @@ foreach my $xmlFile (<data/syntax/*.xml>) {
$metaInfo{$xmlFile}{"name"} = $name;
$metaInfo{$xmlFile}{"version"} = $version;
$metaInfo{$xmlFile}{"kateversion"} = $kateversion;
$nameToFile{$name} = $xmlFile;
# remember user visible stuff
if (!defined($xml->{'hidden'}) || $xml->{'hidden'} ne "1") {
$nameToFile{$xml->{'section'}}{$name} = $xmlFile;
++$count;
}
}
# now: generate all needed update-*.xml files
......@@ -99,19 +105,21 @@ while ($minorVersion <= $currentVersion) {
# we create some overview page, too, as markdown to brag about the amount of stuff we know .P
my $syntax_md = "../../content/syntax.md";
my $count = scalar %nameToFile;
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 $count languages:\n\n";
foreach my $name (sort keys %nameToFile) {
my $file = $nameToFile{$name};
"---\n\n".
"Kate's highlighting powered by [KSyntaxHighlighting](https://api.kde.org/frameworks/syntax-highlighting/html/) supports the follow $count languages.\n";
foreach my $section (sort keys %nameToFile) {
print $syntax_page "\n### $section\n";
foreach my $name (sort keys %{$nameToFile{$section}}) {
my $file = $nameToFile{$section}{$name};
my $version = $metaInfo{$file}{version};
print $syntax_page "* [$name](/syntax/$file)\n";
}
}
close($syntax_page);
......
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