-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert alias
documentation to Sphinx/RST
#1389
Conversation
You can see the generated web site here: https://www.skepticism.us/ast/html/ Here is a screenshot of Compare the https://github.com/att/ast/blob/master/src/cmd/ksh93/docs/basename.1 |
Force pushed an updated commit because I decided not to include the generated HTML; only the man pages for now. |
This will be a major change after |
Yes, that is my preferred practice. Development always happens on master. Stable releases get their own branch. When necessary a fix is applied to master then cherry-picked onto a stable branch. |
@@ -0,0 +1,20 @@ | |||
# Minimal makefile for Sphinx documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use meson instead of Makefiles ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe but probably not worth the trouble. The makefile was autogenerated by the sphinx-quickstart
command to set things up. If we decide to generate man files as part of meson install
we can just do run_command(['make', 'man'])
from a meson.build file.
It looks like a step in the right direction. @kdudka Any thoughts on this ? |
This is a proof of concept change to implement the documentation using Sphinx/RST markup. It includes documentation for the `alias` special builtin and the `basename` command builtin. The sole purpose is to establish that using Sphinx/RST is viable by providing concrete examples for examination. I've deliberately chosen to include the documentation build artifacts in the commit. This means that for now the CI builds, and anyone else building from source, doesn't need to have Sphinx installed to build the documentation. This does mean that some care is needed to always run `make man` and `make html` before committing any change to the documentation. TBD is whether a trigger of some sort will be needed to ensure the two sets of files are kept in sync. Related #507
Another step in switching from the DocOpt base option processing done by the AST `optget()` function to the borg standard `getopt_long()`. It also introduces a system-wide ksh config script to enable auto-loading functions included with ksh by default. This allows the use of the auto-loaded `_ksh_print_help` function. As well as the dirs/popd/pushd set of functions that have been the sole functions included with ksh forever but not automatically enabled. Related #507 Fixes #835
FYI, I've made more changes that support generating |
@siteshwar Take a look at the diff of the second commit I just pushed. The first is the same as the one you've already reviewed. It's commit ID has changed due to rebasing. The second commit shows where I'm headed. Specifically, replacing Eventually we should be able to construct the ksh(1) man page from the man pages for each builtin and man pages for the other major subsections. Much like zsh does. Sometimes you want the zshall man page. But lots of time you want something much more focused. Such as the documentation for a specific builtin and don't want to have to wade through tons of irrelevant text. I'll work on creating a |
This adds a `man` function to give priority to ksh man pages. Making it possible to do `man alias`, for example. Related #507
Done. If you install from this branch you can type |
I would prefer not to store generated documentation in git but have it available in release tarballs. It is unclear to me how the commit named |
btw it's causing CI to fail with these messages:
|
Agreed. The current state of affairs is just a stepping stone intended to make it easier to transition to Sphinx without requiring everyone doing builds to have Sphinx installed. We should probably make Sphinx a hard dependency once all the man pages have been converted but leave it a soft dependency till then.
That commit illustrates the logical next step. We don't want three versions of each command's documentation; e.g., in ksh.1, alias.1 and alias.rst. Eliminating the DocOpt text in alias.1 means we can no longer use the AST
Yep. I was just ignoring those errors until we agreed to move forward with converting the docs to Sphinx and reStructuredText. |
FYI, I haven't merged this because, after fixing the easy test failures, there were two test failures that were inexplicable. At least in as much as they only occurred on Linux but not BSD systems. Too, the error message was inconclusive. The problem turns out to be due to a difference in the behavior of |
I have merged this after fixing the test failures. It also, as a side-effect, results in the |
This is a proof of concept change to implement the documentation using
Sphinx/RST markup. It includes documentation for the
alias
specialbuiltin and the
basename
command builtin. The sole purpose is toestablish that using Sphinx/RST is viable by providing concrete examples
for examination.
I've deliberately chosen to include the documentation build artifacts
in the commit. This means that for now the CI builds, and anyone else
building from source, doesn't need to have Sphinx installed to build the
documentation. This does mean that some care is needed to always run
make man
andmake html
before committing any change to the documentation. TBDis whether a trigger of some sort will be needed to ensure the two sets
of files are kept in sync.
Related #507