-
Notifications
You must be signed in to change notification settings - Fork 7
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
API for animateCode which uses comments in the code #12
Comments
This is not priority but yesterday started tinkering with this in this public repl.it: https://replit.com/@pietroppeter/NimislidesAnimateCodeComments not finished (does not run currently) and not planning to get back to it soon (I had to do a bit to get it out of the system, and did enough to get bored by it 😛 ). The idea is that code like this: echo 1
echo 2 # -B >>>
echo 3 # D >>>
echo 4 # A- >>>
echo 5
echo 6 # -A >>>
echo 7 # D >>>
echo 8 # a normal comment
echo 9 # C- >>>
echo 10 # A >>> should produce a highlightLines string like this : Incidentally I realized we could have a |
Oh nice! Always nice to have something to start from :) I'd probably go with numbers instead of letters. Something else that would be nice that we are losing with this API is the ability to add a new animation between others. Say we have this: echo 1 # 1- >>>
echo 2 # -1 >>>
echo "Hello"
echo 3 # 2- >>>
echo 4 # -2- >>> What if we want to highlight the line ...
echo "Hello" # 1.5 >>>
... Am I just ranting or could this works? 🤣 |
Well the thing is that you can pick any identifier and it would be sorted (thinking it as a string). So since I think this is valid: "1" < "1.5" (or also "11") < "2", it would work. In this way you would not really have to pick numbers instead of letters it could be left to the user the choice, who could pick bar, foo, goo, zoo and then use car if it wants to insert something between bar and foo. |
This evaluates to |
@pietroppeter had the idea for animateCode, that instead of specifying the lines of code to highlight using numbers (eg.
1..3, 4, 5..7
), the lines in the code are marked using comments instead. This would remove the need for updating all the line numbers if you change the code. The general idea is this:The number specifies the order of highlighting and the
$$$
(or something else), is a marker for our parser to find the lines. A number of questions are still unanswered, like what symbols to use and how to implement it in a simple way.The text was updated successfully, but these errors were encountered: