Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j1rrM-0002Yb-LL for pgsql-docs@arkaria.postgresql.org; Wed, 12 Feb 2020 13:15:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j1rrJ-0006rn-PH for pgsql-docs@arkaria.postgresql.org; Wed, 12 Feb 2020 13:15:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j1rrJ-0006rg-HS for pgsql-docs@lists.postgresql.org; Wed, 12 Feb 2020 13:15:17 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j1rrH-0001Ut-AE for pgsql-docs@lists.postgresql.org; Wed, 12 Feb 2020 13:15:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:References:Cc:To:From:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WoySHneWZ0on7EDRBpXI6ph+MkT9IHPtQ9bS65jucmE=; b=saW3cGYvQa1FOAFTbIsvpvqETt /ovGwH5ONGzvulTawveXtLH8wu90eVaRVw/3TKNFxzMJurRQq0GxXo48Q2pBdgn/aN5Wn1R9cxws6 2v9D3UFqwGMpwEiwwCraYHtN2dn4fTOvuJkDYqKlNuTRjY63R4zFuxEEQiqH8KpuGzLFEGRQ6URh0 V1XcR+6czaJz9UHkdoYhTJ8nslDOuTbi0/dA3pC7vaerkSwuFL3l7/mzapA/R4umJD2b1PR4lIPqb JRVSqATInXXiJFITlrvaj2VuNOzPpCMOk5rzHcsvhAnnM9Lq3r4pNd3QRccQzc0BOY8qyCnEFRPIJ qZz4PC4A==; Received: from [63.117.104.74] (helo=Ph33rHippo.local) by meldrar.postgresql.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j1rrE-0000k4-Ec; Wed, 12 Feb 2020 13:15:15 +0000 Subject: Re: Duplicating website's formatting in local doc builds From: "Jonathan S. Katz" To: Peter Geoghegan Cc: Tom Lane , Pg Docs References: <1375.1581446233@sss.pgh.pa.us> <3873.1581449531@sss.pgh.pa.us> <4b44c4ec-a678-6586-fbb0-efc3299af203@postgresql.org> <86f03290-e60c-855e-786a-d1b75c254811@postgresql.org> Autocrypt: addr=jkatz@postgresql.org; keydata= mQINBFtShwABEAC7PNHDUOTYuifpUCk23KqfxdQQkn4nkoxOXRK0+rAj36FiwqGB4TJFuOVZ sDFAEiSlC8Jt4y5Cs7B5tetT8JNd2cs6zp/udMJJDz9d65O9PDpdlMgAmIiTzpLlSdx8FG56 DTksaDv1d8j3cTJPSE4/fWSxqzA7o3Y9UuL7atZPrzfImgpRKs0of7elIHwOa8GucjyhYqcR h60wFBJc2KXqQdDYRTZy43DSnY/0VNc0omiH355fustvpm+m5HjD3w7qZyfN3fpKJpnX1LCF f3MnPHaDGITIYGRCBXvf0UqUtD6OEVWPv2C2gyqWMIpWmZTOgDufltKyIByKBoS9x0PlFkij 04X3KODCngt+N8Ssc9OICc6QSxhjoP48PYPdmiTmkrGuf0LX084wj1xeo1NX7XxZK39F6dTJ DhsIiW0sNS0xMxQHLHG9VLbPjx3SANQBh6BuryPz5ZupW9/TIDmkvprtU/oXfKgtfYm3fxmk EctxbWrEPsFTFPyuMqQu6l+xyQv0s1VLZfjNWaua6H1/gGoIt6kRnn5qMXDVVpijuWkHbv7G ngaQMd258UrrOEHnnjzhQ7jxMWV9D+emxbAtlIxnYvCWlV4IwAQhE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Q6KKfqzAwh6FxrO5qajp4viNIgtWoFw O5Bp0jgFTbH2OrMWIRfUdUCH1Djbuo65svhNj7FNsQVYzHDI+Nd1I/LOBoPc3UorRMF2M4JV kUR7skOHWUbPTSNUr7qc14NSMY3PKjGeVGAsBVHBPvmRx/Ss2tW/TpJWpxg4pmquFQSXuaYh Yf4FN8Sxy320pcr+FqN8AhZkYJcNY82OTtR5VEKRC/mYcyq61qXIKqngydn79bJjGxHipxyF FmEC Message-ID: <716a39ec-6f56-0280-8d4b-b246176c6a3d@postgresql.org> Date: Wed, 12 Feb 2020 08:15:08 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <86f03290-e60c-855e-786a-d1b75c254811@postgresql.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I7qkGF2L0NU0mDantUjuN6lWBpl8b1qba" X-Host-Lookup-Failed: Reverse DNS lookup failed for 63.117.104.74 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --I7qkGF2L0NU0mDantUjuN6lWBpl8b1qba Content-Type: multipart/mixed; boundary="d2eabd0UWZwS1UFQjC8EyhouJalqSLbej" --d2eabd0UWZwS1UFQjC8EyhouJalqSLbej Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2/11/20 10:56 PM, Jonathan S. Katz wrote: > On 2/11/20 3:49 PM, Jonathan S. Katz wrote: >> On 2/11/20 3:41 PM, Peter Geoghegan wrote: >>> On Tue, Feb 11, 2020 at 11:40 AM Jonathan S. Katz wrote: >>>> Anyway, attached is a first attempt at a patch. I tried a few differ= ent >>>> 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 la= ck >>>> of familiarity with XSLT). >>> >>> I tried this patch out. >> >> Thanks! >> >>> The alignment is a little off, since the docs >>> don't appear in the website's frame, and lack the website's header. I= t >>> would be nice if the same margins appeared to the left and to the >>> right.=20 >> >> Yup, that's a direct result of not having the Bootstrap base. >> >>> But even still, it's a vast improvement. >> >> Cool. >=20 > I played around with this for a bit longer, became a bit more familiar > with DocBook[1] (and a lot of other pages, but this one seemed > relevant), and here is what I came up with: >=20 > As I mentioned, the way pgweb works is that it wraps a root element (th= e >
...
) around the imported HTMl from the > generation, which allows it to apply the various website styles. This i= s > important, because it allows us to apply some general style rules, but > namespace them specifically to the documentation. Hold this thought for= > a moment. >=20 > When calling "make STYLE=3Dwebsite html", this turns on a flag that emb= eds > the URL to the old "docs.css" content that we generated. I did an > experiment where I overloaded the "dynamic CSS generator" we have in ou= r > code to include the bootstrap.css files (as well as some others) in > addition to our new base CSS. This demonstrated a marked improvement in= > the output from the above command, but it was still not perfect: the CS= S > rules still expect there to be the #docContent namespace. >=20 > I thought this would be a good area to explore to see if I could get th= e > #docContent ID wrapped around the content body. As I was writing this > note (where actually I was about to throw in the towel), on a hunch I > improved my Googling and found a solution (attached). >=20 > This works with pgweb as pgweb extracts the content from the tag= > that is generated by "make html" so this is unaffected. >=20 > For this solution to fully work, I also need to make a patch to pgweb. = I > have it 80% done, where the final 20% is getting rid of some annoying > errors of files it is looking for (the Bootstrap minification expects a= > CSS map file. I believe I can silence that). >=20 > It's not perfect: we don't have a full container around the generated > documentation so you can't see it exactly in terms of how it's render o= n > the website, but it's way closer to the look and feel. I might be able > to add a few more attributes to make it look closer to the website in > that regard, though after there is consensus that this approach is ok. >=20 > That said, I think this is a happy compromise that allows said mode to > appear mostly like what you would find on the website. Realizing this might be a bit wonky to test, I made the necessary changes to pgweb and pushed those, so the results of the patch now look like what I was seeing. If you were previously testing it, rebuild the docs with STYLE=3Dwebsite and it should now look better. Thanks, Jonathan --d2eabd0UWZwS1UFQjC8EyhouJalqSLbej-- --I7qkGF2L0NU0mDantUjuN6lWBpl8b1qba Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE+oS2la8r95ogZD/x8QSccp8cZScFAl5D+lwACgkQ8QSccp8c ZScjLA//RnDjH+T2Lydi/D0u4YZ5QFzp1XADG2EkGN95wORFFbPuT15VNbr3xGif NCVPs7GUaH58rbJbLx/co+GbfvWdk/MFw+rBlDr65t2WUw54awbGGyO6pgi74fp+ 4HMfgLgH4KZjYseWmcMk1hdZGElSPY018wDr8bB3QmHFF0pttSdquvy8Sk0dgMP1 kGHVNVIYsi9xzETSEWaCbWKrFiE6+DGvHeWItHxLm6iT7T5/5qz0dtvIF8veQG+i X8JkyagLI3GltB/d+CKJih70OoUYQhG7OvVMLgt70sqpk3/eNFVgWyxLfPC1x8D/ DGlo7Hc2pjJb8stkBX9YoashM+e/UKvgWKO7H8SjeYNxVBXwd4ry+p5xUWj+A7EN 9c1tkb10m9w0Hc4+JIqL5hrpsA3X3nClp1VMKgTZsyRUzA1HRCB9jcGe8Vi/4y+i 75nSF3sQIiiNy1KMRyztAugZAX2IjXRteySfe7Q78KFzi1oZPv/LEwPSPNTt5+++ 7SvlcRrjIvyBp/kE7110nJJIfjJiWIJ+SYpDB+4OLG6hGLR10J3VgcGhZm2G+U8o EFhzCNybj5pgH88fJVe0zqltfS0RZ35exKrwqPWOOBMYtMiWC1kwSBBTYirdzv6F iLiQT3hvveQaXemHISwhMcEhkBPunXXtq1WZ+yokqqM0/znQT/k= =mqZu -----END PGP SIGNATURE----- --I7qkGF2L0NU0mDantUjuN6lWBpl8b1qba--