Skip to content

Commit

Permalink
Merge pull request #1347 from MangoIV/mangoiv/syntax-highlighting
Browse files Browse the repository at this point in the history
Add Syntax highglighting for package pages
  • Loading branch information
gbaz authored Nov 24, 2024
2 parents d8c8c21 + 611bc5f commit 962b6d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions datafiles/static/hackage.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ table {
font:100%;
}

pre {
border-radius: 3px;
}

pre, code, kbd, samp, .src {
font-family: monospace;
}
Expand Down
4 changes: 4 additions & 0 deletions datafiles/templates/Html/package-page.html.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<link href="$doc.baseUrl$/quick-jump.css" rel="stylesheet" type="text/css" title="QuickJump" />
$endif$
$hackageCssTheme()$
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/prism-solarizedlight.min.css" media="(prefers-color-scheme: light)" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/prism-tomorrow.min.css" media="(prefers-color-scheme: dark)" />
<title>
$package.name$$if(package.optional.hasSynopsis)$: $package.optional.synopsis$$endif$
</title>
Expand Down Expand Up @@ -293,6 +295,8 @@
[<a href="#description">back to package description</a>]
$package.optional.readme$
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/plugins/autoloader/prism-autoloader.min.js"></script>
$endif$
</div> <!-- /content -->

Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
echo 'Copying packages from real Hackage Server into local Hackage Server.'
echo 'This assumes the local Hackage Server uses default credentials;'
echo 'otherwise, override in nix-default-servers.cfg'
hackage-mirror nix-default-servers.cfg
hackage-mirror nix-default-servers.cfg "$@"
'';
};
packages.default = config.packages.hackage-server;
Expand Down

0 comments on commit 962b6d7

Please sign in to comment.