Make PostgreSQL documentation in mobi format

1. Download the source code:

git clone -b REL_10_STABLE git://git.postgresql.org/git/postgresql.git pg10
cd pg10
git branch
[root@localhost postgresql]# git branch
* REL_10_STABLE

2. Install the corresponding dependency package:

yum install docbook-dtds docbook-style-xsl fop libxslt opensp

Reference: https://www.postgresql.org/docs/current/static/docguide-toolsets.html

3. Preparation:

./configure
cd pg10
cd doc/src/sgml

4. Compile:

[root@localhost sgml]# make postgres.epub
{ \
  echo "<!ENTITY version \"10.0\">"; \
  echo "<!ENTITY majorversion \"10\">"; \
} > version.sgml
'/usr/bin/perl' ./mk_feature_tables.pl YES ../../../src/backend/catalog/sql_feature_packages.txt ../../../src/backend/catalog/sql_features.txt > features-supported.sgml
'/usr/bin/perl' ./mk_feature_tables.pl NO ../../../src/backend/catalog/sql_feature_packages.txt ../../../src/backend/catalog/sql_features.txt > features-unsupported.sgml
'/usr/bin/perl' ./generate-errcodes-table.pl ../../../src/backend/utils/errcodes.txt > errcodes-table.sgml
/usr/bin/osx -wall -wno-unused-param -wno-empty -wfully-tagged -D . -D . -x lower postgres.sgml >postgres.xml.tmp
'/usr/bin/perl' -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' -e '$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $. == 1;' <postgres.xml.tmp > postgres.xml
rm postgres.xml.tmp
/usr/bin/xmllint --noout --valid postgres.xml
/usr/share/sgml/docbook/xsl-stylesheets-1.78.1/epub/bin/dbtoepub postgres.xml

[root@localhost sgml]# 
[root@localhost sgml]# ls postgres.epub 
postgres.epub

5. Copy it out and convert it. I used the software calibre to convert it.

Download link: https://pan.baidu.com/s/1o7O2MeA

Welcome to download the collection, thank you.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324371500&siteId=291194637