On 2/14/20 6:06 PM, Tom Lane wrote:
> "Jonathan S. Katz" <jk...@postgresql.org> writes:
>> To load the webfont, the "main.css" file uses a CSS "@import"
>> instruction, which has a limitation that it can only be used as the top
>> of the file. As main.css is not the first file in the "docs.csS"
>> sandwich, it does not load.
>> Buried in some version of the DocBook[1] documentation were in
>> instructions on how to load in multiple stylesheets via
>>      <xsl:param name="html.stylesheet">
>> which I followed in our XSLT, which lead to that portion of the diff.
> It looks to me like the main text font now matches, but the font used for
> <literal> text doesn't quite -- see the attached, and note for example the
> capital T's in CREATE TYPE.  (Local build with this patch on the left,
> website on the right.)  Still, it's enormously closer than before.

Hmm, I'm not getting that. They're both identical for me, at least in

...but I hopped over into Safari, and I saw a difference between the
local file in Chrome, and what .org looks like in Safari.

I dove into this a bit. For this view, we are just using the default
"monospace" font that is referenced by a particular browser. It seems
like there was a change in Safari 12 where you can no longer override
the default monospace font. It appears to be using "SF Mono."

In Chrome, it appears that it is using Courier.

A potential solution is that we drop the use of "monospace" in relying
on the OS default and just pick a font. I would say that this is outside
the scope of the patch that's being proposed, but certainly something to
look into on the pgweb side given we're creating an inconsistent
cross-browser experience.

>> Not included is one of Tom's original questions, which is should we just
>> make using the website styles the default? As it stands, this would
>> require network connectivity to preview the look for a page. If we want
>> to ensure consistent views across the board, then I would say we import
>> the stylesheets, knowing that "main.css" is volatile.
> The point about network access seems to me to be sufficient reason not
> to make it the default.  I'd actually say that we ought to annotate
> section J.3.1 to point out that "make STYLE=website" will result in
> that.  However, I'm not quite clear on whether that means external
> access during viewing, or during build, or both?  The note should say.

It would only be during viewing -- the build just puts the URL into the
HTML file.

But don't take my word for it, please see the attached patch ;)

diff --git a/doc/src/sgml/docguide.sgml b/doc/src/sgml/docguide.sgml
index c99198f5e5..17f2bf42ac 100644
--- a/doc/src/sgml/docguide.sgml
+++ b/doc/src/sgml/docguide.sgml
@@ -276,6 +276,43 @@ checking for fop... fop
 <prompt>doc/src/sgml$ </prompt><userinput>make STYLE=website html</userinput>
+   <para>
+    Viewing the documentation built using the <ulink
+    url="https://www.postgresql.org/docs/current/";>postgresql.org</ulink>
+    stylesheet requires Internet connectivity, as the HTML pages contain
+    references to remotely hosted stylesheets, including:
+    <itemizedlist>
+     <listitem>
+      <para>
+       <ulink url="https://www.postgresql.org/media/css/fontawesome.css";>
+        https://www.postgresql.org/media/css/fontawesome.css
+       </ulink>
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       <ulink url="https://www.postgresql.org/media/css/bootstrap.min.css";>
+        https://www.postgresql.org/media/css/bootstrap.min.css
+       </ulink>
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       <ulink url="https://www.postgresql.org/media/css/main.css";>
+        https://www.postgresql.org/media/css/main.css
+       </ulink>
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       <ulink url="https://www.postgresql.org/media/css/normalize.css";>
+        https://www.postgresql.org/media/css/normalize.css
+       </ulink>
+      </para>
+     </listitem>
+    </itemizedlist>
+   </para>
diff --git a/doc/src/sgml/stylesheet-html-common.xsl 
index 9edce52a10..d9961089c6 100644
--- a/doc/src/sgml/stylesheet-html-common.xsl
+++ b/doc/src/sgml/stylesheet-html-common.xsl
@@ -18,6 +18,14 @@
 <xsl:param name="link.mailto.url">pgsql-docs@lists.postgresql.org</xsl:param>
 <xsl:param name="toc.max.depth">2</xsl:param>
+  The below allows the stylesheets provided by the website to be applied fully
+  to the generated HTML.
+  -->
+<xsl:template name="body.attributes">
+  <xsl:attribute name="id">docContent</xsl:attribute>
+  <xsl:attribute name="class">container-fluid col-10</xsl:attribute>
 <!-- Change display of some elements -->
diff --git a/doc/src/sgml/stylesheet.xsl b/doc/src/sgml/stylesheet.xsl
index 4ff6e8ed24..bc5a904e0b 100644
--- a/doc/src/sgml/stylesheet.xsl
+++ b/doc/src/sgml/stylesheet.xsl
@@ -23,11 +23,15 @@
 <xsl:param name="html.stylesheet">
     <xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
+    <xsl:otherwise>
+      https://www.postgresql.org/media/css/fontawesome.css
+      https://www.postgresql.org/media/css/bootstrap.min.css
+      https://www.postgresql.org/media/css/main.css
+      https://www.postgresql.org/media/css/normalize.css
+    </xsl:otherwise>
 <!-- strip directory name from image filerefs -->
 <xsl:template match="imagedata/@fileref">
  <xsl:value-of select="substring-after(., '/')"/>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to