Skip to content

Commit cfd60d9

Browse files
authored
docs: enabling markdown support (#246)
1 parent 4d9b000 commit cfd60d9

9 files changed

Lines changed: 86 additions & 95 deletions

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ URL: https://process-analytics.github.io/bpmn-visualization-R/, https://github.c
1111
BugReports: https://github.com/process-analytics/bpmn-visualization-R/issues/
1212
Encoding: UTF-8
1313
RoxygenNote: 7.2.3
14+
Roxygen: list(markdown = TRUE)
1415
Imports:
1516
htmlwidgets,
1617
rlang,

R/bpmnVisualizationR.R

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
#'
2020
#' @param bpmnXML A file name or 'XML' document or string in 'BPMN' 'XML' format
2121
#' @param overlays An element or a list of elements to be added to the diagram's existing elements.
22-
#' Use the \code{create_overlay} function to create an overlay object with content and a relative position.
23-
#' @param enableDefaultOverlayStyle If no style is set on an overlay, and this parameter is set to \code{TRUE}, the default style will be applied to the overlay.
24-
#' By default, \code{enableDefaultOverlayStyle} is set to \code{TRUE}.
22+
#' Use the [`create_overlay`] function to create an overlay object with content and a relative position.
23+
#' @param enableDefaultOverlayStyle If no style is set on an overlay, and this parameter is set to `TRUE`, the default style will be applied to the overlay.
24+
#' By default, `enableDefaultOverlayStyle` is set to `TRUE`.
2525
#' @param width A fixed width for the widget (in CSS units).
26-
#' The default value is \code{NULL}, which results in intelligent automatic sizing based on the widget's container.
26+
#' The default value is `NULL`, which results in intelligent automatic sizing based on the widget's container.
2727
#' @param height A fixed height for the widget (in CSS units).
28-
#' The default value is \code{NULL}, which results in intelligent automatic sizing based on the widget's container.
28+
#' The default value is `NULL`, which results in intelligent automatic sizing based on the widget's container.
2929
#' @param elementId The ID of the 'HTML' element to enclose the widget.
3030
#' Use an explicit element ID for the widget (rather than an automatically generated one).
3131
#' This is useful if you have other 'JavaScript' that needs to explicitly
3232
#' discover and interact with a specific widget instance.
3333
#'
34-
#' @returns A \code{bpmnVisualizationR} widget that will intelligently print itself into 'HTML' in a variety of contexts
34+
#' @returns A `bpmnVisualizationR` widget that will intelligently print itself into 'HTML' in a variety of contexts
3535
#' including the 'R' console, within 'R Markdown' documents, and within 'Shiny' output bindings.
3636
#'
3737
#' @examples
@@ -98,7 +98,7 @@
9898
#' height='auto'
9999
#' )
100100
#'
101-
#' @seealso \code{\link{create_overlay}} to create an overlay
101+
#' @seealso [`create_overlay`] to create an overlay
102102
#'
103103
#' @import htmlwidgets
104104
#' @import xml2
@@ -128,18 +128,17 @@ display <- function(
128128
)
129129
}
130130

131-
#' @title Shiny output binding for the \code{bpmnVisualizationR} 'HTML' widget
131+
#' @title Shiny output binding for the `bpmnVisualizationR` 'HTML' widget
132132
#'
133133
#' @name bpmnVisualizationR-shiny-output
134134
#' @description
135-
#' Helper to create output function for using the \code{bpmnVisualizationR} 'HTML' widget within 'Shiny' applications and interactive 'Rmd' documents.
135+
#' Helper to create output function for using the `bpmnVisualizationR` 'HTML' widget within 'Shiny' applications and interactive 'Rmd' documents.
136136
#'
137137
#' @param outputId output variable to read from
138-
#' @param width,height Must be a valid CSS unit (like \code{'100\%'},
139-
#' \code{'400px'}, \code{'auto'}) or a number, which will be coerced to a
140-
#' string and have \code{'px'} appended.
138+
#' @param width,height Must be a valid CSS unit (like `100%`, `400px`, `auto`) or a number,
139+
#' which will be coerced to a string and have `px` appended.
141140
#'
142-
#' @returns An output function that enables the use of the \code{bpmnVisualizationR} widget within 'Shiny' applications.
141+
#' @returns An output function that enables the use of the `bpmnVisualizationR` widget within 'Shiny' applications.
143142
#'
144143
#' @export
145144
bpmnVisualizationROutput <- function(
@@ -156,18 +155,18 @@ bpmnVisualizationROutput <- function(
156155
)
157156
}
158157

159-
#' @title 'Shiny' render binding for the \code{bpmnVisualizationR} 'HTML' widget
158+
#' @title 'Shiny' render binding for the `bpmnVisualizationR` 'HTML' widget
160159
#'
161160
#' @rdname bpmnVisualizationR-shiny-render
162161
#' @description
163-
#' Helper to create render function for using the \code{bpmnVisualizationR} 'HTML' widget within 'Shiny' applications and interactive 'Rmd' documents.
162+
#' Helper to create render function for using the `bpmnVisualizationR` 'HTML' widget within 'Shiny' applications and interactive 'Rmd' documents.
164163
#'
165-
#' @param expr An expression that generates a \code{bpmnVisualizationR} 'HTML' widget
166-
#' @param env The environment in which to evaluate \code{expr}.
167-
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
164+
#' @param expr An expression that generates a `bpmnVisualizationR` 'HTML' widget
165+
#' @param env The environment in which to evaluate `expr`.
166+
#' @param quoted Is `expr` a quoted expression (with `quote()`)? This
168167
#' is useful if you want to save an expression in a variable.
169168
#'
170-
#' @returns A render function that enables the use of the \code{bpmnVisualizationR} widget within 'Shiny' applications.
169+
#' @returns A render function that enables the use of the `bpmnVisualizationR` widget within 'Shiny' applications.
171170
#'
172171
#' @export
173172
renderBpmnVisualizationR <- function(

R/funs.R

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
#' @title The overlay positions on \code{Shape}
1+
#' @title The overlay positions on `Shape`
22
#'
33
#' @description
4-
#' To specify the position when creating an overlay object that will be attached to BPMN \code{Shape} elements in the diagram.
4+
#' To specify the position when creating an overlay object that will be attached to BPMN `Shape` elements in the diagram.
55
#'
66
#' @details
7-
#' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function.
8-
#'
9-
#' @section Positions:
10-
#' \itemize{
11-
#' \item{\code{top-left}}{}
12-
#' \item{\code{top-right}}{}
13-
#' \item{\code{top-center}}{}
14-
#' \item{\code{bottom-left}}{}
15-
#' \item{\code{bottom-right}}{}
16-
#' \item{\code{bottom-center}}{}
17-
#' \item{\code{middle-left}}{}
18-
#' \item{\code{middle-right}}{}
19-
#' }
20-
#'
21-
#' @seealso
22-
#' \code{\link{create_overlay}}
7+
#' Use these constants as the `position` argument in the [`create_overlay`] function.
8+
#'
9+
#' **Positions**:
10+
#' * `top-left`
11+
#' * `top-right`
12+
#' * `top-center`
13+
#' * `bottom-left`
14+
#' * `bottom-right`
15+
#' * `bottom-center`
16+
#' * `middle-left`
17+
#' * `middle-right`
18+
#'
19+
#' @seealso [`create_overlay`]
2320
#'
2421
#' @examples
2522
#' # Create an overlay at the top-left corner of a shape
@@ -38,23 +35,20 @@ overlay_shape_position <-
3835
"middle-right"
3936
)
4037

41-
#' @title The overlay positions on \code{Edge}
38+
#' @title The overlay positions on `Edge`
4239
#'
4340
#' @description
44-
#' To specify the position when creating an overlay object that will be attached to BPMN \code{Edge} elements in the diagram.
41+
#' To specify the position when creating an overlay object that will be attached to BPMN `Edge` elements in the diagram.
4542
#'
4643
#' @details
47-
#' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function.
44+
#' Use these constants as the `position` argument in the [`create_overlay`] function.
4845
#'
49-
#' @section Positions:
50-
#' \itemize{
51-
#' \item{\code{start}}{}
52-
#' \item{\code{end}}{}
53-
#' \item{\code{middle}}{}
54-
#' }
46+
#' **Positions**:
47+
#' * `start`
48+
#' * `end`
49+
#' * `middle`
5550
#'
56-
#' @seealso
57-
#' \code{\link{create_overlay}}
51+
#' @seealso [`create_overlay`]
5852
#'
5953
#' @examples
6054
#' # Create an overlay at the starting point of an edge
@@ -69,17 +63,17 @@ overlay_edge_position <- c("start", "end", "middle")
6963
#' @description
7064
#' An overlay can be added to existing elements in the diagram.
7165
#'
72-
#' See the \code{overlays} argument in the \code{\link{display}} function.
66+
#' See the `overlays` argument in the [`display`] function.
7367
#'
7468
#' Use this function to create the correct overlay structure.
7569
#'
7670
#' @param elementId The bpmn element id to which the overlay will be attached
7771
#' @param label 'HTML' element to use as an overlay
7872
#' @param style The style of the overlay.
79-
#' Use \code{\link{create_overlay_style}} function to create the style object of an overlay and be aware of the `enableDefaultOverlayStyle` parameter in the \code{\link{display}} function.
73+
#' Use [`create_overlay_style`] function to create the style object of an overlay and be aware of the `enableDefaultOverlayStyle` parameter in the [`display`] function.
8074
#' @param position The position of the overlay
81-
#' If the bpmn element where the overlay will be attached is a Shape, use \code{\link{overlay_shape_position}}.
82-
#' Otherwise, use \code{\link{overlay_edge_position}}.
75+
#' If the bpmn element where the overlay will be attached is a Shape, use [`overlay_shape_position`].
76+
#' Otherwise, use [`overlay_edge_position`].
8377
#'
8478
#' @returns An overlay object
8579
#'
@@ -141,17 +135,17 @@ create_overlay <- function(elementId, label, style = NULL, position = NULL) {
141135
#' @description
142136
#' When adding an overlay to an existing element in a diagram, it's possible to customize its style.
143137
#'
144-
#' Refer to the \code{style} parameter in the \code{\link{create_overlay}} function for more information.
138+
#' Refer to the `style` parameter in the [`create_overlay`] function for more information.
145139
#'
146140
#' Use this function to create the correct style structure for an overlay.
147141
#'
148-
#' @param font_color The font color of the overlay. Use all HTML color names or HEX codes.
142+
#' @param font_color The font color of the overlay. It can be any HTML color name or HEX code.
149143
#' @param font_size The font size of the overlay. Specify a number in px.
150-
#' @param fill_color The color of the background of the overlay. Use all HTML color names or HEX codes.
151-
#' @param stroke_color The color of the stroke of the overlay. Use all HTML color names or HEX codes.
152-
#' If you don't want to display a stroke, you can set the color to:
153-
#' - \code{transparent},
154-
#' - the same value as for the \code{fill_color}. This increases the \code{padding}/\code{margin}.
144+
#' @param fill_color The color of the background of the overlay. It can be any HTML color name or HEX code.
145+
#' @param stroke_color The color of the stroke of the overlay. It can be any HTML color name or HEX code.\cr
146+
#' If you don't want to display a stroke, you can set the color to:
147+
#' * `transparent`,
148+
#' * the same value as for the `fill_color`. This increases the `padding`/`margin`.
155149
#'
156150
#' @returns The style object of the overlay
157151
#'
@@ -174,7 +168,7 @@ create_overlay_style <- function(font_color = NULL,
174168
#' @description
175169
#' - Overlay:
176170
#' When adding an overlay to an existing element in a diagram, it's possible to customize its font style.
177-
#' Refer to the \code{font} parameter in the \code{\link{create_overlay_style}} function for more information.
171+
#' Refer to the `font` parameter in the [`create_overlay_style`] function for more information.
178172
#' Use this function to create the correct font structure for an overlay.
179173
#'
180174
#' @param color The color of the font of the overlay
@@ -197,7 +191,7 @@ create_font <- function(color = NULL, size = NULL) {
197191
#' @description
198192
#' - Overlay:
199193
#' When adding an overlay to an existing element in a diagram, it's possible to customize how it is filled.
200-
#' Refer to the \code{fill} parameter in the \code{\link{create_overlay_style}} function for more information.
194+
#' Refer to the `fill` parameter in the [`create_overlay_style`] function for more information.
201195
#' Use this function to create the correct fill structure for an overlay.
202196
#'
203197
#' @param color The color of the background of the overlay
@@ -217,8 +211,8 @@ create_fill <- function(color) {
217211
#' @name create_stroke
218212
#' @description
219213
#' - Overlay:
220-
#' When adding an overlay to an existing element in a diagram, it's possible to customize its stroke. style.
221-
#' Refer to the \code{stroke.} parameter in the \code{\link{create_overlay_style}} function for more information.
214+
#' When adding an overlay to an existing element in a diagram, it's possible to customize its stroke style.
215+
#' Refer to the `stroke` parameter in the [`create_overlay_style`] function for more information.
222216
#' Use this function to create the correct stroke structure for an overlay.
223217
#'
224218
#' @param color The color of the stroke of the overlay

man/bpmnVisualizationR-shiny-output.Rd

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/create_overlay.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/create_overlay_style.Rd

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/display.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/overlay_edge_position.Rd

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/overlay_shape_position.Rd

Lines changed: 11 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)