R/rmd_headings.R

#' Format text as R Markdown headings
#'
#' RStudio add-ins to format text as R Markdown headings.
#'
#' @name rmd_headings
#' @export
rmd_b_heading_1 <- function() {
    row_ind <- rs_get_ind_first_selected_row()
    rs_insert_at_row_start(row_ind, "\n# ")
}
#' @rdname rmd_headings
#' @export
rmd_b_heading_2 <- function() {
    row_ind <- rs_get_ind_first_selected_row()
    rs_insert_at_row_start(row_ind, "\n## ")
}
#' @rdname rmd_headings
#' @export
rmd_b_heading_3 <- function() {
    row_ind <- rs_get_ind_first_selected_row()
    rs_insert_at_row_start(row_ind, "\n### ")
}
#' @rdname rmd_headings
#' @export
rmd_b_heading_4 <- function() {
    row_ind <- rs_get_ind_first_selected_row()
    rs_insert_at_row_start(row_ind, "\n#### ")
}
#' @rdname rmd_headings
#' @export
rmd_b_heading_5 <- function() {
    row_ind <- rs_get_ind_first_selected_row()
    rs_insert_at_row_start(row_ind, "\n##### ")
}
#' @rdname rmd_headings
#' @export
rmd_b_heading_6 <- function() {
    row_ind <- rs_get_ind_first_selected_row()
    rs_insert_at_row_start(row_ind, "\n###### ")
}
#' @rdname rmd_headings
#' @export
rmd_b_heading_1_title <- function() {

    text <- repeat_symbol("=", 60)
    rs_enclose_first_row_with_lines("\n", below = text)
}
#' @rdname rmd_headings
#' @export
rmd_b_heading_2_subtitle <- function() {

    text <- repeat_symbol("-", 60)
    rs_enclose_first_row_with_lines("\n", below = text)
}

Try the spAddins package in your browser

Any scripts or data that you put into this service are public.

spAddins documentation built on May 2, 2019, 3:04 a.m.