-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Refactor embedded files #2350
base: master
Are you sure you want to change the base?
Refactor embedded files #2350
Conversation
@@ -31,9 +31,10 @@ tested-with: | |||
extra-source-files: | |||
CHANGES.md | |||
README.md |
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.
Hmm, changing the location of the man pages (from ./hledger-ui.1
to ./embeddedfiles/hledger-ui.1
) will probably cause busy work for package maintainers.
Perhaps I should just leave the files where they were.
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.
FWIW I suspect the majority of packagers get man pages from a github or hackage tarball.
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.
Or at least, I'm not too worried about this. Will look.
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.
Yes, so this changes the hackage tarball I believe.
Compare
hledger: https://hackage.haskell.org/package/hledger-1.42/src/
hledger-ui: https://hackage.haskell.org/package/hledger-ui-1.42/src/
The man pages in the hledger tarball are inside the subdirectory embeddedfiles, and so package maintainers have to find them there, while the man pages in hledger-ui are currently in the toplevel directory.
We should probably not change this setup without a good reason.
Thank you! I hope to look at this soon. |
My goal was for Is the Having four modules named DocFiles.hs is something I'd try to avoid. What would you think of calling three of them CliDocs.hs, UiDocs.hs and WebDocs.hs ? Now that the DocFiles helpers are reusable utilities, defined apart from use, the bar is a little higher and I find them a bit confusing. And I don't love having ' in their names. But it's not a blocker, we might find ways to clarify them in future. |
I'm not against moving manuals in the tarballs if it makes things clearer and simpler, I will just document it at release time. Currently the manuals are generated in each package's top directory, and I think it's natural for them to be in the same place (top level) of the hackage tarballs. Likewise in the github tarballs/zip file, they are at top level alongside the executables. They are important artifacts. I don't know if it's necessary for manuals to be symlinked into the embeddedfiles/ subdirectory, if it simplifies we could drop those links. I think it was just convenient to see all embedded things in one place. Also embeddedfiles is a place to store the .cast files, and the tldr files. I think tldr files probably do need to remain symlinked somehow because they come from doc/tldr/ which corresponds roughly to pages/common/ in the tldr repo. But maybe not. |
The goal of this refactoring is to remove the symlinks from
hledger/embeddedfiles
tohledger-ui
andhledger-web
:I recently caught the Nix bug, and those symlinks across cabal projects are causing problems when trying to build hledger from inside a git repository (as mentioned in #2063, and #2044 is relevant).
This refactoring:
printHelpForTopic'
,runManForTopic'
,runInfoForTopic'
,runPagerForTopic
andrunTldrForPage'
tohledger-lib:Hledger.Utils.Docfiles
.Hledger.Web.DocFiles
tohledger-web
andHledger.UI.DocFIles to hledger-ui
, which now embed their own info/man/tldr pages directlyhledger/embeddedfiles
tohledger-ui
andhledger-web
There are still symlinks to
../../docs/utils
, also outside of the cabal project, but those are less problematic.I tested the builds both with nix and cabal. There should not be any user visible changes.