Comments (14)
Maybe this can be turned in a CHM instead?
from ahkbook.
I have a working solution. The CSS doesn't get included, but I don't think we need it for off-line use. I may have a way for it to work which I can give a try.
this video shows the process
It uses the following bash script to do the process.
#!/bin/sh
# Location to save ebook
OPATH=`pwd`
# Custom dir to build in
BPATH='/tmp/ahkbook_build'
mkdir $BPATH
cd $BPATH
# clone from GitHub using the read-only uri
# this is the official repo
git clone git://github.com/maul-esel/ahkbook.git
cd ahkbook
# Make the html
# I get A LOT of errors so just hide them
# we still get the success status
jekyll 2> /dev/null
cd _site
# make the ebook
# we get ebook-convert from the calibre package
ebook-convert index.html $OPATH/ahkbook.epub >/dev/null 2>&1
# clean up
# it's pretty much impossible for this to delete the output file
rm -R -f $BPATH
Here are the dependencies for running that. If you have apt-get as your package manager this should work. I've tried it on Ubuntu 10.10 and Linux Mint 12.
#!/bin/sh
sudo apt-get install -y rubygems1.8 ruby1.8-dev python-pygments git calibre
gem install jekyll
PATH=$PATH:/var/lib/gems/1.8/bin/
export PATH
Just as a note, I don't think those last two lines do what I think... It doesn't seem to affect my path.
from ahkbook.
I didn't think of this format, but it is good! Maybe we can look out for other formats, too, and provide multiple versions later...
CSS support is not definitely necessary, but if you'd know a way... I tried replacing the CSS URL with a local one, but this produces an error.
from ahkbook.
we can convert to any and all of these formats.
A css file can be included when converting via a command line parameter. I'll try it a bit later.
from ahkbook.
Did you try in the meantime?
I did, but it failed on my system :(
from ahkbook.
Yes, I did. The pdf fails but most of the others seem to work.
Should there be a separate branch for binaries? (I can upload a zip when I get a good connection.)
from ahkbook.
Yes, I did. The pdf fails but most of the others seem to work.
Oh really? For me even the epub doesn't work (with css) :(
Should there be a separate branch for binaries?
I would prefer downloads over a branch.
from ahkbook.
Oh, sorry. I forgot to tell you about the --extra-css option. It takes a stylesheet file name and packs that in the output. Some changes need to be made for the style to work properly.
from ahkbook.
Yeah, I used that option, but I didn't make any changes to the style.
I'm doing some (AutoHotkey) experiments to create a CHM from the index page automatically.
from ahkbook.
I built it again, and then zipped the folder. It has the scripts too.
http://www.autohotkey.net/~frankie/temp_links/ahkbook-11-24-11.zip (2 MB)
You should see the problem with the epub, it sets the background to gray and ignores the div.content
styles. I haven't checked all of them, mostly because I don't know what to open them with! (calibre can probably handle them.)
Let me know what you think.
P.s. What system are you running? Why can't you build them? Feel free to send me a message about it because I think it's important you can do it.
from ahkbook.
Thanks, I sent you a PM.
Btw, it seems your ebooks all contain that liquid error:
Liquid error: undefined method join' for "; any AutoHotkey version\nMsgBox Hello, World!\n":String
or similar, wherever code appears. That occurs if you're using Liquid 2.3.0 (seems to be a bug). v2.2.2 does it correctly.
Regards
maul.esel
P.S.: Assuming you know your content is not entirely up-to-date...
from ahkbook.
I just uploaded a zip with the latest content as html files. The modifications I made:
- change
url
setting in _config.yml to..
, so the CSS files are searched in[parent_dir]\css
. - remove the
..
from index.html once built, as it does not have a parent directory (so to speak).
You as a shell expert, can you tell me if there's a way to automate this text replacement (regex or similar) ?
Edit: The first change seems also to be possible with a jekyll cmd parameter.
Edit 2: added the build script
Edit 3: automated replacement in build script
Regards
maul.esel
from ahkbook.
You can see my CHM experiments here. Currently it doesn't work (fatal navigation error).
Of course it would be best if this could be rewritten in another language (shell script) to make it run on linux - and then we could just build the content (as for the zip file) instead of downloading.
from ahkbook.
About the failed ebook-conversion: I tried the version in your repo and it worked. My version doesn't work with or without command line parameters now.
Bisecting tells me this behaviour starts with this commit. Do you have an idea why?
Regards
maul.esel
from ahkbook.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ahkbook.