-
Notifications
You must be signed in to change notification settings - Fork 424
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
Add manual page generation to Sphinx docs #637
Conversation
It looks like, if these files are inserted in the repo as |
But that's only based on documentation, not experience. I haven't actually done this before. |
I don't want to commit compiled files to the repo, but I could add a Github action to build the files using Sphinx and attach them as release artifacts I think. I'll try to build something like that. |
Hm. OK. The install formula I've written for Homebrew expects the git checkout (for HEAD installs from the master branch) to include basically the same thing as a release tarball. I might have to rethink some of the installation code if that changes. If the release tarball included the man pages in the location specified above, then people running the release should get them just fine, but if there's a way to generate them from within the repo I might be able to compile them as part of the HEAD installation as well. In looking into this, I've also noticed that all my Homebrew formula does is install symlinks to Note that any files in the release tarball located in |
All good points.
Yes, probably. The example files should probably be easy to find in a That's not to say that we couldn't package our own release tarballs, putting the example files in a This is still in the spitballing stage... |
I added a Github Actions file that will create a new release when a tag is pushed matching Obviously this is a separate zip file containing just the manual pages, but we can add more advanced release tarballs once we know the format that is needed. |
OK, cool. I'd be curious to know:
|
No idea for 1. But I agree, don't change how it is now.
|
So I'm not sure as I've never used these files, but it seems that Are these correct? Should anything else be included? Maybe And should I include anything in |
Probably Building the docs with Sphinx is pretty straightforward, as long as you have Python 3.5 or newer: cd docs/
virtualenv venv --python=python3 && . venv/bin/activate
pip install -r requirements.txt
make man
cp -r _build/man output |
the manual page is useful in the debian package. Ideally you would ship it in the same tarball like the rest of the release source code. |
Any opinions on where to put it? It would be simple to leave it in |
That's OK. I can work with that. Perhaps the most important point is that whatever the path is, it remains stable for years to come. |
As I stated above, if you put the man pages in |
Add mappings for config, functions, and theme to manual page sections. Install does not have a mapping, mostly because to get the manual pages you already need to have installed Liquidprompt. Though that does leave out how to install Liquidprompt into the shell. But maybe it is something that packages should include instructions for. Reorder where the TOC comes int he theme document, to make the intro come first in the manual page.
This should create a release for a tag, build the manual pages, and push a zip file of them to the release.
This should create a release for a tag, build the manual pages, and push a tar.gz file of the whole project (with the man pages included) to the release. This is a more traditional release tarball, instead of just the documentation.
Github does not expose the raw tag id, only the full ref. This is actually how Github recommends doing this: https://github.community/t/how-to-get-just-the-tag-name/16241/7
I added two more commits that build a release tarball instead of the man pages zip file. It is pretty much just the whole repo, plus the compiled manual pages in I'm pretty happy with this, so unless there is something organizationally that you can't work with, I'll be merging this. |
I just released v2.0.0-rc.1 which has a tarball attached. The format of this tarball won't change between now and the full release, so if you want to test your packaging let me know if you have any issues. |
A PR for bumping to v2.0.0 is now in Homebrew: Homebrew/homebrew-core#70536 Unfortunately, the formula as I wrote it all those years ago is based on downloading/extracting the source tarball and not the release tarball. I'll need to update the Homebrew formula to pull the release tarball instead, and provide different instructions for installing the man pages when installing a release version. For now, I'll just have it install as usual. |
I'm afraid we already have a v2.0.1 😞 |
No problem. It hasn't been merged yet, so I updated the PR to 2.0.1. Still wrestling with the homebrew maintainers about what constitutes an appropriate Ruby test for a tool they likely know nothing about. 😕 |
@augmentedfourth I don't want to pollute the Homebrew issue, so I'll ask here: Wouldn't you want to download the new tarball that contains the manual pages? As for the test, obviously running it as a script is going to fail, as the test shows. You could try sourcing it instead: shell_output("/bin/sh -c '. #{liquidprompt}'") but since no terminal will be attached, it will immediately exit. You could use the shell_output("/bin/sh -c '. #{liquidprompt} --no-activate'") But again, there won't be any output. If you need to have some output string to test, maybe this would work: shell_output("/bin/sh -c '. #{liquidprompt} --no-activate; lp_theme --list'") Which should only return the string I would prefer to only test return codes, so we don't end up changing some output string and breaking tests. I don't know if Homebrew can do that, but this could maybe work? shell_exit_code("/bin/sh -c '. #{liquidprompt} --no-activate; lp_theme --list'") |
Yes, I do want to use the new release tarball, as I mentioned above. I haven't had time to figure out how exactly that would change the format of the formula, so I was going to just bump the version with the old formula for now. I'll look into updating the test as well. I honestly don't know anything about how the test was originally generated or inserted (aside from the username of the account that contributed it, but it doesn't seem to be connected to the project at all). |
v2.0.2 is out. Looks like there is no update on the Homebrew PR? 😞 It looks like the only packages updated to 2.0.X yet is AUR. That makes me slightly worried about hidden bugs with low numbers of testers 😕 |
I haven't had time to work on it, unfortunately. It's on my to-do list, but various other commitments haven't left me with enough left over to finish this. At least anyone who's using the |
It turns out that the I updated this to check for the text output of |
2.0.2 Homebrew PR is accepted! |
Add mappings for config, functions, and theme to manual page sections. Install does not have a mapping, mostly because to get the manual pages you already need to have installed Liquidprompt. Though that does leave out how to install Liquidprompt into the shell. But maybe it is something that packages should include instructions for, since each package installs
liquidprompt
and the example config files to different locations.Attached is a gzip of the compiled man pages: liquidprompt.man.tar.gz
CC: @aborrero, @augmentedfourth
Any ideas of how to ship these files?