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
- v1-0001-split_func_sgml.py (text/x-python)
- v1-0001-all-filelist-for-directory-doc-src-sgml-func.patch (text/x-patch) patch v1-0001
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
-
Revert "Improve docs syntax checking"
- 5b5e8a29c13a 19 (unreleased) landed
-
Improve docs syntax checking
- b29225627262 19 (unreleased) landed
-
Teach doc/src/sgml/Makefile about the new func/*.sgml files.
- 170a8a3f4605 19 (unreleased) cited
-
Split func.sgml into more manageable pieces
- 4e23c9ef65ac 19 (unreleased) landed
-
Doc: add check to detect non-breaking spaces in the docs.
- 5b7da5c261d1 18.0 cited