Closed Moredread closed 2 years ago
Works like a charm, thank you @Moredread . Just for the record, after cloning and editing the file default.nix as described above (xhtml
→ epub3
), the following builds the ebook:
nix-build release.nix
cd result/share/doc/nix-pills
zip -r -X ~/nix-pills.epub mimetype META-INF OEBPS
It would be nice to automate that.
Hi all, I tried this and was able to successfully generate an epub document. Wondering what it would take to automate this build process? I think that generating artifacts in epub and pdf formats, and making them available to download as GitHub releases would be great for the community. I think there is demand for this too, based on a reddit thread I saw of a user who was interested in a pdf version. As far as I can tell, GitHub does not provide free CI tooling similar to what GitLab provides, but they do provide a releases api, so I'm not sure exactly how this could be architected.
One low barrier to entry method could be for someone with push access to this repo to just manually upload the artifacts as releases, and we could see if this is popular. The disadvantages I see are that this is manual, and that the artifacts would quickly get out of date.
We could add it to homepage and let it build with the HTML version: https://github.com/NixOS/nixos-homepage/blob/e433d77b1c0a3eb1c6eb9da961091c7e40bce4d9/Makefile#L46-L52
I'd love an EPUB of the nix pills, any progress on this?
I'm happy to take over and produce an epub that would be linked to the webpage. I have a few days free this January, I will give it a try.
couldn't convert with zip command above
(I have even tried
nix-build release.nix
rm -f /home/srghma/Downloads/nix-pills.epub
chmod -R +w ~/Downloads/nix-pills
rm -frd /home/srghma/Downloads/nix-pills
cp -r ~/projects/nix-pills/result/share/doc/nix-pills ~/Downloads/
chmod -R +w ~/Downloads/nix-pills
cd ~/Downloads/nix-pills
echo "application/epub+zip" > ~/Downloads/nix-pills/mimetype
mkdir ~/Downloads/nix-pills/META-INF
mkdir ~/Downloads/nix-pills/OEBPS
zip -r -X /home/srghma/Downloads/nix-pills.epub ~/Downloads/nix-pills
)
Instead I have converted zip (without anything) to epub with calibre
gen zip
cd ~/Downloads && ls -al
rm -f /home/srghma/Downloads/nix-pills.epub
chmod -R +w ~/Downloads/nix-pills
rm -frd /home/srghma/Downloads/nix-pills
cp -r ~/projects/nix-pills/result/share/doc/nix-pills ~/Downloads/
chmod -R +w ~/Downloads/nix-pills
zip -r -X /home/srghma/Downloads/nix-pills.zip ~/Downloads/nix-pills
add zip and convert
https://drive.google.com/file/d/18oCAYSm34M1rNygbb_moO_4f2p1pp48P/view?usp=sharing
It should be easy to add an output for an epub file. I tested it manually by changing the path to the xsl in the xsltproc call to
${pkgs.docbook5_xsl}/xml/xsl/docbook/epub3/chunk.xsl
and zipping the result withLet me know if you are working on it, I might try it in the future when I have more time.