Closed AntonioGHub closed 4 years ago
Thank you for looking at this @AntonioGHub! @joeyklee maybe we should test to make sure this doesn't break mac os and then it's good to merge as far as I'm concerned!
Well, I guess your public dan...@s.....n.net mail address is not checked very frequently....
On 19/09/2019 14:34, Antonio wrote
to:d...@s.....n.net You are welcome Daniel :)
Just as an aside (outside github and the build of the book), I couldn't get around to read the book yet (book, which is very promising), but I skimmed through the diagrams and they are beautifully drawn in a sort of freehand style. For long I have been looking for a tool to draw sketched (yet neat) lines but I couldn't find one. Is the one you are using publicly available somewhere?
Thanks! Antonio
@shiffman - I can confirm that these changes do not break the MacOS magicbook build. The tests pass as well. I don't have write access to the magicbook project, so you'll have to do this one!
Just a few notes:
path.normalize()
is fine, but I wonder if path.resolve()
might be more flexible? I don't think we need to change this now, but just a note in the future in case we get into some issues with relative paths and absolute paths (see: https://stackoverflow.com/questions/10822574/difference-between-path-normalize-and-path-resolve-in-node-js) @AntonioGHub - Thanks again for this PR! Regarding your question above - @zee-moz did the illustrations for the Nature of Code. She's a wiz in illustration so I can imagine it was mostly with pencil/ink and then put into Adobe Illustrator (or similar vector drawing or photo editing program). I guess nothing can replace training your hand old school style ;)
Hope this helps!
@AntonioGHub glad you like the illustrations. I do a lot freehand, but for at least some of this project I believe I made some custom brushes and worked in Illustrator on wacom tablet. More recently I've been using Procreate with Apple Pencil on my iPad Pro (though you don't need one to do this). It's super great, and had it been around when I was working on the NOC illos it would have saved me tons of time! I highly recommend it.
@zee-moz really freehand? I would have sworn that a figure like this was written with some sort of CAD which could render the graphic in a freehand like fashion. This doesn't solve my problem (finding a quick and easy sketching tool), but congratulation for your style! And thanks for the hints!
@joeyklee When I decided to use path.normalize()
I remember I intentionally discarded path.resolve()
but I cannot remember why exactly. Surely an important difference is that resolve
may not work straight away. It determines the full (absolute) path to the file, which is different from the relative path maintained by normalize
, as you already stressed out; in the case of NOC2 the imageMap
is filled with relative paths so node.js would assume that the initial segment of the path is the current directory, to which the relative path is appended (something like $current_directory/chapterX/imageY.jpg
). But "current directories" can be the source of tricky bugs and I would avoid them tout-court.
solves image files are not found on Windows · Issue #29