Skip to content

improve 'help' #13

@jmbarbone

Description

@jmbarbone
  • help parameter should be able to take a function
  • provide better print() for help (below)
  • include help in error? or link to execute code?
  • apply more coding/cleaning for text
    • skip clean_text() when class is AsIs (i.e., I("my text")
    • line returns are two sequential \n\n, unless wrapped in grave marks
    • clean_padding() should ignore leading and trailing blank/space lines
      • text[grepl("^[[:space:]]{0,}$", text)] <- ""
  • $help should be produced when conditions are triggered
    • cnd() should probably contain a withCallingHandlers(), or globalCallingHandlers('cnd::condition' = ...) on .onLoad()

help text should probably use cat(sep = "\n")

cnd:::cond_as_character_condition
#> cnd::condition_generator
#> cnd:as_character_cnd_error/error 
#> 
#> help
#> You cannot coerce a [cnd::condition_generator] object to a character. This may have occurred when trying to put a condition function through [stop()] or [warning].  Instead, call the function first, then pass the result to [stop()] or [warning()].  For example: ```r # Instead of this stop(my_condition)  # Do this stop(my_condition()) ``` 
#> 
#> exports
#>   cnd::condition()

clean_text() should probably incorporate line returns:

do.call(cat, list( cnd:::grey(cnd:::clean_text("this\nthat")), sep = "\n"))
#> this
#> that

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions