split func.sgml to separated individual sgml files

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-11-07T04:15:05Z
Lists: pgsql-hackers

Attachments

hi.

move to a new thread.
Since the old thread[1], many things have interacted together.

we are going to split func.sgml to 31 inviduaul sgml files.
the new file name pattern is "func-" as the prefix.
all the func-*.sgml files stored in doc/src/sgml/func
based on the original func.sgml line number,
each file has a line beginning and line end,
which is why the python script is long.


python3 v1-0001-split_func_sgml.py
git apply v1-0001-all-filelist-for-directory-doc-src-sgml-func.patch
execute the above two commands, we should go good to go.

The following is step-by-step logic.

#--step0 get line number info, and validate it.
in func.sgml, we have 62 "sect1", these corresponding to the line
begin and line end of the new sgml file.
so in func.sgml, we locate and validate it.
later we use the SED command to do the copy, and need these line
number information.

#--step1. create doc/src/sgml/func directory, move func.sgml to there.
create each new empty invidual sgml file

#---step2 construct sed copy commands and execute it.
This will roughly copy func.sgml content from line 52 to line 31655 to
corresponding new individual sgml file, based on
line number information.

#-----step3 validates that the new file only has 2 "sect1". also
validate new files "<sect1 id.*"is unique.".
just to make sure the output works fine.

#---setp4 truncate func.sgml begins from line 52.

#---step5 append place-holder string to func.sgml


[1]
https://www.postgresql.org/message-id/flat/CA%2BTgmoZ2F%2BK0j%3D6BOJLD%3DYfpJMdJRXC7sWmtXGRjx1Rq0x8PUA%40mail.gmail.com

Commits

  1. Revert "Improve docs syntax checking"

  2. Improve docs syntax checking

  3. Teach doc/src/sgml/Makefile about the new func/*.sgml files.

  4. Split func.sgml into more manageable pieces

  5. Doc: add check to detect non-breaking spaces in the docs.