diff --git a/R/rd-r6-field.R b/R/rd-r6-field.R index da971303..baf1eae9 100644 --- a/R/rd-r6-field.R +++ b/R/rd-r6-field.R @@ -107,11 +107,11 @@ format_r6_field_section <- function(fields, title, css_class) { c( paste0("\\section{", title, "}{"), - rd_if_html(paste0('
')), - "\\describe{", - paste0(map_chr(fields, format), collapse = "\n\n"), - "}", - rd_if_html("
"), + paste0(" ", rd_if_html(paste0('
'))), + " \\describe{", + paste0(" ", map_chr(fields, format), collapse = "\n\n"), + " }", + paste0(" ", rd_if_html("
")), "}" ) } diff --git a/R/rd-r6-methods-inherited.R b/R/rd-r6-methods-inherited.R index 91ed35ac..be5f592f 100644 --- a/R/rd-r6-methods-inherited.R +++ b/R/rd-r6-methods-inherited.R @@ -50,7 +50,7 @@ format.rd_r6_inherited <- function(x, ...) { # Plain version: just the method name, no link plain <- sprintf("%s", label) - items <- paste0("
  • ", ifelse(topic_ok, linked, plain), "
  • ") + items <- paste0("
  • ", ifelse(topic_ok, linked, plain), "
  • ") rd_if_html(paste( c(details, "", ""), diff --git a/R/rd-r6-methods-self.R b/R/rd-r6-methods-self.R index d3f29ffb..b29fd840 100644 --- a/R/rd-r6-methods-self.R +++ b/R/rd-r6-methods-self.R @@ -29,9 +29,9 @@ format.rd_r6_method <- function(x, ...) { push <- function(...) lines <<- c(lines, ...) push_subsection <- function(title, ...) { push( - paste0("\\subsection{", title, "}{"), - ..., - "}\n" + paste0(" \\subsection{", title, "}{"), + paste0(" ", c(...)), + " }" ) } @@ -48,8 +48,12 @@ format.rd_r6_method <- function(x, ...) { # Description if (length(x$description) > 0) { push( - sub("\n?\n?$", "\n\n", head(x$description, -1)), - utils::tail(x$description, 1) + paste0( + " ", + sub("\n?\n?$", "\n\n", head(x$description, -1)), + recycle0 = TRUE + ), + paste0(" ", utils::tail(x$description, 1), recycle0 = TRUE) ) } @@ -71,7 +75,7 @@ format.rd_r6_method <- function(x, ...) { "Arguments", rd_if_html('
    '), "\\describe{", - paste0("\\item{\\code{", nms, "}}{", vals, "}"), + paste0(" \\item{\\code{", nms, "}}{", vals, "}"), "}", rd_if_html("
    ") ) @@ -102,7 +106,7 @@ format.rd_r6_method <- function(x, ...) { } # End - push("}") + push("}\n") lines } diff --git a/R/rd-r6-methods.R b/R/rd-r6-methods.R index b5c65714..be8761ad 100644 --- a/R/rd-r6-methods.R +++ b/R/rd-r6-methods.R @@ -22,9 +22,9 @@ format.rd_r6_methods <- function(x, ...) { push("\\section{Methods}{") push( "\\subsection{Public methods}{", - "\\itemize{", - sprintf("\\item \\href{#%s}{%s}", dest, code), - "}", + " \\itemize{", + sprintf(" \\item \\href{#%s}{%s}", dest, code), + " }", "}" ) push(format(x$inherited)) diff --git a/tests/testthat/_snaps/rd-r6-class.md b/tests/testthat/_snaps/rd-r6-class.md index 4f571632..e8d9e44d 100644 --- a/tests/testthat/_snaps/rd-r6-class.md +++ b/tests/testthat/_snaps/rd-r6-class.md @@ -11,13 +11,13 @@ cat(format(docs), sep = "\n") Output \section{Public fields}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{x}}{A number.} + \if{html}{\out{
    }} + \describe{ + \item{\code{x}}{A number.} - \item{\code{y}}{A string.} - } - \if{html}{\out{
    }} + \item{\code{y}}{A string.} + } + \if{html}{\out{
    }} } # format.rd_r6_class with active bindings @@ -26,11 +26,11 @@ cat(format(docs), sep = "\n") Output \section{Active bindings}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{val}}{A value.} - } - \if{html}{\out{
    }} + \if{html}{\out{
    }} + \describe{ + \item{\code{val}}{A value.} + } + \if{html}{\out{
    }} } # format.rd_r6_class with no inherited methods @@ -43,23 +43,23 @@ } \section{Methods}{ \subsection{Public methods}{ - \itemize{ - \item \href{#method-C2-meth1}{\code{C2$meth1()}} - } + \itemize{ + \item \href{#method-C2-meth1}{\code{C2$meth1()}} + } } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-C2-meth1}{}}} \subsection{\code{C2$meth1()}}{ - method1 - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{C2$meth1()} - \if{html}{\out{
    }} + method1 + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{C2$meth1()} + \if{html}{\out{
    }} + } } } - } # format.rd_r6_class with inherited methods @@ -71,49 +71,48 @@ } \section{Methods}{ \subsection{Public methods}{ - \itemize{ - \item \href{#method-B-shared}{\code{B$shared()}} - \item \href{#method-B-clone}{\code{B$clone()}} - } + \itemize{ + \item \href{#method-B-shared}{\code{B$shared()}} + \item \href{#method-B-clone}{\code{B$clone()}} + } } \if{html}{\out{
    Inherited methods
    }} \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-B-shared}{}}} \subsection{\code{B$shared()}}{ - Method from B. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{B$shared()} - \if{html}{\out{
    }} + Method from B. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{B$shared()} + \if{html}{\out{
    }} + } } - } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-B-clone}{}}} \subsection{\code{B$clone()}}{ - The objects of this class are cloneable with this method. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{B$clone(deep = FALSE)} - \if{html}{\out{
    }} - } - - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{deep}}{Whether to make a deep clone.} - } - \if{html}{\out{
    }} + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{B$clone(deep = FALSE)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
    }} + } } } - } # format.rd_r6_class with markdown sections @@ -122,31 +121,30 @@ Output \section{Methods}{ \subsection{Public methods}{ - \itemize{ - \item \href{#method-C-meth}{\code{C$meth()}} - } + \itemize{ + \item \href{#method-C-meth}{\code{C$meth()}} + } } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-C-meth}{}}} \subsection{\code{C$meth()}}{ - Method description. + Method description. \subsection{Description section}{ Description section body. } - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{C$meth()} - \if{html}{\out{
    }} - } - - \subsection{Details}{ - \subsection{Details section}{ + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{C$meth()} + \if{html}{\out{
    }} + } + \subsection{Details}{ + \subsection{Details section}{ Details section body. } + } } } - } diff --git a/tests/testthat/_snaps/rd-r6-field.md b/tests/testthat/_snaps/rd-r6-field.md index 5a97f69d..a68d9c40 100644 --- a/tests/testthat/_snaps/rd-r6-field.md +++ b/tests/testthat/_snaps/rd-r6-field.md @@ -47,13 +47,13 @@ cat(format(fields), sep = "\n") Output \section{Public fields}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{x}}{A number.} + \if{html}{\out{
    }} + \describe{ + \item{\code{x}}{A number.} - \item{\code{y}}{A string.} - } - \if{html}{\out{
    }} + \item{\code{y}}{A string.} + } + \if{html}{\out{
    }} } # format.rd_r6_bindings produces Active bindings section @@ -62,10 +62,10 @@ cat(format(bindings), sep = "\n") Output \section{Active bindings}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{val}}{A value.} - } - \if{html}{\out{
    }} + \if{html}{\out{
    }} + \describe{ + \item{\code{val}}{A value.} + } + \if{html}{\out{
    }} } diff --git a/tests/testthat/_snaps/rd-r6-methods-inherited.md b/tests/testthat/_snaps/rd-r6-methods-inherited.md index 0f9371a8..3784b436 100644 --- a/tests/testthat/_snaps/rd-r6-methods-inherited.md +++ b/tests/testthat/_snaps/rd-r6-methods-inherited.md @@ -5,8 +5,8 @@ Output \if{html}{\out{
    Inherited methods
    }} diff --git a/tests/testthat/_snaps/rd-r6-methods-self.md b/tests/testthat/_snaps/rd-r6-methods-self.md index 0db38480..320579b4 100644 --- a/tests/testthat/_snaps/rd-r6-methods-self.md +++ b/tests/testthat/_snaps/rd-r6-methods-self.md @@ -32,23 +32,22 @@ \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Person-greet}{}}} \subsection{\code{Person$greet()}}{ - Say hello. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{Person$greet(who, how = "nicely")} - \if{html}{\out{
    }} + Say hello. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{Person$greet(who, how = "nicely")} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{who}}{Name to greet.} + \item{\code{how}}{Greeting style.} + } + \if{html}{\out{
    }} + } } - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{who}}{Name to greet.} - \item{\code{how}}{Greeting style.} - } - \if{html}{\out{
    }} - } - - } # format.rd_r6_method renames initialize to new @@ -59,14 +58,14 @@ \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Foo-initialize}{}}} \subsection{\code{Foo$new()}}{ - Create object. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{Foo$new()} - \if{html}{\out{
    }} + Create object. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{Foo$new()} + \if{html}{\out{
    }} + } } - } # format.rd_r6_method includes optional sections @@ -77,29 +76,26 @@ \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Job-run}{}}} \subsection{\code{Job$run()}}{ - Run the job. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{Job$run()} - \if{html}{\out{
    }} + Run the job. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{Job$run()} + \if{html}{\out{
    }} + } + \subsection{Details}{ + Some details. + } + \subsection{Returns}{ + The result. + } + \subsection{Examples}{ + \if{html}{\out{
    }} + \preformatted{job$run() } - - \subsection{Details}{ - Some details. + \if{html}{\out{
    }} + } } - \subsection{Returns}{ - The result. - } - - \subsection{Examples}{ - \if{html}{\out{
    }} - \preformatted{job$run() - } - \if{html}{\out{
    }} - } - - } # format.rd_r6_method omits empty optional sections @@ -110,12 +106,12 @@ \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Job-run}{}}} \subsection{\code{Job$run()}}{ - Run. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{Job$run()} - \if{html}{\out{
    }} + Run. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{Job$run()} + \if{html}{\out{
    }} + } } - } diff --git a/tests/testthat/_snaps/rd-r6-methods.md b/tests/testthat/_snaps/rd-r6-methods.md index a8b654db..0acdb0be 100644 --- a/tests/testthat/_snaps/rd-r6-methods.md +++ b/tests/testthat/_snaps/rd-r6-methods.md @@ -5,23 +5,23 @@ Output \section{Methods}{ \subsection{Public methods}{ - \itemize{ - \item \href{#method-Foo-run}{\code{Foo$run()}} - } + \itemize{ + \item \href{#method-Foo-run}{\code{Foo$run()}} + } } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Foo-run}{}}} \subsection{\code{Foo$run()}}{ - Run it. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{Foo$run()} - \if{html}{\out{
    }} + Run it. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{Foo$run()} + \if{html}{\out{
    }} + } } } - } # r6_all_examples aggregates across methods diff --git a/tests/testthat/_snaps/rd-r6.md b/tests/testthat/_snaps/rd-r6.md index d17950e0..fef84384 100644 --- a/tests/testthat/_snaps/rd-r6.md +++ b/tests/testthat/_snaps/rd-r6.md @@ -28,141 +28,137 @@ ## ------------------------------------------------ ## Example for meth2 + ## Second line + ## Third line } \section{Public fields}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{field1}}{A field 1.} + \if{html}{\out{
    }} + \describe{ + \item{\code{field1}}{A field 1.} - \item{\code{field2}}{A field 2.} + \item{\code{field2}}{A field 2.} - \item{\code{field3}}{A field 3.} - } - \if{html}{\out{
    }} + \item{\code{field3}}{A field 3.} + } + \if{html}{\out{
    }} } \section{Active bindings}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{active1}}{A binding 1.} + \if{html}{\out{
    }} + \describe{ + \item{\code{active1}}{A binding 1.} - \item{\code{active2}}{A binding 2.} + \item{\code{active2}}{A binding 2.} - \item{\code{active3}}{A binding 3.} - } - \if{html}{\out{
    }} + \item{\code{active3}}{A binding 3.} + } + \if{html}{\out{
    }} } \section{Methods}{ \subsection{Public methods}{ - \itemize{ - \item \href{#method-A-meth1}{\code{A$meth1()}} - \item \href{#method-A-meth2}{\code{A$meth2()}} - \item \href{#method-A-meth3}{\code{A$meth3()}} - \item \href{#method-A-clone}{\code{A$clone()}} - } + \itemize{ + \item \href{#method-A-meth1}{\code{A$meth1()}} + \item \href{#method-A-meth2}{\code{A$meth2()}} + \item \href{#method-A-meth3}{\code{A$meth3()}} + \item \href{#method-A-clone}{\code{A$clone()}} + } } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-A-meth1}{}}} \subsection{\code{A$meth1()}}{ - A method 1. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{A$meth1(Z)} - \if{html}{\out{
    }} + A method 1. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{A$meth1(Z)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{Z}}{zzzzzzz} + } + \if{html}{\out{
    }} + } + \subsection{Examples}{ + \if{html}{\out{
    }} + \preformatted{## Example for meth1 + } + \if{html}{\out{
    }} + } } - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{Z}}{zzzzzzz} - } - \if{html}{\out{
    }} - } - - \subsection{Examples}{ - \if{html}{\out{
    }} - \preformatted{## Example for meth1 - } - \if{html}{\out{
    }} - } - - } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-A-meth2}{}}} \subsection{\code{A$meth2()}}{ - Method 2 description. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{A$meth2(Z = 10, ...)} - \if{html}{\out{
    }} - } - - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{Z}}{Overriding Z argument for meth2.} - \item{\code{...}}{Rest.} - } - \if{html}{\out{
    }} + Method 2 description. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{A$meth2(Z = 10, ...)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{Z}}{Overriding Z argument for meth2.} + \item{\code{...}}{Rest.} + } + \if{html}{\out{
    }} + } + \subsection{Details}{ + Method 2 details. + } + \subsection{Returns}{ + A value. + } + \subsection{Examples}{ + \if{html}{\out{
    }} + \preformatted{## Example for meth2 + ## Second line + ## Third line + } + \if{html}{\out{
    }} + } } - \subsection{Details}{ - Method 2 details. - } - - \subsection{Returns}{ - A value. - } - - \subsection{Examples}{ - \if{html}{\out{
    }} - \preformatted{## Example for meth2 - } - \if{html}{\out{
    }} - } - - } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-A-meth3}{}}} \subsection{\code{A$meth3()}}{ - Method 3. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{A$meth3(x)} - \if{html}{\out{
    }} - } - - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{x}}{An argument.} - } - \if{html}{\out{
    }} + Method 3. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{A$meth3(x)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{x}}{An argument.} + } + \if{html}{\out{
    }} + } } - } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-A-clone}{}}} \subsection{\code{A$clone()}}{ - The objects of this class are cloneable with this method. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{A$clone(deep = FALSE)} - \if{html}{\out{
    }} + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{A$clone(deep = FALSE)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
    }} + } } - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{deep}}{Whether to make a deep clone.} - } - \if{html}{\out{
    }} - } - - } } --- @@ -185,91 +181,89 @@ \code{A} -> \code{B} } \section{Public fields}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{field1}}{B field 1.} + \if{html}{\out{
    }} + \describe{ + \item{\code{field1}}{B field 1.} - \item{\code{field4}}{B field 4.} - } - \if{html}{\out{
    }} + \item{\code{field4}}{B field 4.} + } + \if{html}{\out{
    }} } \section{Active bindings}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{active1}}{B binding 1.} + \if{html}{\out{
    }} + \describe{ + \item{\code{active1}}{B binding 1.} - \item{\code{active4}}{B binding 4.} + \item{\code{active4}}{B binding 4.} - \item{\code{active5}}{B binding 5.} - } - \if{html}{\out{
    }} + \item{\code{active5}}{B binding 5.} + } + \if{html}{\out{
    }} } \section{Methods}{ \subsection{Public methods}{ - \itemize{ - \item \href{#method-B-meth1}{\code{B$meth1()}} - \item \href{#method-B-meth4}{\code{B$meth4()}} - \item \href{#method-B-clone}{\code{B$clone()}} - } + \itemize{ + \item \href{#method-B-meth1}{\code{B$meth1()}} + \item \href{#method-B-meth4}{\code{B$meth4()}} + \item \href{#method-B-clone}{\code{B$clone()}} + } } \if{html}{\out{
    Inherited methods
    }} \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-B-meth1}{}}} \subsection{\code{B$meth1()}}{ - B method 1. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{B$meth1(Z)} - \if{html}{\out{
    }} - } - - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{Z}}{Still zzzzzzzz.} - } - \if{html}{\out{
    }} + B method 1. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{B$meth1(Z)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{Z}}{Still zzzzzzzz.} + } + \if{html}{\out{
    }} + } } - } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-B-meth4}{}}} \subsection{\code{B$meth4()}}{ - B method 4. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{B$meth4()} - \if{html}{\out{
    }} + B method 4. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{B$meth4()} + \if{html}{\out{
    }} + } } - } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-B-clone}{}}} \subsection{\code{B$clone()}}{ - The objects of this class are cloneable with this method. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{B$clone(deep = FALSE)} - \if{html}{\out{
    }} + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{B$clone(deep = FALSE)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
    }} + } } - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{deep}}{Whether to make a deep clone.} - } - \if{html}{\out{
    }} - } - - } } --- @@ -292,71 +286,70 @@ \code{A} -> \code{B} -> \code{C} } \section{Public fields}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{field2}}{C field 2.} + \if{html}{\out{
    }} + \describe{ + \item{\code{field2}}{C field 2.} - \item{\code{field5}}{C field 5.} - } - \if{html}{\out{
    }} + \item{\code{field5}}{C field 5.} + } + \if{html}{\out{
    }} } \section{Active bindings}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{active2}}{C binding 2.} + \if{html}{\out{
    }} + \describe{ + \item{\code{active2}}{C binding 2.} - \item{\code{active4}}{C binding 4.} + \item{\code{active4}}{C binding 4.} - \item{\code{active6}}{C binding 6.} - } - \if{html}{\out{
    }} + \item{\code{active6}}{C binding 6.} + } + \if{html}{\out{
    }} } \section{Methods}{ \subsection{Public methods}{ - \itemize{ - \item \href{#method-C-meth2}{\code{C$meth2()}} - \item \href{#method-C-meth5}{\code{C$meth5()}} - } + \itemize{ + \item \href{#method-C-meth2}{\code{C$meth2()}} + \item \href{#method-C-meth5}{\code{C$meth5()}} + } } \if{html}{\out{
    Inherited methods
    }} \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-C-meth2}{}}} \subsection{\code{C$meth2()}}{ - C method 2. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{C$meth2(Z = 10, ...)} - \if{html}{\out{
    }} - } - - \subsection{Arguments}{ - \if{html}{\out{
    }} - \describe{ - \item{\code{Z}}{zzzzz} - \item{\code{...}}{etc} - } - \if{html}{\out{
    }} + C method 2. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{C$meth2(Z = 10, ...)} + \if{html}{\out{
    }} + } + \subsection{Arguments}{ + \if{html}{\out{
    }} + \describe{ + \item{\code{Z}}{zzzzz} + \item{\code{...}}{etc} + } + \if{html}{\out{
    }} + } } - } \if{html}{\out{
    }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-C-meth5}{}}} \subsection{\code{C$meth5()}}{ - C method 5. - \subsection{Usage}{ - \if{html}{\out{
    }} - \preformatted{C$meth5()} - \if{html}{\out{
    }} + C method 5. + \subsection{Usage}{ + \if{html}{\out{
    }} + \preformatted{C$meth5()} + \if{html}{\out{
    }} + } } } - } diff --git a/tests/testthat/testR6/R/classes.R b/tests/testthat/testR6/R/classes.R index d62138b5..93d174eb 100644 --- a/tests/testthat/testR6/R/classes.R +++ b/tests/testthat/testR6/R/classes.R @@ -25,6 +25,8 @@ A <- R6::R6Class( #' @return A value. #' @examples #' ## Example for meth2 + #' ## Second line + #' ## Third line meth2 = function(Z = 10, ...) {}, #' @field field2 A field 2. field2 = "foobar",