build missing man pages and correct HTML renderings#4851
Merged
chrisd8088 merged 6 commits intogit-lfs:mainfrom Feb 7, 2022
Merged
build missing man pages and correct HTML renderings#4851chrisd8088 merged 6 commits intogit-lfs:mainfrom
chrisd8088 merged 6 commits intogit-lfs:mainfrom
Conversation
43066ce to
3e7ce69
Compare
Two of our manual source pages, for git-lfs-dedup(1) and git-lfs-standalone-file(1), are not currently built into finished roff and HTML versions. We therefore add them to the list of targets to be built with ronn(1).
We reorganize the list of Git LFS porcelain commands slightly to ensure it is in alphabetical order.
3e7ce69 to
363ed98
Compare
The docs/man/index.txt file is intended to provide URL mappings for the HTML hyperlinks ronn(1) can generate for references it finds in our manual page Markdown source files; e.g., the text strings "git-config(1)" and "gitignore(5)" can be hyperlinked to appropriate URLs wherever they appear. However, because we run ronn in the top-level directory of the project, the docs/man/index.txt file is never seen or used. Moreover, it contains only a single URL mapping, and that goes to an older manual page hosting site (and uses HTTP not HTTPS). If we generate the index.txt file dynamically before running ronn then we can extract all the currently listed external manual page references (i.e., those not referring to other Git LFS manual pages) from the "SEE ALSO" sections of our *.ronn source files, and map those to corresponding URLs under either https://git-scm.com/docs/ for Git manual pages or https://man7.org/linux/man-pages/ for other references. And by placing this dynamically generated index.txt file in the top-level directory, we can ensure that ronn will find and utilize it. Finally, we add our new index.txt to our .gitignore because it's now generated at build time, and we remove the old docs/man/index.txt file.
This reverts commit 08cb542 from PR git-lfs#4458 because that change, while it does resolve some formatting issues in the output from the "git lfs help" command, does not address the fact that ronn(1) is unable to process parentheses in header text and therefore still generates pages (particularly for the git-lfs-migrate(1) page) with broken references for such headers. Since we will rewrite the relevant manual pages in a subsequent commit to remove the parentheses, we simply revert this change first.
As noted in a prior commit, the ronn(1) utility does not fully support the use of parentheses in headers, and as a result fails to properly format references to such headers in its roff output and generates broken anchors and references to them in its HTML output. We therefore just rewrite our manual pages' headers and all references to them so they do not contain any unsupported characters like parentheses or slashes. This also has the advantage of making some of these headers more explicit and descriptive.
363ed98 to
412ca7d
Compare
bk2204
approved these changes
Feb 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although we do not include the HTML renderings of our manual pages in any distribution packages at present, this may change in the future, so we begin by addressing some issues with the HTML conversion, as well as including some missing manual pages in our build (both for HTML and roff output) and making some other revisions.
This PR should be reviewable commit-by-commit or as a single diff, but the former is likely simpler.
Missing Manual Pages
Two of our manual source pages, for
git-lfs-dedup(1)andgit-lfs-standalone-file(1), are not currently built into finished roff and HTML versions. We therefore add them to the list of targets to be built withronn(1).We also reorganize the list of Git LFS porcelain commands in the
git-lfs(1)page to ensure it is in alphabetical order.Build Reference URL Map Dynamically
The
docs/man/index.txtfile is intended to provide URL mappings for the HTML hyperlinksronn(1)can generate for references it finds in our manual page Markdown source files; e.g., the text stringsgit-config(1)andgitignore(5)can be hyperlinked to appropriate URLs wherever they appear.However, because we run
ronnin the top-level directory of the project, thedocs/man/index.txtfile is never seen or used. Moreover, it contains only a single URL mapping, and that goes to an older manual page hosting site (and uses HTTP not HTTPS).If we generate the
index.txtfile dynamically before runningronnthen we can extract all the currently listed external manual page references (i.e., those not referring to other Git LFS manual pages) from theSEE ALSOsections of our*.ronnsource files, and map those to corresponding URLs under either https://git-scm.com/docs/ for Git manual pages or https://man7.org/linux/man-pages/ for other references.We can also generate a listing of all our own manual pages and create a map of internal references as well, e.g., for
git-lfs-config(5)andgit-lfs(1), whichronnwill use to create relative hyperlinks between our rendered HTML pages.And by placing this dynamically generated
index.txtfile in the top-level directory, we can ensure thatronnwill find and utilize it.Finally, we add our new
index.txtto our.gitignorebecause it's now generated at build time, and we remove the olddocs/man/index.txtfile.Removing Parentheses from Headers
In commit 08cb542 of PR #4458 we have previously attempted to address the fact that
ronn(1)does not handle parentheses in header text well. Although that change may have resolved issues with the headers themselves, we still generate pages with broken references and links to such headers, as evidenced by thegit-lfs-migrate(1)page. In roff format, rendered byman(1)on macOS, theINCLUDE AND EXCLUDE (REFS)header appears in references like:See [INCLUDE AND EXCLUDE (REFS)]\.instead of:
which would be correct.
And in HTML format, it appears in references like:
instead of:
So we revert that commit, and just rewrite our manual pages' headers and all references to them so that they do not contain any unsupported characters like parentheses or slashes. This also has the advantage of making some of these headers more explicit and descriptive.