[Git][ghc/ghc][master] docs: Generate docs/index.html with version number

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Apr 14 08:18:45 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
d7a768a4 by Matthew Pickering at 2023-04-14T04:18:28-04:00
docs: Generate docs/index.html with version number

* Generate docs/index.html to include the version of the ghc library

* This also fixes the packageVersions interpolations which were
  - Missing an interpolation for `LIBRARY_ghc_VERSION`
  - Double quoting the version so that "9.7" was being inserted.

Fixes #23121

- - - - -


3 changed files:

- docs/index.html → docs/index.html.in
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs


Changes:

=====================================
docs/index.html → docs/index.html.in
=====================================
@@ -39,7 +39,7 @@
 
       <LI>
         <P>
-          <B><A HREF="libraries/ghc/index.html">GHC API</A></B>
+          <B><A HREF="libraries/ghc- at LIBRARY_ghc_VERSION@/index.html">GHC API</A></B>
         </P>
         <P>
           Documentation for the GHC API.


=====================================
hadrian/src/Rules/Documentation.hs
=====================================
@@ -193,7 +193,7 @@ buildHtmlDocumentation = do
                              | SphinxHTML `Set.member` doctargets ]
         need $ map ((root -/-) . pathIndex) targets
 
-        copyFileUntracked "docs/index.html" file
+        copyFile "docs/index.html" file
 
 -- | Compile a Sphinx ReStructured Text package to HTML.
 buildSphinxHtml :: FilePath -> Rules ()


=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -305,10 +305,10 @@ rtsCabalFlags = mconcat
     flag = interpolateCabalFlag
 
 packageVersions :: Interpolations
-packageVersions = foldMap f [ base, ghcPrim, ghc, cabal, templateHaskell, ghcCompact, array ]
+packageVersions = foldMap f [ base, ghcPrim, compiler, ghc, cabal, templateHaskell, ghcCompact, array ]
   where
     f :: Package -> Interpolations
-    f pkg = interpolateVar var $ show . version <$> readPackageData pkg
+    f pkg = interpolateVar var $ version <$> readPackageData pkg
       where var = "LIBRARY_" <> pkgName pkg <> "_VERSION"
 
 templateRule :: FilePath -> Interpolations -> Rules ()
@@ -335,6 +335,7 @@ templateRules = do
   templateRule "utils/ghc-pkg/ghc-pkg.cabal" $ projectVersion
   templateRule "libraries/template-haskell/template-haskell.cabal" $ projectVersion
   templateRule "libraries/prologue.txt" $ packageVersions
+  templateRule "docs/index.html" $ packageVersions
 
 
 -- Generators



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d7a768a415c3bd575a20b20ae9a3953aa5886ed7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d7a768a415c3bd575a20b20ae9a3953aa5886ed7
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230414/facfb047/attachment-0001.html>


More information about the ghc-commits mailing list