Logs for #nikola for 2015-09-17

04:14:14 <KwBot> [nikola] profedrini closed issue #2089: Nikola 7.7.1 crashes unable to import ipynb plugin https://github.com/getnikola/nikola/issues/2089
04:18:57 <KwBot> [nikola] profedrini opened issue #2092: Using IPython  %%magics breaks syntax highlighting on zen-ipython https://github.com/getnikola/nikola/issues/2092
04:24:35 <KwBot> [nikola] profedrini opened issue #2093: zen-ipython does not respect CODE_COLOR_SCHEME variable https://github.com/getnikola/nikola/issues/2093
07:33:39 <gour> morning
07:33:45 <gour> this is great: https://getnikola.com/creating-a-custom-page.html
09:49:05 <tprime> Hello everyone, I'm pretty new to Nikola and want to have thumbnails of svgs. Pngs work fine, but svgs get embedded without rescaling and don't offer the click-to-enlarge functionality. Also the .thumbnail.svg is identical to the .svg :(
09:53:01 <capri> hey, is it possible to create an archiv seperated by author names?
10:05:27 <Aeyoun> capri: yes, that was added a few weeks back. Update to latest release and review conf.py to find the option. Also mentioned on the blog.
10:06:40 <Aeyoun> tprime: that was fixed a mere days ago. Go check out the issue database on Github to see the status. Think it was included in the last release. If it isn't working still, file a new issue and include an example svg.
10:25:21 <tprime> aeyoun: this is a fresh install via pip. But I will try out the github version.
10:26:42 <capri> Aeyoun, thanks
10:27:06 <tprime> aeyoun: (I guess you're talking about 'svg galleries' - I'm talking about thumbnails within posts)
10:28:49 <Aeyoun> tprime: Okay. How do you embed them?
10:33:02 <Aeyoun> tprime: http://stackoverflow.com/a/25837986/656132
10:34:10 <Aeyoun> capri: https://github.com/getnikola/nikola/blob/master/nikola/conf.py.in#L355:L367
10:45:41 <ralsina_> tprime: just use the SVG and set the size in the HTML?
11:06:50 <tprime> aeyoun: .. thumbnail:: filename.svg
11:17:14 <ralsina_> tprime: svgs are vectors, they are not really thumbnailed
11:17:28 <ralsina_> tprime: in fact, I have no idea *how* to do that ;-)
11:17:43 <ralsina_> tprime: so, just use the original and display it smaller via CSS?
11:25:04 <tprime> ralsina_: I could do that (guess I'd have to patch nikola to add a class to the thumbnails), but then click-to-enlarge part would still not be working.
11:25:33 <ralsina_> tprime: I don't know if colorbox supports SVGs, or if we are just not applying it to those images
11:25:50 <ralsina_> tprime: so that *may* need a fix in Nikola 
11:25:59 <Aeyoun> tprime: how does it break? Look at the link I sent you to make a scalable viewport for your SVG.
11:26:36 <Aeyoun> Your SVG may have a fixed viewport and thus not be scalable.
11:26:39 <tprime> I'd be willing to find out if you can point me to the right direction within nikola's source plugins/compile/rest/thumbnail.py is apperantly not where the work's being done :)
11:27:22 <tprime> aeyoun: I have a full scale svg that does not respond to any clicks in my output in an <object> tag.
11:29:01 <tprime> that stackoverflow link talks about background images. Just having an <img> tag with width and height should work, shouldn't it?
11:30:28 <tprime> also, when nikola is creating a thumbnail, I'd expect it to replace the viewport accordingly.
11:38:03 <ralsina_> tprime: hmmmm maybe we could do that using lxml
11:38:18 <ralsina_> tprime: can you file a bug asking us to really thumbnail SVGs?
11:38:54 <tprime> I can do that - I'm also willing to hack it in myself if you have some pointers where to start
11:39:30 <ralsina_> tprime: check image_processing.py
11:39:53 <ralsina_> tprime: there, in resize_image, there is a special case for svg/svgz that just copies it
11:40:12 <ralsina_> your mission, should you choose to accept it, is to add a resize_svg method, and call it from there.
11:40:25 <ralsina_> <cue mission impossible music>
11:40:40 <ralsina_> <not the Limp Bizkit version>
11:41:07 <KwBot> [nikola] TyberiusPrime opened issue #2094: Thumbnails of SVGs are not scaled https://github.com/getnikola/nikola/issues/2094
11:43:51 <ralsina_> here is some totally untested by me code I just found googling, php-dev-style https://github.com/Zverik/svg-resize/blob/master/svg-resize.py
11:46:49 <Aeyoun> tprime: the same discussion applies when used as an <img> too
11:47:37 <Aeyoun> People things SVG == salable. But the SVG has to be formatted without a fixed viewport size to actually be scalable.
11:47:45 <Aeyoun> *scaleable
11:48:45 <ralsina_> Aeyoun: OTOH we are not setting sizes explicitly for thumbnails, so even if the SVG is scalable it will be large there
11:48:59 <ralsina_> Aeyoun: so hacking the viewport in that case still makes sense
12:21:07 <tprime> ok, the viewport hacking works.  now on to the colorbox integration :)
12:24:15 <tprime> (one more issue, the svg isn't centered like the images are... but I guess that's a theme issue)
12:56:49 <Aeyoun> ralsina_: should Nikola auto-hack viewports? Every program exports with a fixed viewport by default even though people expect SVG to be scaleable.
12:57:10 <Aeyoun> tprime: background-position: center;?
12:57:15 <ralsina_> Aeyoun: at this point... I don't know, let's think it :-)
12:57:17 <Aeyoun> or is it an img?
13:02:57 <tprime> aeyoun: It's an <object>, and right now I have no clue where in nikola that tag get's generated ;) (arguably, it should be an <img>, and I guess that gives it a good chance to be picked up by colorbox.)
13:05:39 <ralsina_> tprime: probably by the compiler for whatever markup you are using
13:07:03 <ralsina_> tprime: you can find what makes clorbox pick up some objects and not others in bootstrap3/templates/base.tmpl
13:07:13 <ralsina_> but it's this:     <script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
13:07:24 <tprime> ok, so rst thumbnail delegates to rst image or rst figure...
13:07:33 <tprime> cool, thanks. as expected, it likes <img> tags ;)
13:07:42 <ralsina_> you can make it like object tags too :-D
13:11:16 <tprime> wouldn't an <img> be semantically be more sensible than an <object>? Browser support is (almost) universal, and IE 8... well. And a thumbnail is a 'non-interactive svg' to my mind
13:15:24 <ralsina_> tprime: well, that's docutils, we try not to hack their code too much
13:15:48 <ralsina_> http://sourceforge.net/p/docutils/bugs/247/
13:15:50 <tprime> I feared as much. Software is build on turtles, all the way down.
13:15:52 <ralsina_> tprime: ^
13:16:06 <ralsina_> that bug is 18 months old
13:16:16 <ralsina_> "The html4css1 writer is "optimized" for IE6."
13:17:00 <ralsina_> hey, looks like we should switch to html-base writer!
13:17:22 <tprime> yeah, asking how I switch nikola around would've been my next question :)
13:17:59 <ralsina_> tprime: nikola/plugins/compile/rest/__init__.py
13:18:15 <ralsina_> and I would *love* a branch to see if that new writer sucks less :-)
13:21:01 * Aeyoun writes his posts as HTML to avoid too much “smarts” getting in the way
13:23:56 <Aeyoun> I’m smart enough as it is. :-P
13:24:58 <tprime> seeing how restructuredText handles tables nearly made me come to the same conclusion. But I really want easy 'scientific' figures with a legend, without much boilerplate on each one...
13:25:18 <tprime> ok, I've set the writer to html5. here goes nothing
13:25:28 <tprime> no module named html5 :)
13:27:51 <tprime> ok, it's docutils .12 that get's installed via pip, and apperantly it is lacking that writer.
13:29:06 <ralsina_> well, it's the latest release
13:29:16 <ralsina_> they are making noise about releasing again "soon"
13:29:52 <ralsina_> OTOH we have had more releases in august than docutils since 2012
13:30:04 <ralsina_> (totally made up that number, but it's close)
13:30:51 <ralsina_> tprime: if you don't like the ascii-art tables, you can always use http://docutils.sourceforge.net/docs/ref/rst/directives.html#list-table
13:31:34 <tprime> ralsina: I know, you keep spamming my rss feed with new releases :).
13:32:17 <tprime> and the list table thing is cool :). Ok, back to chainging our colorbox svg discover...
13:32:58 <ralsina_> tprime: release very early, release annoyingly often, that's my motto
14:01:53 <tprime> I find that sensible. Even though I live in a world of 'we version control everything our selves, we have thousands of pseudo-virtualenvs with full version tracking (because a) I started this before virtualenv was a thing and b) I really really want version tracking down theres, so I can push changes upstream), it's very pleasant to have a trigger to update stuff where you can expect the update to still work :)
14:09:16 <ralsina_> tprime: oh you will love this project of some friends of mine! https://github.com/PyAr/fades
14:09:27 <ralsina_> automatic virtualenvs for scripts
14:18:52 <tprime> @ralsina_: it's a nice approach. I require to be able to do a push the dependencies though. And the ability to see what changed in the upstream before importing etc. Basically, I'm kind of one man distributed development team ;) and our approach has been working for 6 years now. And just last week, I finally tamed docker. (Docker is ok, the custom registries are brain dead (can't tell what images and versions they have. Seriously?!), and Dock
14:18:52 <tprime> erfiles massively oversell on how repeatable the docker creation process is) But back on topic...
14:19:40 <tprime> a simple replacement of img with object did not work. would have been to easy
14:20:52 <ralsina_> of course
14:21:51 <tprime> I wonder why though, the selector does hit the element.
14:22:16 <ralsina_> tprime: a quick google shows that svg and colorbox do weird things: https://www.drupal.org/node/2368243
14:22:41 <ralsina_> but that seems to be using a SVG tag directly, maybe
14:23:34 <tprime> well, I don't want links on elements of the svg. I could even render the thumbnails as png from the svgs...
14:24:10 <ralsina_> tprime: Pillow doesn't support rasterizing SVG AFAIK
14:24:21 <tprime> I'll patch the <object> to an <img>
14:24:32 <tprime> pillow doesn't but theres' gotta be something out there. Inkscape probably ^^
14:24:53 <ralsina_> inkscape does, yes, but it's overkill, starting inkscape to scale each thumbnall :)
14:25:12 <ralsina_> although inkscape has a headless mode you can use for that. I used it in rst2pdf 
14:25:24 <tprime> ok, replacing <object> with <img> does lead to a perfectly working color box. and it's centered as well ^^
14:25:35 <ralsina_> yay
14:25:41 <tprime> yes, inkscape was meant as a joke. It would work, but it's the 500 pound gorilla of svg handling
14:25:45 <ralsina_> now, how do we make docutils do that
14:26:09 <ralsina_> you could override one of the visit_* functions. The plugin has some support for that
14:30:41 <KwBot> [nikola] Aeyoun opened issue #2095: Include meta['previewimage'] in Atom and RSS https://github.com/getnikola/nikola/issues/2095
14:31:07 <tprime> fun fact: calling .colorbox() on the <object> tag leads to the image being in the 'slideshow' part of the colorbox. It's just not clickable.
14:41:42 <tprime> ralsina_: What visit_* functions were you talking about?
14:41:58 <ralsina_> tprime: docutils uses the visitor pattern to generate the html
14:42:13 <ralsina_> so, if the parsed document has a node called foo, there is a visit_foo and a depart_foo function
14:42:23 <ralsina_> which add the tags, etc
14:42:58 <ralsina_> those can be overriden in the writer object and then you could make it do img if the thing is a svg, or somthing similar. But it's complicated stuff :-/
14:43:11 <s2hc_johan> Hi, is it possible to get sass files in files directory to be compiled or is it just in themes?
14:43:37 <ralsina_> s2hc_johan: just in themes, sorry
14:43:59 <ralsina_> s2hc_johan: if you can file an issue explaining how/why/what I can always take a look later :-)
14:44:24 <tprime> so that's a rst node, right?
14:44:49 <ralsina_> tprime: right
14:48:11 <tprime> so far nothing in nikola calls compiler/rest/__init__/add_note()
14:49:43 <s2hc_johan> ralsina_: probably isn't any why, I can just create my own theme that inherits the one I want and only but scss files in that one right?
14:50:02 <ralsina_> s2hc_johan: yes, that's the use case I had in mind for it :-)
14:50:11 <ralsina_> tprime: maybe something in plugins does
14:50:25 <ralsina_> tprime: plugins as in "the plugins repo"
14:52:55 <s2hc_johan> ralsina_: do you know of a theme that uses this
14:53:08 <s2hc_johan> I'm a but unsure how the targets file should look
14:53:12 <ralsina_> s2hc_johan: nope
14:53:20 <ChrisWarrick> Aeyoun: get them to submit to users.getnikola.com
14:53:21 <ralsina_> s2hc_johan: just a list of files you want compiled, one per line
14:53:49 <s2hc_johan> ok, and where does that end up, in the folder "above" the sass folder?
14:54:04 <s2hc_johan> should that file be in the sass folder?
14:56:59 <ralsina_> in the sass folder
15:14:21 <s2hc_johan> thanks
15:24:48 <tprime> rasina_: ok, I found a hack that basically outsmarts docutils svg detection...
15:24:55 <tprime> in Thumbnail.run
15:24:59 <tprime> if uri.endswith('.svg'):
15:24:59 <tprime>             uri = uri + '?sudo_make_this_an_img.png'
15:24:59 <tprime>         
15:25:33 <tprime> that get's the colorbox running - but embeds the image not the thumbnail :)
15:26:03 <tprime> (have to calculate .thumbnail before fuzzing the uri)
15:27:01 <Aeyoun> ChrisWarrick: maybe output a message on first "nikola deploy" about submitting to gallery? There is already a lastdeployment timestamp file.
15:27:21 <ChrisWarrick> Aeyoun: could do that, why not send a patch
15:29:28 <Aeyoun> I'll add it to my todolist
15:34:42 <KwBot> [nikola] Aeyoun opened issue #2096: Suggest users visit directory after first deployment https://github.com/getnikola/nikola/issues/2096
16:05:56 <ralsina_> tprime: eek
18:17:47 <KwBot> [nikola] kgurnani96 opened issue #2097: nikola 7.7.1 causes material-theme to not render when there are posts https://github.com/getnikola/nikola/issues/2097
18:27:03 <KwBot> [nikola] Aeyoun opened issue #2098: Incorrect warning about non-existing robots file https://github.com/getnikola/nikola/issues/2098
18:36:08 <KwBot> [nikola] Aeyoun assigned issue #2098 to Aeyoun: Incorrect warning about non-existing robots file https://github.com/getnikola/nikola/issues/2098
18:38:05 <KwBot> [nikola] Kwpolska assigned issue #2097 to Kwpolska: nikola 7.7.1 causes material-theme to not render when there are posts https://github.com/getnikola/nikola/issues/2097
18:38:44 -GitHub[nikola]:#nikola- [nikola] Aeyoun pushed 1 new commit to master: http://git.io/vnUzQ
18:38:44 -GitHub[nikola]:#nikola- nikola/master dac0a62 Daniel Aleksandersen: Don’t check in outut to see if robots exsit (Issue #2098)
18:42:42 <ralsina_> ouch, we did incompatible template changes?
18:43:56 -travis-ci:#nikola- getnikola/nikola#6413 (master - dac0a62 : Daniel Aleksandersen): The build passed.
18:43:57 -travis-ci:#nikola- Change view: https://github.com/getnikola/nikola/compare/6d0e313ffb27...dac0a626ed2a
18:43:57 -travis-ci:#nikola- Build details: https://travis-ci.org/getnikola/nikola/builds/80883269
18:53:48 <KwBot> [nikola] Kwpolska closed issue #2097: nikola 7.7.1 causes material-theme to not render when there are posts https://github.com/getnikola/nikola/issues/2097
18:53:58 -GitHub[themes]:#nikola- [nikola-themes] Kwpolska pushed 1 new commit to master: http://git.io/vnUwo
18:53:58 -GitHub[themes]:#nikola- nikola-themes/master e1b7b32 Chris Warrick: Fix getnikola/nikola#2097...
19:12:42 <KwBot> [nikola] orsenthil opened issue #2099: Including code using literalinclude directive https://github.com/getnikola/nikola/issues/2099
19:18:25 <KwBot> [nikola] Aeyoun closed issue #2098: Incorrect warning about non-existing robots file https://github.com/getnikola/nikola/issues/2098
19:21:47 <KwBot> [nikola] ralsina closed issue #2099: Including code using literalinclude directive https://github.com/getnikola/nikola/issues/2099