-
Notifications
You must be signed in to change notification settings - Fork 3
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
IDEA: allow editing the placeholder in-place (like GCP docs) #6
Comments
Hi, thanks for the suggestion. I like the idea, since it is far more intuitive than the (sometimes pretty large) tables that are currently used to set placeholders. I think it should be possible to implement, since the dynamic (default) placeholders already are replaced with a bit of HTML. Adding a onclick event to that, that would turn it into a textbox should thus be possible. Live-updating is also supported (without reloading the page), if only dynamic placeholders are in use. I will see if I find some time this weekend to try to implement it (or at least a prototype to see if it would work as expected). |
@six-two in a separate but related idea, it would be great to have the input boxes scale to the width of the current text (which will be critical for the in-place editing). I messed around with it today and it's actually kind of painful to dynamically scale the width of |
Neat, I never knew you could make I hacked together a small prototype using the |
@six-two also, while I have you here, I see that you are often working on the actual string version of the rendered pages (when looking for the input tags to mutate with default values). Rather than trying to build your own XML parser, it's actually possible to hook into the Python For example, I made this hook/plugin which finds |
Thanks for the tip! That might also be useful some of my other extensions (like mkdocs-badges) where I remember implementing some custom markdown parsing to see whether I am in a table or code listing |
The only thing to remember, is that when you use a markdown extension, it will only affect the actual content from But at least for the placeholder plug-in I think that's fine, because I don't know why you would want placeholders outside of the main content. |
Three more ideas:
|
Regarding the three ideas:
|
@thesuperzapper I have implemented the UI features (tooltip, special styling, etc) and support for dropdown/checkbox placeholders. Is there anything (except a revert button) missing related to the inline placeholder editors or are there any obvious bugs? The only thing I noticed is tooltips not being shown on my smartphone, but that is more of a general issue with touch devices not having mouse pointers. The latest version is deployed at https://dev.mkdocs-placeholder-plugin.six-two.dev/demo and pushed to the main branch. If there is nothing broken/missing, I would like to release v0.4.2 with this new feature in a couple days. |
@six-two A few things:
|
@thesuperzapper Thanks for the feedback. Regarding the points you raised:
I do not see this behavior with Firefox on Linux on my test site. To help me reproduce and fix it: What browser/OS and URL did you encounter this on? Can you maybe send a screencapture?
Implemented: for now it is a pink square with the width of the letter
Good point, I will think about it. Although I would probably implement it as a opt-out by default (by mapping
I tried to implement it with an inline dropdown that shown up when the user hovers or clicks on the placeholder, but that was both very buggy. For example when selecting a value in the One of the advantages I see with inline editors is that we do not need to rely on placeholder tables anymore. While they work OK on small to medium sized pages, they become way to big on very large pages, where it is a real pain having to scroll to them, find the correct placeholder and scroll down to your place again. Thus I would like to have all placeholders support inline editors. And if a site owner really dislikes the behavior, they could selectively disable the inline editors for these placeholders ( |
This week I made some changes to the code:
@thesuperzapper Do you see any more glitches, bugs or problems with the code in the current state? Do you have details for reproducing the "the input boxes in the table now glitchy resize (get smaller) when you first edit them" bug? |
@six-two I can't seem to reproduce the glitchy size error, so it might have been fixed with your other updates. Based on your demo my main comments are now about styling: High Priority
Medium Priority
|
Hi, it ha been a while, but I had a lot of private stuff to do. In response to the issues you raised:
|
I noticed that |
The Google Cloud docs have an interesting placeholder implementation.
Users can click on the placeholder instances to turn them into the corresponding input box, so they can be updated in-place.
EXAMPLE PAGE: https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication#applications_in_other_environments
Step 1 - Default
Step 2 - Click to edit
Step 3 - Changes are reflected across page
They also have real-time mutation, but that is not necessary.
The text was updated successfully, but these errors were encountered: