Skip to content
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

downloadable version #3

Open
maul-esel opened this issue Nov 3, 2011 · 14 comments
Open

downloadable version #3

maul-esel opened this issue Nov 3, 2011 · 14 comments

Comments

@maul-esel
Copy link
Owner

Provide a downloadable version

  • how to keep it up-to-date? (hooks?)
  • shell script for packing (might be replaced by something else)
#!bin/sh

rm hook-temp
rm package.zip

mkdir hook-temp

git clone . hook-temp
cd hook-temp

jekyll
cd _site

zip -ll ../../package.zip *
zip -ll ../../package.zip */*

cd ../..
rm -R -f hook-temp
  • update download via github API

Problem:

The CSS location is not offline.

@maul-esel
Copy link
Owner Author

Maybe this can be turned in a CHM instead?

@brigand
Copy link
Contributor

brigand commented Nov 12, 2011

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.

@maul-esel
Copy link
Owner Author

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.

@brigand
Copy link
Contributor

brigand commented Nov 13, 2011

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.

@maul-esel
Copy link
Owner Author

Did you try in the meantime?
I did, but it failed on my system :(

@brigand
Copy link
Contributor

brigand commented Nov 24, 2011

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.)

@maul-esel
Copy link
Owner Author

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.

@brigand
Copy link
Contributor

brigand commented Nov 24, 2011

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.

@maul-esel
Copy link
Owner Author

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.

@brigand
Copy link
Contributor

brigand commented Nov 25, 2011

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.

@maul-esel
Copy link
Owner Author

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...

@maul-esel
Copy link
Owner Author

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

@maul-esel
Copy link
Owner Author

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.

@maul-esel
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants