Add support for TOML config files #1765

Merged
merged 5 commits into from Dec 5, 2013

Projects

None yet

5 participants

@parkr
Member
parkr commented Nov 28, 2013

As much as I like YAML, TOML is where it's at. I'm sure @mojombo would agree. TOML is fully-featured and still very readable.

We'd need a Ruby parser. Based on TOML's README under "Implementations", we have the following four options:

My proposal is to add in support for TOML alongside YAML files, i.e. this is valid:

$ jekyll build --config _config.yml,overrides.toml

TOML and YAML would thus both be supported by Jekyll.

Thoughts?

@gregkare

This is a good idea, I like it. So far I've only tried jm's toml, because it supports the same API as YAML, so you just need to change the class name in your code to switch to TOML.

I've done an experiment (quick and dirty, this is a spike branch) last month with supporting both TOML and YAML. I ended up with code like this:

Selector
TOML
YAML

I'm just using the extension, I haven't looked if some mime-type Ruby libraries can detect TOML.

Edit: Of course it's easy enough to write a wrapper to get any toml gem to use the same API as YAML :)

@parkr
Member
parkr commented Nov 28, 2013

Yeah, I use @jm's as well, though I figured we wouldn't discount the others.

@parkr parkr referenced this pull request in jm/toml Nov 29, 2013
Closed

Further support? #25

@troyswanson
Member

Ref #971

@parkr
Member
parkr commented Nov 30, 2013

@mattr- I think this is ready to go. Lemme know.

@mattr-
Member
mattr- commented Dec 5, 2013

LGTM!

@mattr- mattr- merged commit 052a577 into master Dec 5, 2013
@mattr- mattr- added a commit that referenced this pull request Dec 5, 2013
@mattr- mattr- Update history to reflect merge of #1765 dc7be86
@mattr-
Member
mattr- commented Dec 5, 2013

Urgh. So it does. Now to figure out why and to dig up an old version of 1.8.7 😺

@parkr
Member
parkr commented Dec 5, 2013

@maul-esel I can't quite narrow down why that happens. Do you have a minute to take a look?

@parkr parkr deleted the tomlify branch Dec 5, 2013
@maul-esel

It seems the TOML parser reads the config file totally wrong, though I have no idea why.
It outputs the following:

baseurl: "47121111117459810197117116105102117108459810811110345121111117"
title: "77121321099710311010510210599101110116321151051161014432119117116"

which of course doesn't match the expected output. Is that some weird encoding error? But then why does it recognize the keys? Maybe @jm can help here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment