You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A systematic approach to technical documentation authoring.
Diátaxis is a way of thinking about and doing documentation.
It prescribes approaches to content, architecture and form that emerge from a systematic approach to understanding the needs of documentation users.
ideal place to have example code. So far we have mostly included it in the User Guide and Gallery, but not really in the docstrings.
Having said that, I think it is helpful to see at least some simple examples directly in the docstring, but also that we are consistent so that users know where they can find the example code.
A third approach would be something in between with just a simple example in the docstring and more elaboration in the User Guide. Pros: There is both something directly in the docstring and also an elaborate version in the User Guide. Cons: We're now updating in two places, but maybe the docstring example can be keep so simple that it doesn't matter much.
Of the options presented, this would be my preference with ...
I'm viewing examples less in terms of simple vs complex, and more in terms of serving the context they are displayed in.
Of course these may overlap to some degree, but I think the needs differ enough to naturally lead to different examples written:
I've seen diataxis mentioned in altair before (#3117), which might be helpful in achieving consistency
Good reminder! I also think this could be helpful in the larger picture, but it's a bigger project for me to understand diataxis more intimately and think about if it would serve us to (iteratively) move towards that.
But I had a glance at the page and as per https://diataxis.fr/compass/ and https://diataxis.fr/complex-hierarchies/ maybe our current docs map onto diataxis something like this (mostly for future reference):
Diataxis
Altair
Tutorial
User guide
How to guide
Getting started + Gallery
Reference
API reference
Explanation
Advanced usage + a little bit here and there
I also think it would be helpful with something simple like more (two-way) links between the User Guide and the Gallery examples to guide readers toward more relevant information.
So I definitely appreciate examples in docstrings, but would be hesitant in adding them to autogenerated docstrings. They are already very long and repetitive, adding examples into the mix I think would be overwhelming.
...and more in terms of serving the context they are displayed in.
I find this framing and the structure in your proposal helpful. Let's proceed with that framework as our guide for deciding where to put examples and what they should look like.
What next?
I'm hoping this issue can serve as a place for discussion and act as a parent issue for smaller (more manageable) sub-tasks - if we can agree some areas of focus.
Any outcomes of the process itself can also help inform guides we provide to potential contributors.
would have to add examples to a fair amount of objects (can we even do it for what we autogenerate from Vega-Lite such as the marks, transform, etc?), would we have the same
So I definitely appreciate examples in docstrings, but would be hesitant in adding them to autogenerated docstrings.
They are already very long and repetitive, adding examples into the mix I think would be overwhelming.
Also if they are not written by hand, I expect they will be of low utility:
E.g. just demonstrating which values are allowed
Rather than showing examples of why you might pass specific arguments
The text was updated successfully, but these errors were encountered:
What is your suggestion?
Adapted from (#3500 (comment))
What is Diátaxis
Related discussions
Background
@joelostblom
@dangotbanned
@joelostblom (#3500 (comment))
Of the options presented, this would be my preference with ...
Proposal (@dangotbanned)
I'm viewing examples less in terms of simple vs complex, and more in terms of serving the context they are displayed in.
Of course these may overlap to some degree, but I think the needs differ enough to naturally lead to different examples written:
Docstrings/API Reference
Examples
when()
altair/altair/vegalite/v5/api.py
Lines 1275 to 1320 in 23b1891
Chart.transform_filter()
altair/altair/vegalite/v5/api.py
Lines 3042 to 3088 in 23b1891
User Guide
altair
API fits togetherGallery
How this fits into our docs (@joelostblom)
Adapted from (#3500 (comment))
@dangotbanned
Good reminder! I also think this could be helpful in the larger picture, but it's a bigger project for me to understand diataxis more intimately and think about if it would serve us to (iteratively) move towards that.
But I had a glance at the page and as per https://diataxis.fr/compass/ and https://diataxis.fr/complex-hierarchies/ maybe our current docs map onto diataxis something like this (mostly for future reference):
I also think it would be helpful with something simple like more (two-way) links between the User Guide and the Gallery examples to guide readers toward more relevant information.
@dangotbanned
I agree with this.
@dangotbanned
I find this framing and the structure in your proposal helpful. Let's proceed with that framework as our guide for deciding where to put examples and what they should look like.
What next?
I'm hoping this issue can serve as a place for discussion and act as a parent issue for smaller (more manageable) sub-tasks - if we can agree some areas of focus.
Any outcomes of the process itself can also help inform guides we provide to potential contributors.
Rejected Ideas
Examples in autogenerated docstrings
@joelostblom
@dangotbanned
The text was updated successfully, but these errors were encountered: