From f718bb5575f10b209682c2ca2a7e721b75f24d95 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Fri, 26 May 2023 10:11:26 -0700 Subject: [PATCH] Add notes and TODOs for active file formatting --- R/black.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/R/black.R b/R/black.R index 6916ddd..384c9eb 100644 --- a/R/black.R +++ b/R/black.R @@ -43,7 +43,12 @@ style_black <- function() { id = capture[["id"]]) } -#' TODO +#' TODO Style entire active file +#' +#' Assumes file is a standard RMarkdown or Quarto document with Python-labeled +#' codeblocks. +#' +#' Inspiration: https://github.com/r-lib/styler/blob/main/R/addins.R#L50 style_active_file_black <- function() { if(Sys.which("black") == ""){ stop( @@ -55,4 +60,6 @@ style_active_file_black <- function() { # Grab code highlighted capture <- rstudioapi::getSourceEditorContext() capture + + # Parse through document to extract only Python code blocks }