-
-
Notifications
You must be signed in to change notification settings - Fork 709
feat: Add various text transforms #5701
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
base: develop
Are you sure you want to change the base?
feat: Add various text transforms #5701
Conversation
I will need some more time to think about your style of coding because it is different from mine — not in a bad way, so this is not a criticism, but it's a bit more involved to think about this. A few things I already saw you may want to tackle in the meantime is:
I'll be back with a more thorough code review — also please feel free to remove the explanatory comments, because it makes focusing on the code more difficult than necessary. I appreciate the thoroughness, but it is easier to parse if you could transfer that information into your PR description and leave the files! Thank you already for your help and work! |
I have changed the test fixtures to conform to your preference.
I have moved the supporting code into a folder per your suggestion.
Updated to conform to your preference in 9899d09
I have deleted all of them.
Approach looks solid ✌️ In your case there are distinct differences between chunks of commands... while there is some repetition, it reads well enough. I only refactored to the composition approach after writing the third text transform command because by then I noticed that I was repeating the same code in every command: in the specific case of these text transforms there's no difference to the CodeMirror algorithm piece... the composition allows the code that's distinct and relevant to just that transform to "pop." It's easy enough for me to un-compose it. |
04c2d13
to
62a1676
Compare
62a1676
to
9138c37
Compare
9138c37
to
8e0509e
Compare
8e0509e
to
dd9e5a0
Compare
This PR addresses half of Zettlr#5677: the code for doing the reverse transformation — quotes to italics — will follow in a distinct PR. > ℹ️ Please note that this PR _merges into [another PR](Zettlr#5701 The code in this PR builds on code from that other PR. > > I understand that this is a bit funky: I'm only doing it this way because there is still some uncertainty about the approach. Ideally the uncertainty will be resolved in these two PRs and then we can get back to the usual workflow. ## Description This adds another transform to the editor's new _Transform_ submenu which will change italicized text to quoted text. In the video I am: * selecting some italicized text * clicking the command from the aforementioned submenu After running the command the italicized text becomes instead quoted text. ## Additional information Tested on: Windows 11 Home. > Note that I have not updated the CHANGELOG per the PR template guideline 'cos I don't know when this'll be merged, if ever 🤷
Sooooooo, after way too long I've been able to give it a Quick Look. And it has proven once more that sometimes letting something sit can change one's perspective on it. I am now much more comfortable reading your code and seeing the benefits of your approach. While I do believe that a bit of the code might be too verbose, that honestly boils down to personal preference, so I don't want you to change anything. I just gave it a skim and will want to try it out myself but I really believe that the code looks good to merge! So thanks for holding tight during the past four months -- once I'm back at my desktop, I'll give it a quick run and then we can merge it. I currently think that we can pull this through in two PRs: one that implements the base functionality plus examples (I.e., this PR as it is), and then a second one that simply implements all other transforms you have been discussing! If you want to, you can already open that second PR (you can close the individual ones), because I'm pretty sure you won't have to change anything! And then we're good to go! Thank you again for all of this exemplary work! |
This PR addresses half of Zettlr#5677: the code for doing the reverse transformation — quotes to italics — will follow in a distinct PR. This adds another transform to the editor's new _Transform_ submenu which will change italicized text to quoted text. In the video I am: * selecting some italicized text * clicking the command from the aforementioned submenu After running the command the italicized text becomes instead quoted text. Tested on: Windows 11 Home. > Note that I have not updated the CHANGELOG per the PR template guideline 'cos I don't know when this'll be merged, if ever 🤷
ea602c8
to
0f945c3
Compare
Closes #4039
Closes #5675
Closes #5676
Closes #5677
Closes #5678
Closes #5679
Closes #5680
Closes #5681
Description
This adds a new Transform submenu to the editor which has numerous text transforms in it.
output.mp4
Pending Work
I have lumped the text transforms into the context menu without that much thought to ordering them.
We may want to put some thought into:
Edit
menu tooAdditional information
Tested on: Windows 11 Home.