luisDVA / annotater

Annotate Package Load Calls
https://annotater.liomys.mx/
Other
99 stars 2 forks source link

Task 8 - Fix: Annotate fun calls in RMarkdown #23

Closed jcrodriguez1989 closed 2 weeks ago

jcrodriguez1989 commented 3 weeks ago

Fixes https://github.com/luisDVA/annotater/issues/8 I tested it with this code and seems to work, let me know if it works on your examples.

---
title: "Basic Rmarkdown Example"
author: "Your Name"
date: "`r Sys.Date()`"
output: html_document
---

# Introduction

This is an example of a simple Rmarkdown document.

\```{r}
library(annotater)
test_string <-c("library(boot)\nrequire(Matrix)")
writeLines(annotate_pkg_calls(test_string))
writeLines(annotate_repo_source(test_string))
writeLines(annotate_repo_source(test_string))
\```

\```{r}
library(annotater)
library("dplyr")
test_string <-c("library(boot)\nrequire(Matrix)")
writeLines(annotate_pkg_calls(test_string))
writeLines(annotate_repo_source(test_string))
writeLines(annotate_repo_source(test_string))
select(mtcars, mpg)
\```
luisDVA commented 2 weeks ago

Thanks! Functions now work smoothly with Rmd and Qmd files. I wasn't aware of knitr::purl, such a nice solution.

gracias Juan y aguante Córdoba