Comments (15)
Hey there!
The exit
part of the docs is completely valid, that method was removed with 5.0.0
as it was no longer necessary (stop
did the same thing already). I will get onto fixing that.
Which non-obvious errors come up in the second example? To be quite honest it was written around the time of 1.0.0, so some things are a bit off on it from what I can see, namely the button being keyboard-actionable but not being visible or clickable, and the height of the window not being correct on launch. The button issue I'm uncertain about, but the window height is probably to an extent related to it. I suspect that the introduction of Container.overflow
broke some things here unfortunately, and I haven't gone back to check.
With the next release being based around layouts, I suspect that this page will soon be rewritten anyways, though there may be a time-delay on the documentation as I'm a bit busy with university work. Will try fixing as soon as possible.
Thank you for the report, and interest in the library!
from pytermgui.
Thanks for the follow up!
The more detailed example I stopped working on after two attempts. First issue was this line:
namespace = ptg.YamlLoader().load(PTG_NAMESPACE)
where PTG_NAMESPACE
is undefined. I replaced it with "namespace.yaml", but that's not right. Finally I figured out that this needed the yaml file read into a string. (and to have pyyaml installed). Once I did that, it was close - the vertical layout (as you mention above) is a little messed up with the inner two boxes losing their lower edges to the outer box.
I totally get the position you're in if you're about to release a major overhaul to how this works. It definitely makes sense to get that work done first and then update the docs (AND make sure you stay on top of your studies - that's way more important!).
Just wanted to make sure I passed on the info. Thanks for the work you put into this tool and good luck!
from pytermgui.
Yup, no idea where PTG_NAMESPACE
came from. Thank you for letting me know about the issue, I'll close this thread when the docs have been "modernized".
from pytermgui.
Just wanted to chime in that it does seem like the docs need a bit of an overhaul. I almost wonder if they would be better moved to this repo, perhaps in a docs
folder or the wiki, just so they could be better maintained by users as well.
from pytermgui.
I am interested in seeing improvements in the docs as well - they are pretty comprehensive as far as annotating the API goes, but I don't really feel like there's a graduated "start here, then progress" path. There is a rudimentary program to show the basic window, but nothing much beyond that, at least that I could find. I dunno, maybe I am slow, but I'd love to see some kind of increasingly more complex series of tutorials.
from pytermgui.
Yes I definitely want to stress that the docs, in terms of quality, are amazing. The pictures, descriptions, all on point. The main issue is that they are outdated, which is bound to happen when a project like this is still in the breaking changes phase.
from pytermgui.
I very much agree with all the points made above! The API docs are pretty much 100% up to date, as they are generated straight from the source, but the manually written markdown docs have been neglected a bit (well, last I really updated them was around 1.0.0, so maybe more than a bit). My biggest problem with documenting is that I, as the person who wrote 95% of the library, know my way around it to an uncomfortable level, where I can usually solve temporary limitations/bugs by exploiting some "hack" around the system. Because of this, I'm not quite sure which parts should be explained more thoroughly, and what is particularly hard to get around.
I would generally love to hear some feedback on that part specifically. I have a lot of local files I use for testing/"sandboxing", but most of them are tiny and not really useful for much. I would also be open to seeing some community made examples, as you guys probably know the things discussed above better than I do.
It's worth mentioning that the current documentation generator will probably be replaced at some point with something I'm planning to write. Essentially, it would be a wrapper around ptg.inspect
, which would use that function to document any module and generate html from it. This is still mostly in the planning/early architecture change, so no idea when (if ever) it will become a thing. Part of the reason I want to make this is that the current system isn't really build around creating static markdown based documentation, which would be really beneficial.
TL;DR: I'd love to hear input on which parts of the library need examples/documentation, since I'm not really able to determine the complexity of the systems I know completely, and if you are interested, I would love to accept some PRs that add relevant examples to the project. Better documentation is on the way, but with an uncertain timeline
P.S.: Thank you for appreciating the documentation :) I spent a lot more time on it than I think is visible, so it's great to hear that it was worth it!
from pytermgui.
For me, I am having a hard time just getting off the ground. What I'd like to have is a boilerplate file that provides me with a blank window/frame/whatever-the-terminology-is-here that I can start dropping widgets into. I can probably figure out all the stuff to put in there once I have a basic sandbox.
For my immediate needs I'd like to drop in a label that displays a single line of ANSI-coded text; below that, some buttons, all on the same row (kind of like a tabbed/notebook widget), and that accept clicks and call other code based on those clicks; another row that is basically a scroll-view widget, which has the ability to show either more ANSI-coded text, or a tree-like widget that itself is clickable and then shows more ANSI coded text. :-) I'd also like to have some keybindings that let me quit, and possibly navigate around the whole thing with the arrow keys.
As you have probably guessed by now, I want to replicate this:
https://github.com/jeffwright13/pytest-tui
from pytermgui.
I would not be opposed to pitching in to develop some graded tutorials either.
from pytermgui.
So I've added both a simple boilerplate application:
And a simple (and very yellow, for some reason) implementation of said boilerplate app:
To the repo. Thank you for the suggestions!
from pytermgui.
Amazing, thank you so much! I have some studying to do. :-)
from pytermgui.
BTW the provided code in boilerplate.py
still calls exit(), instead of stop(), resulting in the error originally reported in this thread.
from pytermgui.
BTW the provided code in
boilerplate.py
still calls exit(), instead of stop(), resulting in the error originally reported in this thread.
Old habits die hard, or whatever they say now. Fixed!
from pytermgui.
A tiny update on this; I've been working on completely rewriting the docs in MkDocs Material, using markdown-generated SVG screenshots and such. It will get more focus once the new TIM engine is shipped, but most of that area of the library is already documented there.
from pytermgui.
Forgot to close this, but the new docs have been up for a while now and they should fix all of these issues. Thanks for the shout!
from pytermgui.
Related Issues (20)
- Enter doesn't activate buttons HOT 1
- Windows compatibility and example apps HOT 13
- tutorial HOT 10
- [REQUEST] Python 3.8 HOT 2
- [BUG] Cannot delete text in InputField HOT 11
- [BUG] [WSL2] XTerm does not display "box drawing" characters (but other terminals do) HOT 1
- [BUG] Inline widget: Mouse report event 'hover' is not supported HOT 1
- No documentation available HOT 4
- Question regarding `ptg.InputField` HOT 5
- How do I update the values screen HOT 1
- [HOWTO] How can I use the terminal widget? HOT 2
- Official Debian package HOT 1
- [REQUEST] Include pyproject.toml in pip package HOT 1
- [BUG] Multiline InputField fails to display correctly a in scrollable container HOT 2
- [BUG] All colors are mapped wrong on Windows when styling HOT 2
- [REQUEST] WindowManager.add unexpected behvaiour with slot names HOT 1
- [REQUEST] Browsing between selectables does not trigger scroll HOT 1
- DOC - Documentations issues/findings
- [BUG] Cursor Movement is broken in InputField HOT 1
- [REQUEST] Handle other alphabets in input fields HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytermgui.