Logs for #nikola for 2015-02-13

11:37:32 <count> hola! :)
14:16:25 <erdgeist> Hello. After some research I found out that the post-list-directive handler does everything I need to build my front page the way I want it to look like. It only is briefly mentioned in the handbook and there nearly all the exciting options are missing
14:16:44 <erdgeist> I had to take a look at the source to find out about the parameters: http://pydoc.net/Python/Nikola/7.2.0/nikola.plugins.compile.rest.post_list/
14:17:25 <erdgeist> And it seems reasonably well documented. But how comes that I could not find any of the well structured docs in the web?
14:20:24 <count> oh, hi erdgeist
14:21:44 <erdgeist> *augenreib* What are _you_ doing here?
14:22:25 <count> migrating from jekyll (soon-ish)
14:23:40 * count is getting more and more sick of Ruby, to be quite honest
14:24:16 <erdgeist> count: Well, the last time I looked, in 2013, this directive-handler just was not there yet and I could not re-build my site.
14:25:04 <erdgeist> count: We've even started our own generator
14:25:25 <ChrisWarrick> erdgeist: you are reading old source, please read the real source on github instead
14:25:44 <erdgeist> ChrisWarrick: Huh? Did you actually read what I wrote?
14:26:05 <count> erdgeist: yeah, I remember us having that discussion .. by now, I've abandoned pelican and worked a bit with jekyll, but I'm still not happy
14:26:07 <erdgeist> I am not complaining about the source code but about the lack of documentation for this really useful feature
14:26:11 <ChrisWarrick> erdgeist: in the future, read 7.3.0 source/github and not docs
14:26:54 <count> erdgeist: I'll give nikola a try and see whether the extensibility I need is there. I consider it much more worthwhile to extend/contribute to Python code, even if I might be able to do the job with Jekyll
14:26:58 <ChrisWarrick> erdgeist: we could probably just copypaste that docstring away
14:27:06 <erdgeist> ChrisWarrick: yep
14:27:35 <erdgeist> ChrisWarrick: It could go here: http://getnikola.com/handbook.html#post-list
14:28:47 <ChrisWarrick> erdgeist: I know of that  place
14:34:53 -GitHub[nikola]:#nikola- [nikola] Kwpolska pushed 1 new commit to master: http://git.io/NuM0
14:34:53 -GitHub[nikola]:#nikola- nikola/master 8061820 Chris Warrick: copy-paste post_list documentation
14:35:09 <ChrisWarrick> erdgeist: done.  getnikola.com will be updated when v7.3.1 is released (later today, most likely)
14:37:00 <count> whoa, interesting turnaround time
14:40:05 <ChrisWarrick> count: it’s just “one of the maintainers has a while to copy-paste things over”
14:40:16 -travis-ci:#nikola- getnikola/nikola#4643 (master - 8061820 : Chris Warrick): The build passed.
14:40:17 -travis-ci:#nikola- Change view: https://github.com/getnikola/nikola/compare/21aba3f2eda2...806182009c7f
14:40:17 -travis-ci:#nikola- Build details: http://travis-ci.org/getnikola/nikola/builds/50638968
14:41:28 <count> ChrisWarrick: fairynuff ;)
14:42:39 <ChrisWarrick> (then again, I generally get things done pretty fast, especially for fellow Europeans)
14:47:17 * count considers that another reason to convert to Nikola
14:48:02 <ChrisWarrick> count: are you aware of http://plugins.getnikola.com/#import_jekyll ?
14:48:34 <count> ChrisWarrick: yupp. I've had a glance
14:49:05 <count> ChrisWarrick: I've yet to see whether the bi-lingual feature is the way I need it, but other than that I'm pretty much sold. I'd have to (re)implement it for Jekyll anyway
14:49:20 <ChrisWarrick> count: how do you need it to work?
14:52:22 <count> ChrisWarrick: setup: //site/slug/ selects //site/slug/index.html.de or //site/slug/index.html.en by browser setting (done via htaccess); //site/en/slug/ is rewritten to //site/slug/index.html.en, similar for /de/, also via htaccess;
14:52:45 <ChrisWarrick> count: why via htaccess?
14:53:12 <count> ChrisWarrick: I need an index.html.en written with the english template, index.html.de with german template ; but there might be only english text or only german text or both
14:53:30 <count> ChrisWarrick: could have done it in the server config *shrug* same difference
14:54:03 <count> ChrisWarrick: and I'd want the updated-date/metadata of e.g. the english variant available for display on the german variant
14:54:29 <count> ChrisWarrick: nothing too involved, just needs to be accounted for *shrug*
14:55:11 <count> ChrisWarrick: I'll have a look at what's there and shall implement what's missing
14:55:31 <ChrisWarrick> count: sadly, Nikola can’t do it the way you want.  You would have to decide which language is more important, and make it //site/slug/index.html, and make the other language //site/xx/slug/index.html.  Fallback should work fine with default settings.
14:55:56 <count> ChrisWarrick: eek :(
14:56:13 <ChrisWarrick> count: do you explicitly need files named index.html.de and index.html.en?
14:56:25 <count> ChrisWarrick: that makes the other stuff way easier
14:56:26 <ChrisWarrick> count: or could you just work out some rewrites?
14:58:03 <ChrisWarrick> count: in order to make things work the way you want, you’d have to patch link generation for posts, which I guess could be done if you really wanted to
14:58:09 <count> ChrisWarrick: if there's a plugin hook like http://jekyllrb.com/docs/plugins/#Generators I can make it work either way
14:59:14 <count> ChrisWarrick: like I said, I'll have a look at what's there and how that works and will go from there. might end up staying on Jekyll, but a blog should be about the content anyway
15:00:04 <ChrisWarrick> count: you will end up patching https://github.com/getnikola/nikola/blob/master/nikola/post.py#L663
15:00:15 <count> ChrisWarrick: I figured I'd start reading and giving feedback here to see whether I'm going off in the wrong direction after all, so you'll keep hearing from me until it either works like I want it - or I've abandoned it ;)
15:01:39 <count> ChrisWarrick: looks like, yupp. hardcoded language path pattern, argh
15:01:48 <count> ChrisWarrick: easy enough to modify
15:02:04 <ChrisWarrick> count: assuming DEFAULT_LANG = 'en'.  If you wouldn’t mind putting things like general blog index or archives or whatnot in /de/ or /en/ as “regular” files, you would just have to remove self.translations[lang] and add the language-specific extension at the end
15:02:58 <ChrisWarrick> count: s|/de/ or /en/|/de/|g
15:03:37 <count> ChrisWarrick: yeah, all easy enough. I'll kick the tires on the weekend next week and will probably just send a pull requesst
15:03:51 <count> ChrisWarrick: I'll want to understand the whole framework either way
15:06:09 <ChrisWarrick> count: I’m afraid producing a pull request will be harder.  You see, what I just said depends on (a) not caring about errors from `nikola check -l` and (b) configuring your server correctly.  Nikola would generate links pointing to //site/de/slug/index.html nevertheless, that’s hardcoded in a thousand places.
15:06:37 <count> ChrisWarrick: fsck.
15:07:07 <ChrisWarrick> count: sorry, we’re quite opinionated when it comes to the output structure.
15:07:07 <count> .o( there might go my hope of having an easy way to move over to a python-based static site generator )
15:07:44 <count> ChrisWarrick: yeah, most static generator software is. jekyll is amazingly strict about input structure, surprisingly
15:07:46 <ChrisWarrick> count: you can still have your own fork that works this way
15:08:58 <ChrisWarrick> count: would you mind telling me why do you need those index.html.en things?  Are there links out there in that format?  Or do you have some tools that require this format?
15:09:12 <count> ChrisWarrick: would there be willingness to get rid of the opinionated-ness in general? then having a look with that in mind might not be entirely unreasonable
15:10:15 <ChrisWarrick> count: we could try
15:10:17 <count> ChrisWarrick: I just want the language to be autoselected if you use //site/slug/, but also a possibility to explicitly select a language. how, I almost don't care. '//site/%s/slug' % lang seems sensible to me.
15:10:43 <ChrisWarrick> count: up until this point, Nikola generally works out
15:11:02 <count> ChrisWarrick: sure. I find myself having an edge case - and being opinionated about it ;)
15:11:10 <count> ChrisWarrick: pelican also fell short *shrug*
15:11:17 <ChrisWarrick> count: pelican is dumb
15:11:45 <count> ChrisWarrick: no shit
15:11:45 <ChrisWarrick> count: If you don’t care that the navbar is in the default language and not in the language of the text, and also do not really care about index.html.(de|en), Nikola should do it just fine
15:12:03 <count> ChrisWarrick: I care about the navbar being in the localized language ;)
15:12:17 <count> .o( easy isn't for jedi .. )
15:13:05 <ChrisWarrick> count: hmm, could you somehow redirect on 404s in your web server?
15:13:25 <count> ChrisWarrick: sure. htacess with apache.
15:14:15 <ChrisWarrick> count: this would require a few patches to untranslated post behavior, but would otherwise work out
15:15:50 <ChrisWarrick> where “few patches” means “drop the `not kw["show_untranslated_posts"]` clause in https://github.com/getnikola/nikola/blob/master/nikola/plugins/task/pages.py#L50 ”
15:15:59 <count> ChrisWarrick: cludge as cludgers can ;)
15:17:34 <count> ChrisWarrick: give me a chance to get my head into the code and we'll see what I'll end up with :)
15:24:52 <count> hmm, less than 10k lines actual code. managable.
15:28:19 <ralsina> count: and most of it you can probably ignore ;-)
15:29:41 <count> the usual ;)
15:30:22 <ChrisWarrick> count: “ignore” = various plugins
15:35:31 <count> yupp
15:39:21 <s2hc_johan> can't you add your own extension that runs at the end and move files around the way you want to?
15:41:37 <count> probably :) can I get a chance to look at the code over the weekend / next week? ;)
15:41:49 <ChrisWarrick> count: sure thing, go on
15:43:03 <count> (gotta say I love the helpful attitude here a lot, though)
15:43:39 <ChrisWarrick> s2hc_johan: sounds like a sensible L******k that runs before s*****p, assuming that would not mess up s*****p and you would of course need to change the U******E setting or otherwise it would not look too good.
15:45:01 <erdgeist> ChrisWarrick: Thanks, sir
15:45:07 <ChrisWarrick> erdgeist: no problem!
15:45:36 <s2hc_johan> well, basically its the same structure, only that you have language spec at a other place.
15:46:21 <count> .o( http://www.sinfest.net/view.php?date=2000-07-05 )
15:46:35 <s2hc_johan> links would be f***ed up, but that you specify mostly by yourself. Come to thing about it thats probably not as true for the blog as it is for the pages
15:46:51 <s2hc_johan> s/thing/think/
15:47:55 <ChrisWarrick> s2hc_johan: except the way we do URLs can’t be changed as easily without patching a lot of code, especi[Cally with count’s peculiar use case
15:48:34 <count> ChrisWarrick: just to double-check: is the usecase absurd, or valid enough?
15:50:15 <ChrisWarrick> count: If you do it the usual Nikola way and don’t try index.html.(de|en) with the double URLs, it’s quite sensible; in fact, some of your ideas (translated navbar) would even be a nice addition to the Nikola core.
15:51:51 <count> ChrisWarrick: yeah, but having the language forced on me in the URL is just a no-no
15:52:07 <ChrisWarrick> count: https://chriswarrick.com
15:52:54 <count> ChrisWarrick: *nod*
15:53:11 <ChrisWarrick> count: try playing with the Polski link in the corner, or with the two android posts (which exist in both languages)
15:53:48 <count> ChrisWarrick: yupp, that looks about right like I want it :)
15:54:05 <count> ChrisWarrick: 'xcept for the URL, of course
15:54:16 <ChrisWarrick> count: you’d prefer /en/2015/01/30/systemd-is-awesome/ ?
15:55:57 <ChrisWarrick> count: that’s doable too with a little help from apache for the top dirs
15:56:16 <count> ChrisWarrick: /2015/01/30/systemd-is-awesome/ + /en/2015/01/30/systemd-is-awesome/ + /pl/2015/01/30/systemd-is-awesome/ _or_ /2015/01/30/systemd-is-awesome/ only with ?lang=en, but that would make it non-static
15:56:19 <count> ChrisWarrick: yeah, one symlink.
15:56:41 <ChrisWarrick> count: certainly doable with Nikola the way it is today
15:58:17 <s2hc_johan> but the key thing is that the default language is required, right
16:00:53 <ChrisWarrick> s2hc_johan: yes, but you could just make DEFAULT_LANG='en' go into the /en/ subdirectory
16:02:37 <s2hc_johan> True, but you can't build nikola if you don't have a file handling the default language
16:03:08 <s2hc_johan> count wanted index.html select either en or de, based on settings and availability
16:03:16 <s2hc_johan> count: a'm I right?
16:04:21 <s2hc_johan> might be that I've got DEFAULT_LANG='', but I just tried to create a blog like lang_test.se.rst, and it failed, added lang_test.rst and it worked
16:04:24 <ChrisWarrick> s2hc_johan: there are ways to work around it, with the help of apache and rewrites
16:05:15 <s2hc_johan> yea, basically it shouldn't be that hard to make apacha selsect /site/en/index.html rather then /site/index.html.en
16:10:35 <ralsina> the navbar is translatable already, or am I missing something?
16:11:18 <ralsina> you could have the ".html" also be ".html.en" via a multiplier task
16:11:21 <ChrisWarrick> ralsina: it is, but language fallback via show_untranslated_posts disregards that
16:11:31 <ralsina> oh, yeah, but that looks like a bug ;-)
16:11:54 <ralsina> or maybe not. I am not sure I follow.
16:16:48 <ChrisWarrick> ralsina: not a bug
16:17:00 <ChrisWarrick> ralsina: https://chriswarrick.com/pl/blog/2015/01/30/systemd-is-awesome/
16:17:05 <ChrisWarrick> ralsina: meta is in Polish, text is in English
16:17:20 <ChrisWarrick> ralsina: this is generally good, but doesn’t work out for the use case presented above
16:17:26 <ralsina> oh, right, yes, fallback text with the "real" nabar. Makes sense
16:28:34 <s2hc_johan> A super cool feature would be to have some form of fallback priority, and with that being able to create posts in just one language and that not being the default one
16:28:59 <s2hc_johan> then you could have the possibility of english navbar, but posish blog text
16:29:54 <s2hc_johan> but there might be more internal obstacles since, if I'm not mistaken, the template is choosen from the default language file
16:51:19 <erdgeist> ChrisWarrick: can you help me with what to do with what I think is a bug?
16:51:34 <ChrisWarrick> erdgeist: what is it?
16:52:32 <erdgeist> ChrisWarrick: I am sorting my projects into tiny "stories" that do not have more than a description, a title and a link
16:53:00 <ChrisWarrick> erdgeist: [shameless plug] http://plugins.getnikola.com/#projectpages
16:53:08 <erdgeist> ChrisWarrick: Now, because this story does not need (and have) text in the body, nikola crashes
16:53:18 <erdgeist>   File "/Library/Python/2.7/site-packages/nikola/plugins/compile/rest/__init__.py", line 100, in compile_html
16:53:21 <erdgeist>     out_file.write(output)
16:53:24 <erdgeist> TypeError: must be unicode, not str
16:53:29 <ChrisWarrick> that’s amusing
16:53:45 <erdgeist> ChrisWarrick: I did notice your project pages plugin
16:54:05 <erdgeist> ChrisWarrick: But I already DO have legacy html that I am not going to touch in the first run
16:54:14 <ChrisWarrick> erdgeist: okay
16:55:10 <ChrisWarrick> erdgeist: you don’t use ${post.text()} at all, right?
16:55:31 <erdgeist> No,         ${post.description()}
16:55:35 <erdgeist> thats all
16:56:00 <count> sorry, back
16:56:43 <count> s2hc_johan: well, if there's both an index.html.en and an index.html.de Apache will select the one with the correct configuration - and the default language configured there, not in Nikola
16:57:31 <ChrisWarrick> erdgeist: cheap solution, remove the empty line in your .rst files
16:57:58 <erdgeist> ChrisWarrick: Since I do not need the text, anyway, I can just put a "_" there
16:58:10 <ChrisWarrick> erdgeist: if you want to
16:58:24 <ChrisWarrick> erdgeist: it would be eaiser just to have the three lines with .. on it and nothing else
16:59:20 <erdgeist> ChrisWarrick: Thanks for the tip. I just noticed it should not be doing this
16:59:30 <erdgeist> ChrisWarrick: And the report is not exactly obvious ;)
16:59:37 <ChrisWarrick> erdgeist: not our fault, really
17:00:45 <erdgeist> oO
17:01:23 <ChrisWarrick> erdgeist: this is caused by docutils doing something weird, and you having weird posts
17:01:37 <count> .o( point more fingers! :-D )
17:01:59 <erdgeist> that's why I did not open a ticket but dropped the question here
17:02:19 -GitHub[nikola]:#nikola- [nikola] Kwpolska pushed 1 new commit to master: http://git.io/Nzjn
17:02:19 -GitHub[nikola]:#nikola- nikola/master f1925b4 Chris Warrick: fix a strange bug...
17:02:21 <ChrisWarrick> erdgeist: either way, a more real fix ↑
17:03:28 <erdgeist> thanks a lot
17:04:00 <ChrisWarrick> ralsina: how does one contact docutils upstream and report bugs?  is there something sane I could use (github, bitbucket) or is it harder (sourceforge, mailing list requiring registration)?
17:08:05 <count> ChrisWarrick: seems like they expect you to post to [email protected] - if you're not subscribed you're expected to just point that out
17:08:25 <ChrisWarrick> count: well, hope they find this bug one day
17:09:14 <count> ChrisWarrick: and ruin the entertainment for generations of users?!? killjoy ;)
17:10:23 -travis-ci:#nikola- getnikola/nikola#4644 (master - f1925b4 : Chris Warrick): The build passed.
17:10:24 -travis-ci:#nikola- Change view: https://github.com/getnikola/nikola/compare/806182009c7f...f1925b483cc1
17:10:24 -travis-ci:#nikola- Build details: http://travis-ci.org/getnikola/nikola/builds/50658962
17:10:29 <ChrisWarrick> thanks travis
17:10:33 <ChrisWarrick> I didn’t break anything, yay~~
17:13:16 <count> hmm. I guess I have to look at these Github/travis services for IRC for my own stuff as well
17:15:04 <ChrisWarrick> count: github does it in the services setting, for travis look at our .travis.yml file, for Windows CI look at appveyor
17:17:13 <count> ChrisWarrick: cool
17:30:11 <ralsina> ChrisWarrick: it's SF and they hardly look at bugs
17:30:24 <ralsina> ChrisWarrick: and there is a hug thread about how they hate github and DVCS
17:30:46 <ChrisWarrick> a “hug” thread that hates on things?  That’s certainly amusing.
17:30:52 <ralsina> huge
17:31:21 <ChrisWarrick> anyways, let’s just not report this minor fuckup and move along
17:31:34 <ralsina> but yes, also lots of "oh we are so smart, svn is simple, github is proprietary, noone is blocked because of us living in a cave"
17:32:33 <ChrisWarrick> is SF open-source?
17:33:06 <ChrisWarrick> of course not
17:33:11 <ChrisWarrick> they even run ads, something github never did
17:34:15 <ChrisWarrick> no, wait, it seems to be https://allura.apache.org/
17:35:07 <s2hc_johan> count: I thinkt nikola is actually doing what you try to do in apache. Like Chis page where you have polish but the blog shows english.
17:36:53 <s2hc_johan> I'm a bit bothered by the default language myself by varios reason, but I haven't looked deep into the code enough to say how much it would break things.
17:38:29 <s2hc_johan> I'm using nikola on plain sites, not blogs, and there are some times when there are mulitple languages and some things should only exist in one language, not always the "default" one
17:55:58 <ralsina> s2hc_johan: hide_untranslated_posts is supposed to handle that
17:56:02 <ralsina> you can have things that exist only in the primary, only in the secondary, or in both
18:02:37 <count> coming to think of URL templating .. how is the os.path.join expected to create valid URLs on non-POSIX OSes?
18:53:05 <ChrisWarrick> count: it’s not and we don’t use it there
19:46:22 <s2hc_johan> ralsina: i tried to create a post named langtes.se.rst earlier and that failed the build, whem i added langtest.rst it worked
19:47:07 <ralsina> s2hc_johan: if you can create a step-by-step description of what you tried, and how it surprised you, please file a bug :-)
20:45:58 <erdgeist> When using markdown as language for my posts, how would I pass the meta data? Nikola seems to ignore the yaml header and parse the post's filename:
20:46:01 <erdgeist> OSError: You must set a title (found '2008_07_23_-_21_06_-_Datenmessie'), a slug (found '2008_07_23_-_21_06_-_datenmessie') and a date (found 'None')! [in file blog/2008_07_23_-_21_06_-_Datenmessie.md]
22:51:31 <count> hm. a lot of hardcoded foo.
23:05:34 <count> http://nikola.readthedocs.org/en/latest/internals/ .. "Nikola is a Pile of Plugins" .. no shit.
23:37:48 <count> feels kinda cobbled together and a bit cludgy :-/ i.e. somewhat ad-hoc architecture
23:38:16 <count> it'll work for you (otherwise you'd have changed it), but I'll stick with Jekyll for a while longer but might convert later on.
23:38:26 <count> best of luck, and thanks for writing free software! :)