Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative to #462 .
Discussion
With this example structure, I think the ability to run
SASin Quarto documents is the most feasible. However, there are some things to think about.Details
Specifically, you'll notice that all of the
sascode blocks are now replaced withr. Now,sasquatch::sas_run_string()is used, and theSAScode is inside the string. Usingsasquatch::sas_run_string(capture = "listing"), only the final output is kept; otherwise, a "log" tab panel also appears. This "log" tab may be useful for diagnosing errors, of which I noticed some syntax errors in this specific document. By actually having thisSAScode now run and evaluated, these errors can be caught and corrected, so users know the code actually runs.Other changes include the SAS outputs being saved as a
.rdsobject. This way, theSAScode isn't being evaluated with each new render, and onlyRis used to load thehtmlwidgets/the.rdsobjects. Then, if specific changes to theSAScode are needed, one only needs to turn theyamlheader optioneval:totrue. The actualSAScode has been placed in a text,txtblock. All of these ideas came from discussions with the author ofsasquatchin this thread.Drawbacks to this Approach
sasquatchisn't added to the repository, so to get theSAScode to run, setup ofsasquatchat a local level is required. This may be somewhat challenging/annoying to get everyone set up. I have a PR insasquatchto propose some better documentation for getting it all set up. I've also made a PR to improve the downloading experience. Really, once one has it all configured, it is very easy to use.sasquatchand any related dependencies cannot be added, otherwise they will fail to run and render.sascode block withsasquatch::sas_run_string()have to be saved as separate.rdsobjects. In documents that are long with manysasexamples, this may become cumbersome. I haven't figured out a good naming scheme, and if one adds an example to the beginning of a document, that would alter the numbering scheme. There may be programmatic ways to edit the names, but I haven't figured that out.Advantages to this Approach
images/folder can likely be removed as documents are updated. On the flip side, many more.rdsobjects will be added. In this specificSAS/rounding.qmdfile, there are now 4.rdsobjects when there were 0 screenshots before this change.SAS. Specifically, background text with thetxtSAS code and the actualSASoutputs..rdsobjects. No more "I updated the code in theqmdfile, but did I make a new screenshot and update it?".SAS. And I think the documents will be much better too for readers.Other Changes
reticulateto 1.41.0, because that version introduced a specific function thatsasquatchuses.Things I didn't Change
sasquatchwere pushed to the repository. This is because the dependencies ofsasquatchdon't seem to play nicely with the CI systems. And specificsasquatchconfiguration settings are likely to be specific to every contributor of this repository. Therefore, each time someone wants to update and run theseSAScode chunks, they will have to launchsasquatchlocally, connect to their localSASsession, and then evaluate theSASQuarto code chunks. As long as new and updated documents follow the types ofyamland code chunk options I've defined, it should be as simple as turning the documentyamlevalparameter totrueand rendering the document locally and only pushing changes to that document.Things to Get Feedback On
SAS/folder calledrdsa good approach? Then, inside that folder, one would make an additional folder that is the same as the document name they are editing. That way, anySAS .rdsobjects they create can be organized. This is similar to theimages/folder, but it is just placed within theSAS/folder.SASdocumentation find this approach appealing?This got long, but I think this is really a good first step towards having
SASrunning in Quarto documents.