Skip to content

Commit

Permalink
nixpkgs docs: Use SVGs for callouts
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Mar 26, 2018
1 parent 2b3ba40 commit a80856c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
10 changes: 6 additions & 4 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ validate: manual-full.xml

out/html/index.html: manual-full.xml style.css
mkdir -p out/html
xsltproc $$xsltFlags \
xsltproc ${xsltFlags} \
--nonet --xinclude \
--output $@ \
"$$XSL/docbook/xhtml/docbook.xsl" \
Expand All @@ -26,17 +26,19 @@ out/html/index.html: manual-full.xml style.css
cp ./style.css out/html/style.css

mkdir -p out/html/images/callouts
cp "$$XSL/docbook/images/callouts/"*.gif out/html/images/callouts/
cp "$$XSL/docbook/images/callouts/"*.svg out/html/images/callouts/
chmod u+w -R out/html/images/

out/epub/manual.epub: manual-full.xml
mkdir -p out/epub/scratch
xsltproc $$xsltFlags --nonet \
xsltproc ${xsltFlags} --nonet \
--output out/epub/scratch/ \
"$$XSL/docbook/epub/docbook.xsl" \
./manual-full.xml

cp "$$XSL/docbook/images/callouts/"*.gif out/epub/scratch/OEBPS
cp ./style.css out/epub/scratch/OEBPS
mkdir -p out/epub/scratch/OEBPS/images/callouts/
cp "$$XSL/docbook/images/callouts/"*.svg out/epub/scratch/OEBPS/images/callouts/
echo "application/epub+zip" > mimetype
zip -0Xq "out/epub/manual.epub" mimetype
rm mimetype
Expand Down
6 changes: 3 additions & 3 deletions doc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ pkgs.stdenv.mkDerivation {
xsltFlags = lib.concatStringsSep " " [
"--param section.autolabel 1"
"--param section.label.includes.component.label 1"
"--param html.stylesheet 'style.css'"
"--stringparam html.stylesheet 'style.css'"
"--param xref.with.number.and.title 1"
"--param toc.section.depth 3"
"--param admon.style ''"
"--param callout.graphics.extension '.gif'"
"--stringparam admon.style ''"
"--stringparam callout.graphics.extension .svg"
];

postPatch = ''
Expand Down
18 changes: 13 additions & 5 deletions doc/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ h2 /* chapters, appendices, subtitle */
}

/* Extra space between chapters, appendices. */
div.chapter > div.titlepage h2, div.appendix > div.titlepage h2
{
div.chapter > div.titlepage h2, div.appendix > div.titlepage h2
{
margin-top: 1.5em;
}

Expand Down Expand Up @@ -118,6 +118,14 @@ div.example pre.programlisting
margin: 0 0 0 0;
}

.programlisting img {
width: 1em;
}


.calloutlist img {
width: 1.5em;
}

/***************************************************************************
Notes, warnings etc:
Expand Down Expand Up @@ -172,7 +180,7 @@ div.navfooter *


/***************************************************************************
Links colors and highlighting:
Links colors and highlighting:
***************************************************************************/

a { text-decoration: none; }
Expand Down Expand Up @@ -209,7 +217,7 @@ tt, code
.term
{
font-weight: bold;

}

div.variablelist dd p, div.glosslist dd p
Expand Down Expand Up @@ -252,4 +260,4 @@ table
div.affiliation
{
font-style: italic;
}
}

0 comments on commit a80856c

Please sign in to comment.