Skip to content
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

Add language: Sweave #6544

Merged
merged 10 commits into from
Sep 12, 2023
Merged

Add language: Sweave #6544

merged 10 commits into from
Sep 12, 2023

Conversation

grady
Copy link
Contributor

@grady grady commented Sep 11, 2023

Description

resolves #6538

A prose language for literate programming with the R statistical software language. Precursor to Rmarkdown, a supported language. Mixes R code with TeX documentation. Present in documentation of many R language repositories.

Checklist:

@grady grady requested a review from a team as a code owner September 11, 2023 23:36
@grady
Copy link
Contributor Author

grady commented Sep 12, 2023

Questionable if the .Snw extension should be included or not. It is obsolete and only has 350 hits in the search, while the dominant .Rnw extension has over 17k results.

@lildude
Copy link
Member

lildude commented Sep 12, 2023

Questionable if the .Snw extension should be included or not. It is obsolete and only has 350 hits in the search, while the dominant .Rnw extension has over 17k results.

Not 😄 It doesn't meet our popularity requirements by a large margin. An override can always be used once this PR have been merged and deployed.

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove or replace samples/Sweave/Sweave.Rnw with a smaller sample as the current sample is unnecessarily large (if it's not displayed in the diff by default, it's generally too big).

@grady
Copy link
Contributor Author

grady commented Sep 12, 2023

Removed .snw extension from languages.yml and deleted related .snw sample file.
Removed large Sweave.Rnw sample file. Two samples remain.
Edited PR description to match above.

As far as heuristics go, the unique features of the language that I can think of are

  • basic structure of a tex file, in fact it could be a valid tex file itself with nothing extra.
  • the string \Sexpr anywhere in the file (optional, not extremely common)
  • lines that begin with << and end with >>= (also optional, but most files will have this)

@lildude
Copy link
Member

lildude commented Sep 12, 2023

Don't worry about the heuristics… as you've pointed out this is the only user of that extension and a quick search suggests this isn't likely to cause problems.

You will however need to address the test failures.

Setting ace_mode to tex, since a .tex file is a valid .Rnw as well.
@grady
Copy link
Contributor Author

grady commented Sep 12, 2023

I addressed the ace_mode fail, but the request to run a script will need to wait until tomorrow. Dev machine is in the office.

I set ace_mode to tex, on the basis that a valid .tex file is also valid .Rnw.

@lildude
Copy link
Member

lildude commented Sep 12, 2023

I addressed the ace_mode fail, but the request to run a script will need to wait until tomorrow. Dev machine is in the office.

Done it for you.

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good now. Thanks.

@lildude lildude added this pull request to the merge queue Sep 12, 2023
Merged via the queue into github-linguist:master with commit 8bec00e Sep 12, 2023
5 checks passed
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Language: Sweave
2 participants