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 support for R Markdown (Rmd) files and to ignore R package metadata (i.e. non-code files) #294

Merged
merged 4 commits into from May 20, 2018

Conversation

hrbrmstr
Copy link
Contributor

This PR adds support for R Markdown (Rmd) files. Rmd files are a mixture of document metadata, markdown/latex/html and code blocks which are fairly general purpose but are usually R or Python (similar to jupyter notebooks without the ugly JSON to deal with). The patch only counts code between the

```{lang}
```

markers.

The language type is Rmd since virtually anything could be between the code blocks, but is most likely R code.

There are also two common metadata files in R packages --- DESCRIPTION and NAMESPACE --- which have been added to the $rh_Not_Code_Filename section.

A test.Rmd and test.Rmd.yaml have been provided.

@AlDanial
Copy link
Owner

Looks good--but please also add ../tests/inputs/test.Rmd and ../tests/outputs/test.Rmd.yaml to the PR.

(also, "packages" is misspelled in 'DESCRIPTION' => 1, # R pacakges metafile)

@hrbrmstr
Copy link
Contributor Author

ended up re-cloning the original fork and re-adding the test.Rmd[.yaml] files. No git add ops were picking them up for some reason. also fixed the spelling.

@AlDanial AlDanial merged commit 648b7d6 into AlDanial:master May 20, 2018
@AlDanial
Copy link
Owner

A couple of minor issues remain (test block in Unix/t/00_C.t pointing to incorrect output path and a spurious print statement in reduce_to_rmd_code_blocks()) but I'll fix them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants