-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Use HonKit instead of GitBook #720
Conversation
This effectively turns the whole repo into a Node package, so tools like `npm` and `yarn` can automate tasks such as dependency installation. Please note that non-standard plugins are listed in both `book.json` and `package.json`.
Here's the Travis build for commit efc855e, which failed: https://travis-ci.org/github/algorithm-archivists/algorithm-archive/builds/703556596 Here's the Travis build for commit 7e65c21, which failed: https://travis-ci.org/github/algorithm-archivists/algorithm-archive/builds/703571509 |
Here's the Travis build for commit 1c6c4f3, which passed: https://travis-ci.org/github/algorithm-archivists/algorithm-archive/builds/703575094 |
This looks really promising! Is it ready for review? |
@leios This is ready; however, I'll be offline for the next couple of hours. |
Looks great! For some reason, the images are left-justified. That's the only problem I could find after building it locally. I'll dig deeper a bit later. |
- Remove duplicate fontsettings toggle - Fix HTML files not including `styles/website.css`
@leios Does the latest commit work? It uses the latest version of HonKit, which fixes the problem you were seeing (c.f. honkit/honkit#89). You'd probably have to run |
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.
I've tested the version locally and it creates a carbon copy of the site. But there are still a couple of differences:
- different font, the font looks good, so that's fine.
- we are no longer able to share the site via facebook or twitter, the heavens be praised and thanked.
Otherwise it's the exact same and I approve the pullrequest.
As a few quick notes:
In addition, the word count seems to be broken as well. |
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.
I am happy with this. It seems Travis is also working. We'll leave it up for another day or so, to make sure everyone else has their say.
Also, as a note: I can no longer build with gitbook on my computer because of an update, so this would be nice to get in soon. I'll probably merge tomorrow if there are no other complaints. |
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.
The dynamic sidebar works on local builds for me again! Rejoice!
WOO! I'll let you know if the build fails for whatever reason. |
Looks great! |
From what I've seen, HonKit appears to pick up where GitBook left off in development. Things were pretty much smooth sailing except for the fact that
honkit install
didn't exist (this was so that they could remove their reliance onnpm
so others could useyarn
, for instance). I then learned that I had to create thepackage.json
file below.Alongside this pull request, I would also recommend changing this Wiki page to reflect the change to HonKit. Below, I have provided some sample text as a basis for what the relevant sections would look like.
Step 1.2 - HonKit
The next thing we need is HonKit (successor to GitBook), which is the tool that builds the AAA. By downloading HonKit, you can also build and serve the AAA locally on your computer.
HonKit can be retrieved via NPM or yarn. If you don't have NPM/Node.js installed on your system, you can download it here: https://nodejs.org/en/.
Step 2.3 - Building and running the AAA
Now that you have the AAA-repo on your machine, you first need to get all the packages the AAA requires to build. This can be done by running the following command in the same directory as your copy of the AAA-repo:
npm install # or `yarn install`
After the all packages are downloaded, you can run/serve the AAA with this command:
npm run serve # or `yarn run serve`
Once HonKit finishes building and starts serving, your terminal should've printed out something like the following:

This indicates that you successfully built the AAA! You can check out your local AAA by navigating to http://localhost:4000 in your browser.
Here you can see the AAA, just like it is on https://algorithm-archive.org:

When you're done with your local server, you can use
ctrl + C
to close the server.Step 3.3 - Adding code to your AAA-repo
First of all, there are some things you need to know ("Skip a bit, brother.")
…
The instances mark places where code gets imported into the page. The very last place should import all files you created. The other places often just target specific functions (for example just a
Sort()
function as an explanation, but not all other code). To identify which exact function is needed, run the book (described in Step 2.3) vianpm run serve
and go to each code example.…
The
multLangIdentifier
is important for HonKit to provide the language switcher that you see at the top of the algorithm pages. ThemultLangIdentifier
is simply the file ending of the language you want to add.…
Now you can run
npm run serve
again (or just let it rebuild automatically, if it is still running) and look at the page of the algorithm you're targeting. You should now be able to select your chosen language at the top and you should see your code in all places where code examples should be.…
Step 3.7 - After the Pull Request: The Review
So, after someone reviewed your PR, you can just go ahead and correct the things the person pointed out. Doing that is fairly simple. Just checkout your branch locally (via
git checkout your-branch-name
), make corrections, run the book to check that everything is correct (vianpm run serve
) and then finally push the changes to your branch (viagit push
). Since the PR uses your branch, the changes immediately show up after you pushed them.