diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2020-12-04 20:19:26 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-12-07 23:49:55 +0100 |
commit | 16dfe8d7f29161d088348d5d42e89ffe91807311 (patch) | |
tree | fb7e493a1af9abe3608833d9e9f2d571fe58ae2f /pkgs/development/tools/pandoc | |
parent | e4c3cda197800bed60b01c26dbbafca02ab1da77 (diff) | |
download | nixlib-16dfe8d7f29161d088348d5d42e89ffe91807311.tar nixlib-16dfe8d7f29161d088348d5d42e89ffe91807311.tar.gz nixlib-16dfe8d7f29161d088348d5d42e89ffe91807311.tar.bz2 nixlib-16dfe8d7f29161d088348d5d42e89ffe91807311.tar.lz nixlib-16dfe8d7f29161d088348d5d42e89ffe91807311.tar.xz nixlib-16dfe8d7f29161d088348d5d42e89ffe91807311.tar.zst nixlib-16dfe8d7f29161d088348d5d42e89ffe91807311.zip |
pandoc: Add patches for nixpkgs docs
Until we update pandoc, these are necessary for faithful Markdown to Docbook conversion in the manual. The following features are necessary for many pages, in particular the GNOME platform docs: * Anchors should use `xml:id` attribute, as mandated by Docbook 5. * Admonitions should be supported, including titles. Additionally, xmlns should be set correctly for root element.
Diffstat (limited to 'pkgs/development/tools/pandoc')
-rw-r--r-- | pkgs/development/tools/pandoc/default.nix | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/pkgs/development/tools/pandoc/default.nix b/pkgs/development/tools/pandoc/default.nix index 0bf9ce71e481..dbee7631fe00 100644 --- a/pkgs/development/tools/pandoc/default.nix +++ b/pkgs/development/tools/pandoc/default.nix @@ -1,4 +1,4 @@ -{ haskellPackages, haskell, removeReferencesTo }: +{ haskellPackages, fetchpatch, haskell, removeReferencesTo }: let static = haskell.lib.justStaticExecutables haskellPackages.pandoc; @@ -8,6 +8,30 @@ in configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"]; buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed]; buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ]; + patches = (drv.patches or []) ++ [ + # Add xmlns to top-level tags in Docbook, required for nixpkgs manual. + # https://github.com/jgm/pandoc/pull/6923 + (fetchpatch { + url = "https://github.com/jgm/pandoc/commit/6f35600204132c5a0907bb7cccb2e10ffb27506a.patch"; + sha256 = "gRUqc4YG4lZdCZn21fPmlcrFyZ3/VlDx71lU8GMuGSs="; + }) + # Generate admonitions in DocBook, required for nixpkgs manual. + # https://github.com/jgm/pandoc/pull/6922 + (fetchpatch { + url = "https://github.com/jgm/pandoc/commit/dc6856530c2cb6ca58ed82721ab895b86cfe0c1c.patch"; + sha256 = "EdsUDlHzsfRscXBR4EP2Z5ZEz+NfrmFHnV7c1hJczio="; + }) + # Use correct id attributes in DocBook, required for nixpkgs manual. + (fetchpatch { + url = "https://github.com/jgm/pandoc/commit/16ef87745702f69d5aa948fbe6d2101577dee8f4.patch"; + sha256 = "WyWTqrO6hGsMgJ7o7QL1BNvhkm0yIO1XJOcfPBDy6ag="; + }) + # Allow using admonition titles from Markdown in DocBook. + (fetchpatch { + url = "https://github.com/jgm/pandoc/commit/70c7c5703afcbd1cbf2a80c2be515e038abcd419.patch"; + sha256 = "2kHQ1qy/UdDi/chwCBvMjAPA/XFH42vWFCjR46Jgt6M="; + }) + ]; })).overrideAttrs (drv: { # These libraries are still referenced, because they generate |