Skip to content

Organizing package documentation #18

@dmi3kno

Description

@dmi3kno

I have been thinking how to organize package documentation. We basically have a few "groups" of functions that may make sense to be introduced together (at least in pkgdown):

Single-character functions

These are functions that return one character and do not require any "wrappers"

  • rx_alpha_num
  • rx_br and rx_line_break
  • rx_digit
  • rx_something
  • rx_space
  • rx_tab
  • rx_whitespace
  • rx_word_char and rx_word (with default rep="some") argument.

Character "sets"

These function output ranges or "sets" of characters, wrapped into [, for which we don't have a way to express them with single character. This is important when "nesting" them into supersets below, when "outer" set of [ need to be "peeled off". From the user stand point they may not be any different from Single-character functions

  • rx_alphanum
  • rx_alpha
  • rx_lower and rx_upper
  • rx_punctuation
  • rx_range

"Appenders"

These functions take .data argument and simply append something to it, thus modifying the behavior of previously appended function(s).

  • rx_capture_groups
  • rx_count
  • rx_end_of_line and rx_start_of_line
  • rx_one_or_more and rx_none_or_more
  • rx_with_any_case

"Expression-wrappers"

These functions allow user to specify the sequence of characters out of which all should be matched to the string.

  • rx_avoid and rx_seek
  • rx_find (and rx_literal, which I now dropped)
  • rx_maybe (which is rx_find with rep argument set to "maybe")
  • rx_or (which might need a bit of extra work, see Syntax for rx_or() #16 and thus will be out of this category)

"Superset functions"

These functions specify a list of mutually exclusive symbols/expressions, only one of which should be matched to the string.

  • rx_one_of
  • rx_anything_but and rx_something_but
    (eventually rx_either_of) will be moved here as well, if we decide to keep it.

I find this grouping helpful when reasoning about the functionality our package covers.

There are a few functions I dropped:
rx_any_of (duplicate of rx_one_of)
rx_digits (too little advantage compared to rx_digit(rep=n)
rx_literal (duplicate of rx_find)
rx_not (duplicate of rx_avoid_suffix)
rx_new has been moved to utils.R

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions