On 2/11/20 2:32 PM, Tom Lane wrote:
> "Jonathan S. Katz" <jk...@postgresql.org> writes:
>> On 2/11/20 1:37 PM, Tom Lane wrote:
>>> I also wonder why duplicating the website's style isn't the default.
>>> Doesn't seem like having authors optimize for some other style is
>>> what we really want.
> 
>> Oh, and specifically for this, my guess is because it requires one to
>> make a call over a network to load the stylesheet. :)
> 
> Surely we could provide directions about how to store that locally.

I have a little doubt about that, but per mention in the original email,
it means storing a lot more stylesheets and ones that may change with
more frequency than the project. It may not be too much of an issue, but
I do want to note that. I'm somewhat ambivalent myself, but my
preference is to have the single source of truth.

Anyway, attached is a first attempt at a patch. I tried a few different
variations but in my quick review of it, I could not figure out how to
make a XSLT respect having multiple stylesheets (likely due to my lack
of familiarity with XSLT).

This just swaps out the link. A better approach would be to find a way
to include multiple CSS stylesheets. After searching over a bunch of
different terms, I could not figure out how to get to this result, but
as mentioned, I'm close to clueless on writing XSLT at this point.

Another way we could get to the desired result add something to pgweb
similar to the old "docs.css" that is being referenced that combines the
multiple stylesheets into one. It's a bit of an anti-pattern in modern
web, so I'm not thrilled to go down that route.

Jonathan
diff --git a/doc/src/sgml/stylesheet.xsl b/doc/src/sgml/stylesheet.xsl
index 4ff6e8ed24..38434367f1 100644
--- a/doc/src/sgml/stylesheet.xsl
+++ b/doc/src/sgml/stylesheet.xsl
@@ -23,7 +23,7 @@
 <xsl:param name="html.stylesheet">
   <xsl:choose>
     <xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
-    
<xsl:otherwise>https://www.postgresql.org/media/css/docs.css</xsl:otherwise>
+    
<xsl:otherwise>https://www.postgresql.org/media/css/base.css</xsl:otherwise>
   </xsl:choose>
 </xsl:param>
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to