Logs for #nikola for 2016-02-22

08:48:48 <KwBot> Lenz: 08:59:57 <ChrisWarrick> `self.site` should point to the site object, which has access a `GLOBAL_CONTEXT` dict, which you can add to using the `GLOBAL_CONTEXT` setting in conf.py.
10:04:32 <ralsina> [Tritium]: no, it's not just you, there was an issue about it but it's fixed
10:06:23 <Lenz> ChrisWarrick: Thanks for the suggestion regarding using the GLOBAL_CONTEXT dict. However, I'm not sure how I would be able to access it - from what I understand, the function that implements the new reST role has no way of accessing the "site" object, or does it?
10:06:37 <ralsina> [Tritium]: damn me if I can find it tho
10:07:00 <ralsina> Lenz: your plugin's set_site method gets it. At that point, put it in a module-level variable
10:08:26 <ralsina> [Tritium]: IIRC it involved a custom theme not having an up-to-date rst.css
10:10:48 <Lenz> ralsina: OK, so basically, I replace site.config['ISSUE_URL'] with site._GLOBAL_CONTEXT['ISSUE_URL']?
10:11:29 <Lenz> I'll give this a try...
10:11:55 <ralsina> Lenz: pretty much
10:12:17 <Lenz> OK, thanks - let's see if I can figure this out :)
10:12:56 <ralsina> Lenz: you can use site.GLOBAL_CONTEXT the _ version is internal and it may not do what you want at some point
10:25:47 <Lenz> ralsina: got it, thanks
14:23:11 <ChrisWarrick> [Tritium]: That’s probably a case of rst.css assuming everytone uses black text.
17:26:27 <KwBot> [nikola-site] haakenlid opened issue #37: Short codes examples in the handbook are broken https://github.com/getnikola/nikola-site/issues/37
17:28:10 <KwBot> [nikola-site] ralsina assigned issue #37 to ralsina: Short codes examples in the handbook are broken https://github.com/getnikola/nikola-site/issues/37
17:28:25 <[Tritium]> Yes they are!
17:33:01 -GitHub[nikola]:#nikola- [nikola] ralsina pushed 1 new commit to master: https://git.io/v2mNe
17:33:01 -GitHub[nikola]:#nikola- nikola/master f99fcf3 Roberto Alsina: fix doc shortcode examples
17:33:41 -GitHub[site]:#nikola- [nikola-site] ralsina pushed 1 new commit to master: https://git.io/v2mNL
17:33:41 -GitHub[site]:#nikola- nikola-site/master cb1869d Roberto Alsina: fix shortcode examples
17:33:45 <KwBot> [nikola-site] ralsina closed issue #37: Short codes examples in the handbook are broken https://github.com/getnikola/nikola-site/issues/37
17:37:23 <[Tritium]> ralsina, ChrisWarrick: how do i get a well behaved rst.css?
17:37:38 <ralsina> [Tritium]: sorry, it's probably not that
17:38:00 <ralsina> [Tritium]: perhaps our rst.css interacts badly with your theme? Can I see your site?
17:38:29 -travis-ci:#nikola- getnikola/nikola#6927 (master - f99fcf3 : Roberto Alsina): The build passed.
17:38:30 -travis-ci:#nikola- Change view: https://github.com/getnikola/nikola/compare/5724c0dc16c4...f99fcf33fbf2
17:38:30 -travis-ci:#nikola- Build details: https://travis-ci.org/getnikola/nikola/builds/111011212
17:39:15 <[Tritium]> ralsina: PM?
17:39:23 <ralsina> [Tritium]: looking...
17:39:40 <ralsina> [Tritium]: I don't see it?
17:39:45 <ralsina> Ah, there it is
17:40:03 <[Tritium]> i give heads up before i send.
18:36:55 <zdzichu> hm, some of my markdown is not getting parsed
18:37:58 <zdzichu> not parsed: https://pipebreaker.pl/z/output/2014/12/30/who-wrote-systemd/index.markdown
18:38:07 <zdzichu> parsed OK: https://pipebreaker.pl/z/output/2013/12/10/quick-n-dirty-hack-ansible-inventory-from-freeipa/index.markdown
18:38:10 <zdzichu> any idea?
18:42:09 <ralsina> zdzichu: are you getting errors or something?
18:42:39 <ChrisWarrick> zdzichu: .markdown files are not parsed
18:42:46 <[Tritium]> http://i.imgur.com/N0CX7G7.png some css tweaking later, its actually readable.  thanks for the help!
18:43:03 <ChrisWarrick> zdzichu: those are just raw copies
18:44:57 <ChrisWarrick> zdzichu: there might be some unclosed tag or other things markdown considers “raw HTML”. Why not make your comment converter output HTML, too?
18:48:33 <zdzichu> ralsina: if you removce 'index.markdown' part you will see the output, which is not converted in first example
18:49:07 <zdzichu> ChrisWarrick: output html... I'm and idiot, this is brilliant
18:49:25 <ChrisWarrick> zdzichu: Stray p tag on line 67?
18:49:46 <ralsina> yes, that's probably it. Remember that markdown inside tags is not parsed
18:49:56 <ChrisWarrick> zdzichu: It should be a closing </p> tag, it seems
18:51:16 <zdzichu> bingo!
18:52:39 <ChrisWarrick> next time, try checking the web inspector, or using gg=G in vim
18:52:48 <ChrisWarrick> (aka auto-indent)
18:53:10 <zdzichu> yeah, I should start with that
18:53:26 <[Tritium]> Do shortcodes work in restructuredtext?
18:53:32 <ralsina> [Tritium]: very badly
18:53:55 <[Tritium]> alrighty
18:54:03 <ralsina> [Tritium]: meaning, they work, but lots of things get mangled by the reSt parser so if you want to pass a URL, for example, it gets transformed into a link and thus breaks totally
18:55:09 <ChrisWarrick> We should probably not support them, at least not without a special “please support rest” paremeter
18:57:28 <ChrisWarrick> zdzichu: also, what input format did Jogger take?  And was jabber blogging not too much of a pain?
18:58:05 <[Tritium]> Now, i just wish docutils was better documented
18:58:14 <ralsina> ChrisWarrick: or support them pre-parsing and slip them inside a raw html piece
18:58:27 <ralsina> Of course that will break the world in some cases
19:04:55 <ChrisWarrick> zdzichu: also, your SITE_URL seems to be wrong as of right now
19:20:16 <ChrisWarrick> Oh, projectpages propganda is going out tomorrow
19:24:40 <ralsina> neat
19:31:06 <[Tritium]> Except for one minor annoyance, I think I have everthing I want setup in nikola set the way I want
19:31:39 <ChrisWarrick> what is that?
19:32:53 <[Tritium]> I'm using formspree.io for a contact page.  I am also deploying to multiple locations.  I just cant figure out a way to swap the url for the form redirect depending on where the site was built for
19:33:28 <ChrisWarrick> JavaScript required, unless you have multiple config files
19:34:21 <ChrisWarrick> (in the rare case you do, the permalink should work fine)
19:34:30 <[Tritium]> I effectivly do have multiple config files?  I have site specific things, like the base url, in if statements, checking an envvar
19:35:05 <[Tritium]> Its getting the permalink in the raw html blocks
19:35:10 <ChrisWarrick> not supported
19:35:13 <ChrisWarrick> make a custom template
19:35:37 <[Tritium]> Didnt...think of doing that.
19:35:53 <[Tritium]> site object is in the global context?
19:36:13 <ChrisWarrick> {{ post.permalink }} or {{ site_url }} should be available
19:38:32 <[Tritium]> can you set the template to use in page metadata?
19:39:00 <ChrisWarrick> yes
19:39:06 <[Tritium]> .. template:
19:39:07 <[Tritium]> ?
19:39:07 <ChrisWarrick> .. template: contact.tmpl
19:39:14 <[Tritium]> thank you!  off to vim i go
19:52:49 <[Tritium]> That worked spectacularly.  thank you
19:52:56 <ChrisWarrick> you’re welcome!
19:53:10 <[Tritium]> did have to do post.config['SITE_URL'] though
19:54:05 <ChrisWarrick> hack hack hack
19:54:46 <ChrisWarrick> [Tritium]: blog_url exists
19:55:45 <[Tritium]> And now the template is a few bytes shorter
19:56:03 <ChrisWarrick> but it does not use hacks
20:01:28 <[Tritium]> Oh this gives me an idea
20:01:46 <[Tritium]> there has got to be an article pagination js library somewhere
20:02:05 <ChrisWarrick> [Tritium]: what sort of pagination?
20:02:26 <ChrisWarrick> [Tritium]: You might want to look at the hack at plugins.getnikola.com, it uses some paging thing
20:02:35 <[Tritium]> ChrisWarrick: to split an article into smaller parts that are easier to read in one go
20:04:05 <ChrisWarrick> [Tritium]: Even if there isn’t, I guess you could code it up in a day (string split + pages)
20:04:17 <ChrisWarrick> s/a day/15 minutes/
20:05:04 <[Tritium]> I have an open issue for this to be something that could be done as a build step (which would be ideal) but short of that... javascript works
20:05:42 <ChrisWarrick> We had some section/parts thing, but it’s either a forgotten plugin or dead… either way, building with pages should not be THAT hard, patches welcome
20:08:07 <ralsina> JS pagination should be easy. Pagination into multiple files I have no idea how to do it.
20:08:18 <ralsina> Specially if we want internal links to keep working
20:08:48 <ChrisWarrick> what is the problem here?
20:09:07 <ChrisWarrick> /foo/ points to page 1, /foo/2.html points to page 2.  For fans of ugly URLs, a scheme could be devised for them.
20:09:34 <[Tritium]> /foo/2/ for pretty urls >.>
20:09:37 <ChrisWarrick> whatever
20:09:48 <ChrisWarrick> that might break some relative URLs though
20:10:07 <ChrisWarrick> In some render function (post.text? meta variable? somewhere else?) we check if the post is paginated, and if it is, a simple str.split() is in order
20:10:21 <ChrisWarrick> preferably before we prettify with lxml (as we do with teasers)
20:10:35 <ralsina> As I understand it, [Tritium] wants to write a long post that generates, say, 3 HTML pages
20:10:44 <[Tritium]> yup
20:10:45 <ChrisWarrick> yes
20:10:55 <ralsina> if there is a link in page 3 that is #heading-foo where that heading is in the 1st page, how would that work?
20:11:03 <ChrisWarrick> It wouldn’t
20:11:09 <ralsina> so it won't work
20:11:20 <ChrisWarrick> The author should take care of them on their own
20:11:28 <ralsina> specially in reSt we have tons of internal links like those, in, for example the TOC
20:11:36 <ralsina> which can't even be done by the user
20:11:55 <ralsina> we could fix them in post-processing, but yeeech
20:11:56 <ChrisWarrick> add a big disclaimer? create three rest files with a common header?
20:12:00 <[Tritium]> Either way, I have a way forward which i can hack on, but I am up against time right now.  will work on it tomorrow
20:12:16 <[Tritium]> several, actually
20:12:54 <ChrisWarrick> ralsina: Sadly, this is not something we can fix in the general case. We might have partial success (eg. reST headers only), but it’s nevertheless hard in this world
20:13:22 <ralsina> I expect I can make a "thing" that splits HTML in, say, every H2
20:13:29 <ralsina> and then fis links in most cases
20:13:34 <ralsina> s/fis/fix/
20:14:24 <ralsina> or on every special pagebreak comment (like we do for teasers)
20:14:53 <[Tritium]> That is actually what I suggested in my issue.
20:17:00 <ralsina> [Tritium]: it looks like a lot of very finicky work :-)
20:18:57 <[Tritium]> It will be more substantial than my last code contribution, thats for sure