-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace context: mustache.Context
object with data: JsonNode
object
#102
Comments
This sounds great! What I like the most is the ability to just do |
Yes, another good reason for the change is Json api is much better and more well known than the Context one. |
while thinking about api for table of contents (#58), I had some thoughts about this. what if we introduct a new type for field type
NbData = distinct JsonNode instead of directly using JsonNode we could use a distinct version where we implement other stuff. nb.data.get(MyCustomObject, "custom_object_key") (and one can think on implements failures when in key there is not the correct type or you get a default ...) To go back to the original point, for the toc case we might have a One of the tricky aspect would be visibility of jsony (does not play well with some other json stuff, but visibility is required to use hooks). Unclear also if really needs to be a distinct object (or could just be a JsonNode). |
I don't see why we would have to make it a |
currently
NbDoc
andNbBlock
have both acontext
field of typeContext
taken frommustache
to collect unstructured data. This is further used by the html render backend to render stuff and one thing I do not like is that we modify the context both of doc and block when we render with the backend. Also none of the particular stuff ofContext
object is used.Instead we should have a
data
object which is a standardJsonNode
and when rendering with mustache we should generate appropriate context. This would be a first step in a general refactoring of backends which would in general be the target for the next big version (0.4). It should allows us to have a new html backend based on nimja instead of nim mustache for example.The text was updated successfully, but these errors were encountered: