Skip to content
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

Add example links on the attribute page #217

Open
logankilpatrick opened this issue Sep 18, 2020 · 8 comments
Open

Add example links on the attribute page #217

logankilpatrick opened this issue Sep 18, 2020 · 8 comments

Comments

@logankilpatrick
Copy link
Contributor

Per a conversation I had with Alan, I think it would be really great to add example links to each of the attributes: http://docs.juliaplots.org/latest/generated/attributes_plot/

It looks like the info is being brought in from here:
https://github.com/JuliaPlots/Plots.jl/blob/bf85afe9d6b67923cc000acaa1bdb499a87949b1/src/arg_desc.jl so would it be best to add the links to the examples there?

I can start finding examples and linking them if this is the right approach to add this.

@BeastyBlacksmith
Copy link
Member

That depends on whether these links should also be displayed when people use the plotattr function from the REPL.
I don't think it is a good idea to store directly the URLs in that dict.
Maybe its good to store the numbers of the examples in that dict and generate the links at documentation build time.

That may get forgotten when new examples get added, but would be less complex than extracting from the examples what attributes got used.

@logankilpatrick
Copy link
Contributor Author

That works for me, I don't want to add things to your place but I am happy to find all the example projects and link them if you or someone else set's up the hooks for the links to be generated at build time.

@BeastyBlacksmith
Copy link
Member

BeastyBlacksmith commented Sep 18, 2020

We might need to clarify what you mean by "example links". I thought we are talking about these. For examples in other packages we have the ecosystem section

@logankilpatrick
Copy link
Contributor Author

All I mean by "example links" is a link on each attribute a user can click on and then see said attribute in action. This will hopefully serve as a way to bridge the theoretical and practical in this content.

@BeastyBlacksmith
Copy link
Member

I am still confused whether those links should point to the existing examples page, to examples that are created for that purpose or to examples that are somewhere in the wild.

@logankilpatrick
Copy link
Contributor Author

I think existing examples within the docs is probably better so we don't need to worry about external links disappearing. I'm guessing all of the attributes may not be present in the current docs but I (or others) can add examples or add the attributes to existing examples.

@BeastyBlacksmith
Copy link
Member

BeastyBlacksmith commented Sep 18, 2020

I see. This sounds like a useful idea. For this purpose it would make sense to generate these examples in this repository since the existing examples test many different things at once since they are used for the visual regression tests.
But for such reference examples it would actually be better to show the effect of each attribute in isolation or useful context.

@BeastyBlacksmith
Copy link
Member

After thinking about this for a while I think the best place would be to change https://github.com/JuliaPlots/Plots.jl/blob/master/src/arg_desc.jl to be a Vector{NamedTuple} with attribute, docstring, example fields.
This way the examples can also be shown by the plotattr function in the REPL and then we only need a good place in the docs to create and render all the figures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants