doc: Work around (htmlprag) parser issue.
* doc/build.scm (guile-lib/htmlprag-fixed): New variable. (syntax-highlighted-html): Use it instead of GUILE-LIB.
This commit is contained in:
		
							parent
							
								
									c3a7dae831
								
							
						
					
					
						commit
						7854bbeb3f
					
				
					 1 changed files with 31 additions and 1 deletions
				
			
		|  | @ -29,6 +29,7 @@ | ||||||
|              (guix gexp) |              (guix gexp) | ||||||
|              (guix git) |              (guix git) | ||||||
|              (guix git-download) |              (guix git-download) | ||||||
|  |              (guix utils) | ||||||
|              (git) |              (git) | ||||||
|              (gnu packages base) |              (gnu packages base) | ||||||
|              (gnu packages gawk) |              (gnu packages gawk) | ||||||
|  | @ -165,6 +166,35 @@ as well as images, OS examples, and translations." | ||||||
|   ;; Options passed to 'makeinfo --html'. |   ;; Options passed to 'makeinfo --html'. | ||||||
|   '("--css-ref=https://www.gnu.org/software/gnulib/manual.css")) |   '("--css-ref=https://www.gnu.org/software/gnulib/manual.css")) | ||||||
| 
 | 
 | ||||||
|  | (define guile-lib/htmlprag-fixed | ||||||
|  |   ;; Guile-Lib with a hotfix for (htmlprag). | ||||||
|  |   (package | ||||||
|  |     (inherit guile-lib) | ||||||
|  |     (source (origin | ||||||
|  |               (inherit (package-source guile-lib)) | ||||||
|  |               (modules '(( guix build utils))) | ||||||
|  |               (snippet | ||||||
|  |                '(begin | ||||||
|  |                   ;; When parsing | ||||||
|  |                   ;; "<body><blockquote><p>foo</p>\n</blockquote></body>", | ||||||
|  |                   ;; 'html->shtml' would mistakenly close 'blockquote' right | ||||||
|  |                   ;; before <p>.  This patch removes 'p' from the | ||||||
|  |                   ;; 'parent-constraints' alist to fix that. | ||||||
|  |                   (substitute* "src/htmlprag.scm" | ||||||
|  |                     (("^[[:blank:]]*\\(p[[:blank:]]+\\. \\(body td th\\)\\).*") | ||||||
|  |                      "")) | ||||||
|  |                   #t)))) | ||||||
|  |     (arguments | ||||||
|  |      (substitute-keyword-arguments (package-arguments guile-lib) | ||||||
|  |        ((#:phases phases '%standard-phases) | ||||||
|  |         `(modify-phases ,phases | ||||||
|  |           (add-before 'check 'skip-known-failure | ||||||
|  |             (lambda _ | ||||||
|  |               ;; XXX: The above change causes one test failure among | ||||||
|  |               ;; the htmlprag tests. | ||||||
|  |               (setenv "XFAIL_TESTS" "htmlprag.scm") | ||||||
|  |               #t)))))))) | ||||||
|  | 
 | ||||||
| (define* (syntax-highlighted-html input | (define* (syntax-highlighted-html input | ||||||
|                                   #:key |                                   #:key | ||||||
|                                   (name "highlighted-syntax") |                                   (name "highlighted-syntax") | ||||||
|  | @ -174,7 +204,7 @@ as well as images, OS examples, and translations." | ||||||
| to (1) add them a link to SYNTAX-CSS-URL, and (2) highlight the syntax of all | to (1) add them a link to SYNTAX-CSS-URL, and (2) highlight the syntax of all | ||||||
| its <pre class=\"lisp\"> blocks (as produced by 'makeinfo --html')." | its <pre class=\"lisp\"> blocks (as produced by 'makeinfo --html')." | ||||||
|   (define build |   (define build | ||||||
|     (with-extensions (list guile-lib guile-syntax-highlight) |     (with-extensions (list guile-lib/htmlprag-fixed guile-syntax-highlight) | ||||||
|       (with-imported-modules '((guix build utils)) |       (with-imported-modules '((guix build utils)) | ||||||
|         #~(begin |         #~(begin | ||||||
|             (use-modules (htmlprag) |             (use-modules (htmlprag) | ||||||
|  |  | ||||||
		Reference in a new issue