Logs for #nikola for 2016-04-26

17:27:22 <zoopp> Hello, does anyone else feel that the generated config file for nikola is a bit disorganized?
17:29:49 <zoopp> Mhmm, I guess I could start off by removing everything optional and just add things to the config on a need-to-customize basis..
17:31:09 <guillom> zoopp: That's what I did.
17:31:24 <guillom> It was too long for me to navigate through easily
17:31:46 <zoopp> yeah, that's exactly how I feel as well
17:37:11 <ChrisWarrick> zlatan: you could just delete all comments
17:42:35 <ChrisWarrick> zoopp:17:44:41 <zoopp> oh, that it could work for some of the settings
17:45:43 <zoopp> however, what bothered me is the fact that some related settings were spread across multiple locations in the file
17:45:52 <zoopp> just a sec to take a look and I'll give you a concrete example
17:49:02 <zoopp> for example, create a new nikola site and search for 'compiler' in the genreated conf
17:50:07 <zoopp> there are some entries that are far apart however they are reltead by their 'theme'
17:51:17 <zoopp> well anyway, I find that deleting everything optional and adding things as I need works better than reorganizing the whole config
17:53:13 <ChrisWarrick> zoopp: perhaps we should work on a reorganization one day
18:19:28 <[Tritium]> perhaps a front end config management application one day
18:19:39 <[Tritium]> (spoiler: im learning WX)
18:20:24 <ralsina> [Tritium]: such an app is going to be impossible to maintain
18:20:41 <ralsina> [Tritium]: since we have no schema declaring the possible options and values, and the config file is python
18:20:54 <[Tritium]> Crap.. hmm
18:21:07 <ralsina> OTOH, there is nothing preventing someone from creating a jsonschema description of options and loading it into conf.py using json.load()  :-)
18:21:15 <ralsina> Just needs to be smart about it
18:21:32 <[Tritium]> True
18:21:46 <ralsina> Once you have jsonschema you have tooling
18:22:13 <[Tritium]> Once you have jsonschema, you have made the problem a data problem not a code problem
18:22:32 <ralsina> yep
18:22:35 <ralsina> data problems are better
18:23:03 <ralsina> And suddenly you can do things like http://jeremydorn.com/json-editor/
18:23:06 <[Tritium]> though even then, there are some things you can do with a nikola config file that would never be supported by making it a data problem
18:23:17 <ChrisWarrick> like put functions in GLOBAL_CONTEXT
18:23:30 <[Tritium]> unless entry_points
18:23:40 <ralsina> indeed
18:23:46 <ralsina> I am sure something could be done
18:24:04 <ralsina> like a dict of strings with names and python code we could eval :-)
18:24:41 <ralsina> in any case, it would make conf.oy be 5 lines loading JSON and then whatever crazy crap a user wants to do on top of that goes at the end
18:24:46 <ralsina> conf.py*
18:24:46 <[Tritium]> fully qualified path to the function ('package.module.func')
18:24:58 <[Tritium]> aye
18:25:38 <[Tritium]> anyways, I have to scoor
18:25:41 <[Tritium]> scoot
18:26:45 <ChrisWarrick> there is no good configuration format
18:26:49 <ralsina> [Tritium]: Think about it :-)
18:26:56 <ChrisWarrick> JSON is limiting, tricky, and does not have comments
18:27:04 <ralsina> Of course there isn't a good one. There are just different ways to be crappy.
18:27:08 <ChrisWarrick> YAML is uneditable in vim, probably other editors too
18:27:38 <ralsina> And while YAML supports comments, you can't roundtrip it (read the config file, then write it) and keep the comments.
18:29:11 <ChrisWarrick> configparser has no idea of types and has single-line values
18:29:28 <ralsina> and also loses the comments
18:29:42 <ChrisWarrick> and all the obscure formats require equally obscure parsers which might be even more troublesome
18:29:47 <ChrisWarrick> (and don’t get me started about XML)
18:29:57 <ralsina> I *think* michael foord once wrote a config file format that handled comments correctly, but of course it's obscure
18:30:49 <ralsina> http://www.voidspace.org.uk/python/configobj.html
18:31:14 <ChrisWarrick> Version 4.7.2 27th February 2010
18:31:33 <ChrisWarrick> used by Bazaar and (probably formerly) IPython
18:31:40 <ralsina> I have talked with him about it once or twice... "it has no bugs reported since then, so no need to touch it"
18:31:47 <ChrisWarrick> py3k?
18:31:53 <ralsina> who knows
18:32:10 <ralsina> this is the whole thing http://www.voidspace.org.uk/downloads/configobj.py
18:32:44 <ChrisWarrick> ipython/jupyter does config-as-code nowadays, just with some overcompliation
18:38:00 <[Tritium]> configobj has been rehomed
18:38:41 <[Tritium]> https://github.com/DiffSK/configobj
18:40:04 <[Tritium]> out the door