-
Notifications
You must be signed in to change notification settings - Fork 36
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
Example images code #197
Comments
this just exists for gtk3 and is fetched from the official docs: https://github.com/pygobject/pgi-docgen/tree/master/pgidocgen/girdata/clsimages/Gtk-3.0 -> https://github.com/pygobject/pgi-docgen/blob/master/pgidocgen/update/clsimages.py so it's special.. |
Damn it! I was hoping the image generation was done on your end. Okay, I guess I will file a bug with Gnome... :) |
Okay, I think I closed this issue a bit prematurely. I have just been doing some digging on how to make a file an issue with Gnome, discovered it was all on GitLab, and so that allowed to me to do some digging which led me to this file which appears to contain the code to create the example graphics. https://gitlab.gnome.org/GNOME/gtk/-/blob/master/docs/tools/widgets.c The code looks fairly straightforward to pass for individual code snippets as the snippets take the form of: static WidgetInfo * create_<widget_name> (void)
{
...
} where <widget_name> is the name of the widget that it creates but with a Could the doc build script check this file for the example code when it incorporates the example image into the example section? |
I think that's a bit out of scope for this project. Also it would be C code, and we generate docs for Python |
Fair enough, I thought you might have some translation code in the project to rewrite the basic C code as python. Should i contact Gnome and see about them including the C code on their docs page. While I don't like C, others might find it helpful. It seems silly to have the code their in the repository and not include it in their docs. |
Can't hurt to ask I guess. We have extra docs which go into actually using the API, like https://python-gtk-3-tutorial.readthedocs.io/en/latest/ |
Yes, I went back to that last night! I love your docs as I find them so easy to read. I got stuck with ListBoxes as they seem easier to use for a very simple GUI when you have your own complicated python model class structure built up, but I couldn't figure out how they made that nice header for the ListBox example. Looking at the example code creator it turns out they cheated by using a button as the first entry in the list. Grrr. I think it will works nicely, just a shame that such a nice thing wasn't documented and took me a while to exhaust my ideas. |
Maybe this exists as a stupid question because I don't know how the docs get built...
I notice that some of the doc pages have images as examples, and so I was wondering if the code used to create that example could go on the doc page as well. I don't know where the images come from, if they get auto-generated from code, but if so, then I thin it makes sense to put the code there as well, whether by clicking on the image, or just having it next to it, or something.
The text was updated successfully, but these errors were encountered: