-
Notifications
You must be signed in to change notification settings - Fork 2
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
Remove overtyping of existing code? #6
Comments
Oh yeppers, this is doable. In fact, {snorkel} has this behaviour. Stretch goal: in theory there could be some input checks too. Like a You also just reminded me re |
Hullo @Lextuga007, I've now done this in the branch remotes::install_github("matt-dray/quartostamp@md-overwrite") So, as before: if you don't highlight any text, you'll get this generic thing inserted when you use the addin for 'Insert Incremental List':
But let's say you have the following text:
If you highlight that and then use the addin, you'll get this instead:
Another thing I'd be interested to hear about it footnotes. I decided to drastically improve the 'Insert Footnote' one as well. Before it just inserted '[^A footnote]' inline where your cursor was. It will still do that if you don't select any text, but if you do select some text, it will generate the footnote label by taking the first 10 non-space, non-punctuation characters (e.g. select 'NHS-R Community' and you'll get 'NHS-R Community [^nhsrcommun]' inserted). Additionally, it will generate a footnote string ('[^nhsrcommun]: Insert description.' in this case), copy it to the clipboard and prompt you in the console to paste it at the bottom of the document. (I tried to automatically insert the footnote in a new row at the bottom of the document, but that involves first resaving the user's document with a new blank row at the end and then pasting into it. It doesn't feel right to manipulate the user's file like that). Happy to explain more if that doesn't make sense! |
Tested the incremental and all works 😃 |
With the footnote I accidentally (but luckily perhaps!) highlighted the incremental text before using the footnote and that produced:
Highlighting some text gave:
and adding just a footnote with no highlighted gives:
I did get this in the console:
I totally agree with not saving a user's document first - good call 😃 |
Smashing, thank you for taking a look. And whoops, yes, 'NHS-R Community' actually becomes In retrospect, I might change the labelling system so the 'NHS-R Community' label would be Initially I wanted to keep the footnote labels short, but I think it's better to have 'This bit of text' become Also, I think that the message in the console should be slightly different if the user simply inserts a footnote. I think it should also say 'You may need to change the footnote label if it isn't unique' or something. Otherwise there'll be several conflicting |
I like having a bit of text and sometimes it will work brilliantly, often not. Getting it right for all circumstances may take too much work? |
Allow user text selection, not just simple insertion, close #6.
Okey doke, I merged this branch and bumped to v0.1, so the 'overtyping' thing is solved. Thanks Zoë! The (opinionated) footnotes addin now does what I think it should; happy to receive a new issue for any improvements. |
Not sure how feasible this is but if there is code already written, like for the incremental bullets, then if that code is highlighted and
Insert incremental list
is selected it would be magical if it surrounded the text and didn't overtype it.The reason why this is so useful is if you've (as in I've!) written
::: incremental
instead of::: {.incremental}
multiple times!The text was updated successfully, but these errors were encountered: