sylvainfilteau / Refer

Tools that generates reference guides from markdown files in a directory
1 stars 0 forks source link

Normalized JSon #1

Open clesquir opened 12 years ago

clesquir commented 12 years ago

The generated pages.json should return a more conventional json. As for now, it returns something like this:

{
    "name":"",
    "child_nodes":[{
        "name":"Programmation",
        "child_nodes":[],
        "pages":[{
                "id":"normes",
                "title":"Normes"
        }]
    }],
    "pages":[{
        "id":"index",
        "title":"Titre"
    },{
        "id":"refer",
        "title":"refer"
    }]
}

It should return something like this:

{
    "id":"root",
    "child_nodes":[{
        "id":"programmation",
        "title":"Programmation",
        "child_nodes":[{
                "id":"normes",
                "title":"Normes"
        }]
    },{
        "id":"index",
        "title":"Titre"
    },{
        "id":"refer",
        "title":"refer"
    }]
}
sylvainfilteau commented 12 years ago

I'm sorry to say that the two examples are conventionnal JSON.

I wanted pages to be separated from "folder" nodes or child_nodes, that's why I created a custom proxy to handle this case.

The thing I can do is to add an id to folders and normalize title vs name field.

This is scheduled to be done in february.