pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan S. Katz <jkatz@postgresql.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Duplicating website's formatting in local doc builds
Date: Tue, 11 Feb 2020 14:40:44 -0500
Message-ID: <4b44c4ec-a678-6586-fbb0-efc3299af203@postgresql.org> (raw)
In-Reply-To: <3873.1581449531@sss.pgh.pa.us>
References: <1375.1581446233@sss.pgh.pa.us>
	<d381c45a-880f-7b0d-773d-be117685a6ad@postgresql.org>
	<3873.1581449531@sss.pgh.pa.us>

On 2/11/20 2:32 PM, Tom Lane wrote:
> "Jonathan S. Katz" <jkatz@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

Attachments:

website-formatted-docs.patch (text/plain, 514B) download 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>
signature.asc (application/pgp-signature, 832B) download

view thread (18+ messages)  latest in thread

Message-ID: <4b44c4ec-a678-6586-fbb0-efc3299af203@postgresql.org>
Permalink:  ../4b44c4ec-a678-6586-fbb0-efc3299af203@postgresql.org/
Also on:    postgresql.org/message-id/4b44c4ec-a678-6586-fbb0-efc3299af203@postgresql.org

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: jkatz@postgresql.org, tgl@sss.pgh.pa.us, pgsql-docs@lists.postgresql.org
  Subject: Re: Duplicating website's formatting in local doc builds
  In-Reply-To: <4b44c4ec-a678-6586-fbb0-efc3299af203@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox