news-utils: Utilities for manipulating NEWS.md headers

pkgHeadingsR Documentation

Utilities for manipulating NEWS.md headers

Description

We provide several utilties for working with Markdown-style NEWS.md files. Such operations include the manipulation of NEWS.md file headers and header case.

Usage

pkgHeadings(packages, vpattern = "Changes in version")

Arguments

packages

character() A vector of package names that correspond to folders in the current directory.

vpattern

character(1) The 'grep' input for searching the versioning line in the NEWS files. This usually starts with 'Changes in version' (default) but may differ.

pkg

character(1) The name of a local package whose folder is in in the current working directory.

dry.run

logical(1) Whether to print changes to the console (TRUE) or change the actual NEWS file in the package.

bumpHeaders

logical(1) Whether to increase all markdown headers by one (usually '##' to '###'; default TRUE)

from

character(1) The Markdown header to identify in the NEWS.md file (default '#' aka HTML tag 'h1')

to

character(1) The Markdown header to replace in the NEWS.md file (default '##' aka HTML tag 'h2')

Headings

Obtain the NEWS file Markdown headings ('##') for a list of packages with pkgHeadings which calls headingsFormat recursively. It is useful to see whether there is consistency in the headings corresponding to the 'Changes in version' line in the NEWS.md file

headerCase uses the vpattern input to replace any differently formatted NEWS.md heading, e.g. ⁠CHANGES IN VERSION⁠ to ⁠Changes in version⁠ where the differences are by case only.

updateHeading Increases the Markdown HTML h1 tags to h2 tags with the option (bumpHeaders = TRUE) to bump all the headers for the remaining sub-headers in order to maintain hierarchy, e.g., h2 to h3.

Examples

## Not run: 
    pkgHeadings(
        c("MultiAssayExperiment", "curatedTCGAData", "TCGAutils",
        "cBioPortalData", "SingleCellMultiModal", "RTCGAToolbox",
        "RaggedExperiment")
    )

    headingsFormat("curatedTCGAData", "Changes in version")

    headerCase("RTCGAToolbox")

    updateHeading("cBioPortalData")

## End(Not run)


waldronlab/newsfeed documentation built on July 30, 2023, 1:22 a.m.