Home Explore Blog CI



postgresql

4th chunk of `doc/src/sgml/docguide.sgml`
75e6ed01e5a3f0e2ecb4cd6b3051f94bec580045f80d89cf0000000100000fa0
 run <command>meson setup</command> as described in
   <xref linkend="install-meson"/>, and then see
   <xref linkend="docguide-build-meson"/>.
  </para>
  </sect2>
 </sect1>

 <sect1 id="docguide-build">
  <title>Building the Documentation with Make</title>

  <para>
   Once you have everything set up, change to the directory
   <filename>doc/src/sgml</filename> and run one of the commands
   described in the following subsections to build the
   documentation. (Remember to use GNU make.)
  </para>

  <sect2 id="docguide-build-html">
   <title>HTML</title>

   <para>
    To build the <acronym>HTML</acronym> version of the documentation:
<screen>
<prompt>doc/src/sgml$ </prompt><userinput>make html</userinput>
</screen>
    This is also the default target.  The output appears in the
    subdirectory <filename>html</filename>.
   </para>

   <para>
    To produce HTML documentation with the stylesheet used on <ulink
    url="https://www.postgresql.org/docs/current/">postgresql.org</ulink> instead of the
    default simple style use:
<screen>
<prompt>doc/src/sgml$ </prompt><userinput>make STYLE=website html</userinput>
</screen>
   </para>

   <para>
    If the <literal>STYLE=website</literal> option is used, the generated HTML
    files include references to stylesheets hosted on <ulink
    url="https://www.postgresql.org/docs/current/">postgresql.org</ulink> and
    require network access to view.
   </para>
 </sect2>

 <sect2 id="docguide-build-manpages">
  <title>Manpages</title>

  <para>
   We use the DocBook XSL stylesheets to
   convert <productname>DocBook</productname>
   <sgmltag>refentry</sgmltag> pages to *roff output suitable for man
   pages.  To create the man pages, use the command:
<screen>
<prompt>doc/src/sgml$ </prompt><userinput>make man</userinput>
</screen>
  </para>
 </sect2>

  <sect2 id="docguide-build-pdf">
   <title>PDF</title>

   <para>
    To produce a PDF rendition of the documentation
    using <productname>FOP</productname>, you can use one of the following
    commands, depending on the preferred paper format:

    <itemizedlist>
     <listitem>
      <para>
       For A4 format:
<screen>
<prompt>doc/src/sgml$ </prompt><userinput>make postgres-A4.pdf</userinput>
</screen>
      </para>
     </listitem>

     <listitem>
      <para>
       For U.S. letter format:
<screen>
<prompt>doc/src/sgml$ </prompt><userinput>make postgres-US.pdf</userinput>
</screen>
      </para>
     </listitem>
    </itemizedlist>
   </para>

   <para>
    Because the PostgreSQL documentation is fairly
    big, <productname>FOP</productname> will require a significant amount of
    memory.  Because of that, on some systems, the build will fail with a
    memory-related error message.  This can usually be fixed by configuring
    Java heap settings in the configuration
    file <filename>~/.foprc</filename>, for example:
<programlisting>
# FOP binary distribution
FOP_OPTS='-Xmx1500m'
# Debian
JAVA_ARGS='-Xmx1500m'
# Red Hat
ADDITIONAL_FLAGS='-Xmx1500m'
</programlisting>
    There is a minimum amount of memory that is required, and to some extent
    more memory appears to make things a bit faster.  On systems with very
    little memory (less than 1 GB), the build will either be very slow due to
    swapping or will not work at all.
   </para>

   <para>
    In its default configuration <productname>FOP</productname> will emit an
    <literal>INFO</literal> message for each page. The log level can be
    changed via <filename>~/.foprc</filename>:
<programlisting>
LOGCHOICE=-Dorg.apache.commons.logging.Log=&zwsp;org.apache.commons.logging.impl.SimpleLog
LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=WARN
</programlisting>
   </para>

   <para>
    Other XSL-FO processors can also be used manually, but the automated build
    process only supports FOP.
   </para>
  </sect2>

  <sect2 id="docguide-build-syntax-check">
   <title>Syntax Check</title>

   <para>
    Building the documentation can take very long.  But

Title: Building PostgreSQL Documentation
Summary
This section describes the process of building PostgreSQL documentation using Make, including building HTML, manpages, and PDF versions, and provides instructions on how to customize the build process, troubleshoot common issues, and use alternative XSL-FO processors.