Closed nelliemckesson closed 6 years ago
OH YEAH also during testing I noticed an error that the mathjax cdn shut down as of April 2017. We'll need to replace the header script tag to use the following (recommended by the mathjax folks):
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
Hey, this is awesome, thank you! Apologies if I'm confused, but I think what you are asking is where does all the other stuff (headers, navigation, etc.) come from when the book is generated? I don't think we have this set-up yet for HTML rendering with the new magic book system. Last time around it came from these "views" which were part of the Ruby build system.
https://github.com/shiffman/The-Nature-of-Code/tree/master/noc_html/views (@runemadsen could confirm, but I'm pretty sure that's it.)
I assume you created this pull request by manually adding the stuff here rather than generate from magic book and then bring over?
My ideal process would be to generate all the HTML pages in book/ via the magic book build at from Nature-of-Code and then just bulk copy the folder over here to publish.
The new design stuff in natureofcode2.0 was made manually and never integrated with the magic book build. As we've discussed I have no strong preference regarding using the new design vs. keeping the old vs. a combination / redesigns, etc.
Happy to jump on a call if easier to explain that way!
Aha, ok awesome, that answers most of my questions. Sounds like I should write a plugin to add all the header/footer stuff for the HTML build. Any reason you might want an HTML build without any of the extra website header stuff?
I think the best route is for me to write the plugins, etc, to get everything building correctly, but leave it up to you to copy files over to the site repo.
It looks like the javascripts should go here (correct?): https://github.com/shiffman/The-Nature-of-Code/tree/master/noc_html
I can't quite tell where the CSS is coming from. I see the generated html.css file in the build/assets/ folder, but it doesn't match what's currently in the website repo, which is a bit confusing.
Actually it might be a good idea to hop on a call real quick just to confirm which asset files I should be editing--I can do this evening or pretty much anytime tomorrow after noon EDT!
I'll try to answer a bit here and then contact you via e-mail regarding a call.
I think the stylesheets are here?
https://github.com/shiffman/The-Nature-of-Code/tree/master/stylesheets
However, it's possible that there are some other CSS files that are a part of the natureofcode.com
repo that somehow aren't part of The-Nature-of-Code
build system.
And that's correct, the JS libraries used are in noc_html?
The way all this is organized is arbitrary and doesn't necessarily make any sense. This is likely a result of the project being completed at different times over a number of years by different people. A re-organization of files as well as removal of no longer used files would be welcome!
For example (and this is just one example), with the new way of integrating p5 sketches, the processingjs folder can be deleted.
Alriiight, so here's the corresponding code to go with the magicbook p5 iframe stuff. Some notes and questions:
The first script is a lazy-loading library that will work with the iframes. The second is a custom js file I wrote to scale/resize two-col and three-col processing blocks (plus captions).
I made a few very minor tweaks to the current CSS. I think it looks pretty good, tbh, and doesn't need much. I pulled over one or two things from the new CSS that I thought looked nice and added support for the iframes and a few magicbook code changes (sections, examples), but otherwise left it as-is. See how you feel about it and let me know if you think there's anything that looks weird!
During testing, I noticed the code blocks didn't seem to be converting the same way that they did in the previous version of the book. My process was to run the magicbook build, and then simply copy the chapter content into the general chapter template (which I got by just copying the HTML of one of the rendered chapters on the current live book site). Figured I'd check with you first to see if there's an extra step that needs to happen to get the code to convert before I start troubleshooting any further.