-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Documentation Improvements #596
Comments
Hello Marcus and thanks for helping.
That would be good, generally anything Getting Started would be good :) (We can also strive to improve those example as I'm definitively not happy with how they build, but it's not a trivial problem to solve with multi-platform into the equation, lots of devil in the details. I was considering using Premake/Genie to provide easy project creation (and we can afford to embed Genie binaries). CMake is unfortunately really unacceptably messy and confusing.)
How would that differ from the existing code in examples/opengl_example/ ?
We have to look things up on a case by case basis. While it is probably the case most of the time, it isn't always a benefit to remove documentation from the source file. For example, when things changes it can be weird to only have one easily accessible version of the information on-line. So I think it would makes sense to keep simplified version in the code when possible and have fully developed version on the Wiki. If you are thinking mainly about the "Getting started" a better laid out and complete version on the Wiki would probably be advantageous and then we can clearly link to it from the source code. We just have to be careful with treating those important parts of the Wiki with the same quality as the code, making sure that important links don't break especially if they are linked from different versions of the code, etc. That said it'd be great if you want to have a go at it and we see how it goes. Also maybe have a look at #435 |
I'm looking for an example with as few lines as possible, in a single source file, for testing whether or not the system can actually run the library, and less about how to actually use it.
Glad to hear that. I understand it's tricky to stay generic and please everyone, but I find that it's a lot better to provide at least 1 way of doing things in full, whether that assumes glfw or what not, than to not provide any. I would suggest we take a stand on the libraries used in the guide(s) and then stay consistent with those. Having examples also stay true to the those assumptions. What do you think?
Are you thinking along the lines of Doxygen? For many projects I think it makes the most sense, but can I propose an alternative? I think that since imgui is an open source project with lots of potential contributors, it might make more sense instead keeping documentation simple and making contributing to it as simple as possible. You could use something like GitBook. If you make it simple to fix mistakes and append both guides and reference material, I think the docs would be much more alive, complete and accurate than it could ever be if automatically built. Here's an example of how I envision things. They can also be versioned and given a custom dns, along with statically built and hosted on GitHub Pages.
I'd be happy to setup Discourse for you, hosting is $5/month on DigitalOcean. I think it could really spark collaboration and create a persistent knowledge base. It's also useful for what you might normally use a blog for; such as release notes or news. |
To me that's exactly that those examples/ are doing tho.
I absolutely don't understand those statements above, sorry. Can you try rewording the whole thing? What does "at least 1 way of doing things in full" stands for? "take a stand on the librairies used in the guide" ? I don't believe/think the guide would have much to do with the librairies. The vast majority of code we have to document apart from "Getting started" will be portable ImGui code. Maybe you can draft your vision of Getting Started if it helps communicating what you mean. The example are here so people using different backends/engine can copy and paste the implementation code and have them ready to use.
I am thinking what is discussed in #435. Sorry for the hasty answer - I will have to look at your links in more details later but I am also overwhelmed by things to do so it may take a while until I form better answer. So don't hesitate to draft what you are thinking if you think it makes sense. |
Hi @ocornut, I've produced an example of how I envision a getting started guide to look and feel, with some notes at the bottom for how it can be improved. Let me know what you think. |
Hmm.. I am really confused about this now. I don't understand why the example stray away from opengl_example/ when it is basically the same-but-different. Part of the idea of those examples is also that the user can use the imgui_impl_ files WITHOUT having to look at them. So this guide is both showing you more than what you need to if you are using glfw (which is the intended audience), while also being incomplete (e.g. lacking keyboard, etc.). From that angle, I am not sure I see the added value here. But I see the potential for a) luring people into wrong direction (only a fraction of choices available on wiki vs code, so they end up in a spot with much more limited choice and aren't directed to others) and b) encouraging people to reimplement something they don't have to, making further updates harder. If the target audience for a given article is locked to e.g. Linux/GLFW then shouldn't the instructions be It feels like you are just recreating the existing example, as your todo are just leading there. For example when you say:
This is exactly what the Additionally, if we refer to e..g GLFW we have to make it 5000% clear that it isn't a dependency of ImGui but rather part of the example of how to open a window and render triangles. I am curious about your own experience getting started with ImGui with GLFW and if you had to reimplement this or if you couldn't just build/run the example and copy the imgui_impl_glfw.cpp file into your app. The comment at the top of opengl_example/main.c says:
The comments are the top of imgui_impl_glfw.cpp says:
Perhaps the main.cpp file should refer more explicitly to the imgui_impl files. Mind you I still think Wiki is a great idea but I'd like to clear out the confusion above! |
Ok, no harm done. :)
Aha, I think we are getting somewhere. This was not obvious to me. I think these.. shall we call them "reference implementations"?.. are great, but it wasn't clear to me that that's what they were. To me, an example is an example of how I can use imgui. In the example there are three source files, so I understood that I would need the contents of those files for any and all of my projects. It seemed a bit much, and this was what sparked my interest in trying to build a smaller example. A misunderstanding, to say the least!
Yes, this I still believe is needed. This is what I meant by minimal. It doesn't have to do everything. It should only include the absolute bare essentials for getting anything on screen at all. Think of it as the equivalent of a
Perhaps there is a better place for these reference implementations than being bundled together with the examples. If they aren't meant to be written by the user, then I would expect them to be part of the library alongside everything else that isn't meant to be written by the user. But I can see what you are saying in that it would also bloat the currently generic code. This isn't the place to discuss it, but perhaps a #include "imgui/platform/glfw3.h"
/* Application code here */ If you are interested in this change, then I think we should pop open another thread about it to keep the topic clean.
I glanced at the contents of each example and ran away in fear of not understanding what it was doing. Without a hello world example, it was difficult for me to know whether the errors I was getting was due to something in the lengthy examples or somehow related to my environment. Bottom line is, I never got those examples running and I didn't try very hard.
Maybe this is just me, but comments in source code is the last place I look when trying to understand a new software project. And frankly I haven't gotten frustrated enough to get there yet.
I don't think so, I think what you need is a getting started guide. |
The thing is that it isn't a black and white situation. Advanced users are likely to want to adapt this code or borrow only part of that. E.g. lots of users are building their own engine over OpenGL may want to borrow the rendering function but rewrap the inputs their own way. I have found many subtle/minor cases where altering this code may be useful once you use it in a real project, and it is hard to handle every single case without bloating those examples. If the issue is discoverability then we can update the docs/comments and a Getting Started wiki may help. Note that pretty much every single file says at the top something along those lines:
While I appreciate and understand the curse that programmers don't read documentation that are offered to them (I often don't myself and go on ask authors only to find the answer in the docs I didn't read then feel ashamed...often because of multiplicity of doc sources makes it more confusing) , I don't think they will necessarily find a read a Wiki page either. That curse carries over many mediums. We have to keep hammering links and information to redirect the user to the right place from every piece of land including source and web. We have to make sure the information is correct, up to date and easy to digest. Lots of work has been put to that but more work is needed! Regardless we will develop the Wiki so why not develop the Getting Started section and paving the way there.
Those are the hello world examples. You'll find there's not many differences between opengl_example/ and what you have posted above. Yours is a little shorter but for that small amount of difference I'd rather have one single 100 line example that handle 99% cases rather than one 80 lines example that handle 80% and another 100 lines example that handle 99%. Don't you think? I am very interested in your feedback and I think we can turn it into a concrete improvement. In my experience as a struggling new user you want to first take note of the struggle/issues you faced, because they are super important feedback. Then study/understand the whole thing a little better and then once you have that understanding get back at the issues you faced and see how you can fix/improve it now that you understand both side of it. I don't think the existing example are bad but we can improve them.
Didn't they compile? What was the problem? Those examples are meant to compile on your system. If they don't this is the number 1 issue to fix for me! :)
There is a "PROGRAMMER GUIDE - Getting Started" section but I should totally tweak that to show the word "Getting Started" in the top index. Some of that content can be adapted and improved for the web, and depending on where we get it may make sense to delete some of the in-code comments. |
I think we are talking about the same thing here. This is exactly what I would expect from a reference implementation. To be an example of how you could do it. Use it, or don't use it. It's just a reference. For getting started documentation, I think the first priority should be the oblivious new user; not the advanced one.
Yes, I think you are right. Since I learnt that the majority of those examples were in fact reference implementations, the What I meant was that I glanced at each example as a whole, running away from the reference implementations, thinking they were part of what I had to know and understand to use imgui. |
Sorry, hit the button before I was finished.
Ok, I'll just go ahead and say it. I don't think documentation belongs in your source files. I think they scare away new users such as myself and that it makes improving and contributing to it incredibly frightening. For example, there are numerous spelling and grammar errors in most of them that anyone could have fixed but won't. The Wiki might not be the best place for it, but it is a lot better than in the source files.
I think that's an excellent list! |
Please submit a PR! My English is part of the reason I would like the auto-generated documentation to focus on code+screenshot rather than blurbs of text. |
Aw man, you're not hearing me. :) |
That's the immediate next step and it will take you 5 minutes, whereas wiki is a more profound step. Most of those code comments probably won't need to be removed. |
one thing that I don't really see is what the render callback should do and what data it gets to do it. Currently that needs to be divined from the demos which requires knowledge of the API that the demo in question uses. |
Thanks @ratchetfreak! Would it help with a few lines of documentation about what each function from the header file does, along with motivation for its existence and alternative ways of approaching it? |
Hi. Just wondered if your lost interest/motivation on this? (seeing the typos never got corrected :) Any extra docs is great and fine but it needs to be done in a way where the docs are guaranteed up-to-date, ideally because it is automated. Many attempts at doing something are one-off-ok-bye, which is why I am cautious with people proposing to help before they actually use and rely on ImGui seriously. It's really better when you know you are going to like and use the library and fit in the ecosystem. It doesn't matter if a solution is arguably better if I can't pragmatically make it happen so I need to gauge ideas from the angle of how likely the prospect of it happening is.
FYI we think we already have an ok amount of documentation in line with the state of the library (unfinished) and the state of available support resources (little). Incremental improvements keep happening every week. But I said it a million times in other threads, I honestly think it would be detrimental to open the library to too many casual users before more of the missing features are added and stable. Containing growth keeps it more healthy and me more sane. Anyway #435 is still one of my most-wanted. I have a project for serious dev+doc that I would like to pitch and work on from January onward. |
Hi, sorry for the delay. In short, yes, I've lost some motivation and interest for now. As it stands, our goals are just too different.
As an example, we differ here. I think the solution isn't finding a few to manage complex documentation long-term, but rather to find a method with which many can manage simple documentation short-term. For example, the typos that I found. With what I have in mind, I could have spent 5 minutes fixing those bugs, without any prior knowledge of:
The same goes for fixing broken examples or adding pictures to code. Add to that, if I didn't want to fully commit to making changes to the project, perhaps because I am not confident enough that my change is worth making, I could instead add a comment on individual paragraphs and start a discussion about whether a change is actually necessary. Because of the lightness, the documentation would not only stay up to date, it would stay alive. But again, IMO. I currently have no interest in setting up automated documentation. That might change, and if it does I'll get back to you. |
Well it is a balancing act. Of course editing a Wiki is easier than fixing typo in source code (which should also take 5 minutes and PR are proposals so also easy to discuss), but it also mean stretching us (me) thinner than we are now. ImGui works because it is so carefully cared for and tweaked in great details. Letting people who aren't actually using the library write the documentation nilly willy is also a risk at diluting the quality of information badly. We don't need to lock on a few to "manage" complex documentation, we need to make sure the documentation is worthy and create sustainably with the little resource this project has. The internet is full of people who barely understand C++ and are trying to use this library. I want us to do our best to make it easier for them, but I don't want them to write the official documentation. We are aiming for the same things, except I am choosing a direction based on working on the project during the week-end (gauging my own stamina) and witnessing dozens of people using it daily. You are choosing a direction based on your own confusion at trying to use and embrace the project, which I think is a very very useful and constructive drive (because you are identifying real issues) but IHMO you need to clear out the confusion before turning that drive into action, which means actually using the library and taking small steps within the existing framework. If I see evidence that this project matters to you and you are using it then I'll be more ten times more receptive to you bootstrapping a better set of documentation for others. It is frustrating but I think it is the saner route to expand slowly and properly.
Not sure how you would do that without learning about Github or the project or coding at all :) Let me know if you want to close this. Btw I am treating this very seriously and not ditching your proposal, those discussions are helpful and feeding the plan. |
PS:
This is a prime example where adding this to documentation is a little counter-productive due to being a newcomer to the project, when all those choices were made very very consciously.
It is the responsibility of the library to guide the user to the best way they can use it through subtle or not subtle hints. |
For clarity, I am not suggesting we use the wiki. The wiki allows anyone to make edits without informing anyone, which makes it very difficult to manage quality. I'm suggesting GitBook, which has version control and support for hosting multiple versions (e.g. one per major version of the framework) and support for comments, issues, synchronisation with a GitHub account and custom CSS styling to name a few. You could automatically push portions of it via webhooks and something like Travis CI if you wanted a best of both world. |
Hi @ocornut,
I'd like to contribute Getting Started documentation for imgui via the imgui wiki.
I've already taken the liberty of refactoring its layout but wanted to check with you whether you would mind or have any preferences on future layout and included documentation.
What I'd like to cover primarily is:
And eventually, fully transfer the documentation currently hiding in the source file.
The text was updated successfully, but these errors were encountered: