-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Datasette 1.0 documented template context (maybe via API docs) #1510
Comments
If I set a rule that everything available in the template context MUST also be available via the JSON API (maybe through an extras mechanism) I can combine this with API documentation and solve both at once. |
I really like the idea of making this effectively the same thing as the fully documented, stable JSON API that comes as part of 1.0. If you want to know what will be available to your templates, consult the API documentation. |
I prototyped an approach to this using dataclasses and a See 6822378 for how it works. Here's the class that documented: datasette/datasette/context.py Lines 54 to 68 in 6822378
And the code that generates the rST: datasette/datasette/context.py Lines 19 to 45 in 6822378
And the bit that cog executes: datasette/docs/template_context.rst Lines 9 to 12 in 6822378
|
Documented context plus protective unit tests. Goal is that custom templates built for 1.x will not break without a 2.x release.
The text was updated successfully, but these errors were encountered: