Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement sass / scss engines #1666
Conversation
|
Let me know if I should go ahead and change the logic to use the I noticed lines 210-211 contain a |
|
I left some comment to discuss. Also, I have a behaviour rather strange that we should cover.
and as it is not an error, I get in my rendered html <style type="text/css">
'dart.exe' n'est pas reconnu en tant que commande interne
ou externe, un programme ex‚cutable ou un fichier de commandes.
</style>The html does open but I don't think this something desirable. I don't know if you have the same not on windows. As a general comment also, this need some documentation, maybe first as a bullet point in NEWS. |
|
Thanks @cderv for the review! And apologies -- there are definitely a few things in there that you shouldn't have had to catch. A few follow-up questions:
Per the last comment, I'll also include an updated |
|
Just a quick reply as it is late but that will keep you going
Do not force push as it is not necessary. When we can avoid I think it is better. We will deal with that later. You can add more commits to this branch. We should be able to "squash and merge" the PR, in order to reduce the amount of commit. Or I'll deal myself with git stuff at the end - I am knew as a reviewer for this
If you want to try add this, feel free. I don't think
Don't worry about |
|
Thanks for taking the time to reply!
The
Yes! Both versions can handle it.
Thanks - that's a good point. It really does make more sense for this to be an engine option than a chunk option. I'll update this in the code before pushing my new commits. |
|
I let you push your changes and we'll see what default to choose. |
|
Hi @cderv , I just pushed a number of changes. Let me know what you think! I'm still not sure if I love the API for output styling, so definitely open to more feedback here. In the end I considered four options. Happy to switch if you think one of the others is better.
Most readable / typeable but felt "aggressive" somehow to add a new chunk option for something so specialized.
Feels weird to not have the option labeled "style" in anyway, but that is also unneeded since there is only one option. This felt most in keeping with the main usage of
Most explicit but also unnecessarily verbose.
Most compact but no longer follows same convention as On an unrelated note, there are a lot of degrees of freedom now with two engines, possible options, and different types of warnings / errors. I haven't included tests in the PR as I notice |
|
I have still made a few comment, specifically on the error and warning catching. I think we should reproduce more closely About the style API, I agree with you it could be improved. one thing is we want the option to work for both package and executable sass. So we can't have a TRUE vs FALSE, if the package have more option for styling. The cleaner API would be the first :
knitr |
|
Hi @cderv, I've just pushed a number of updates:
While these aren't "official" tests or in the style of At minimum, hopefully this restores a bit of confidence after I know I've made some pretty stupid mistakes; I'm very grateful for your help and patience! |
|
|
||
| # validate provided engine options | ||
| if(!is.logical(package)) { | ||
| if(!options$error) stop(paste("package option must be either TRUE or FALSE")) |
cderv
Feb 24, 2019
•
Collaborator
I see you used warning2 below 👍 (I did not know it)
Should we use stop2 also here ? The wrapper with call. = FALSE.
As you prefer.
I see you used warning2 below
Should we use stop2 also here ? The wrapper with call. = FALSE.
As you prefer.
emilyriederer
Feb 27, 2019
Author
Contributor
Ah! Very nice. I hadn't noticed that wrapper as much in the other engines, but I like it. I will switch over. Thanks for the recommendation!
Ah! Very nice. I hadn't noticed that wrapper as much in the other engines, but I like it. I will switch over. Thanks for the recommendation!
|
Thank you very much !! This was not a small PR and it is really good! Thanks a lot ! You did an awesome job all along. This is working with my error now, and your test file is awesome. It could be added in in the test folder, but it is using I just pushed a small commit to be closer to knit internal code style. Also, I left 2 small comments. It is more like question I let you deal with. Thanks again ! |
|
|
||
| # wrap final output for correct rendering | ||
| final_out = if (!is.null(out) && is_html_output(excludes = 'markdown')) { | ||
| out_tagged = paste(c('<style type="text/css">', out, '</style>'), collapse = "\n") |
cderv
Feb 24, 2019
Collaborator
what is out_tagged ? it does not seem to be used.
Did I miss something ? 🤔
what is out_tagged ? it does not seem to be used.
Did I miss something ?
emilyriederer
Feb 27, 2019
•
Author
Contributor
Ah, thanks for catching. You didn't -- I did. Previously I had more validation steps after this, but it appears I failed to remove this assignment when I took those out.
Ah, thanks for catching. You didn't -- I did. Previously I had more validation steps after this, but it appears I failed to remove this assignment when I took those out.
|
Hi @cderv , Thanks for the last polishing thoughts! I switched to Please let me know if there's anything else I should do on my end, like eventually adding examples to the Thank you again so, so much for your help and great feedback at every step of the way! |
|
Awesome thank you ! I'll need to check if I missed anything in the process. It is my first review for knitr I will also add you as contributor to the |
|
@yihui, review is done. and this is working well. Just checking how you get things done usually. From what I observed until now
Is this ready to squash and merge ? As it is my first review for knitr, I prefer to go through this time to learn the workflow for this Thanks. |
|
Everything looks great. Please go ahead and make your first merge in this repo! @emilyriederer Next time please feel free to use |
| @@ -136,7 +136,7 @@ eng_interpreted = function(options) { | |||
| Darwin = paste('-q < %s >', shQuote(xfun::normalize_path(logf))), | |||
| Linux = '-q -e do %s', | |||
| '-q -b do %s' | |||
| ), shQuote(normalizePath(f))) | |||
| ), shQuote(normalizePath(f))) | |||
yihui
Feb 28, 2019
Owner
Good eye. Thanks!
Good eye. Thanks!
|
Thanks, @yihui! And don't worry -- I was just joking, not complaining, about Thanks again to you both! |
This PR closes #1665 and adds Sass / SCSS language engines.
When available and not specifically declined by the user (via an
r.sass = FALSEchunk option), conversion is handled by LibSass via thesassR package. Otherwise, conversion is done by the standalone DartSass executable found either via PATH or provided via theengine.pathoption.Following conversion, output is handled the same as in the
csslanguage engine.