{"id":13707903,"url":"https://github.com/mlysy/rdoxygen","last_synced_at":"2025-04-30T17:31:30.783Z","repository":{"id":56937500,"uuid":"87541999","full_name":"mlysy/rdoxygen","owner":"mlysy","description":"Create doxygen documentation for R package C++ code","archived":false,"fork":false,"pushed_at":"2024-09-19T17:31:00.000Z","size":380,"stargazers_count":17,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-28T17:32:44.286Z","etag":null,"topics":["doxygen","r","rcpp","rstudio-addin"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlysy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-07T12:11:23.000Z","updated_at":"2024-10-23T02:16:59.000Z","dependencies_parsed_at":"2022-08-21T06:50:16.078Z","dependency_job_id":null,"html_url":"https://github.com/mlysy/rdoxygen","commit_stats":null,"previous_names":["nevrome/rdoxygen"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlysy%2Frdoxygen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlysy%2Frdoxygen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlysy%2Frdoxygen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlysy%2Frdoxygen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlysy","download_url":"https://codeload.github.com/mlysy/rdoxygen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224219731,"owners_count":17275477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doxygen","r","rcpp","rstudio-addin"],"created_at":"2024-08-02T22:01:47.632Z","updated_at":"2024-11-12T04:44:34.738Z","avatar_url":"https://github.com/mlysy.png","language":"HTML","funding_links":[],"categories":["Manual","HTML"],"sub_categories":[],"readme":"[![Travis-CI Build Status](https://travis-ci.org/nevrome/rdoxygen.svg?branch=master)](https://travis-ci.org/nevrome/rdoxygen) [![Coverage Status](https://img.shields.io/codecov/c/github/nevrome/rdoxygen/master.svg)](https://codecov.io/github/nevrome/rdoxygen?branch=master)\n[![CRAN\\_Status\\_Badge](http://www.r-pkg.org/badges/version/rdoxygen)](https://cran.r-project.org/package=rdoxygen)\n[![license](https://img.shields.io/badge/license-GPL%202-B50B82.svg)](https://www.r-project.org/Licenses/GPL-2)\n\n# rdoxygen: Create doxygen documentation for R package C++ code\n\n*[Clemens Schmid](https://nevrome.de/), Martin Lysy*\n\n---\n\n### Description\n\nCreate [**doxygen**](http://www.doxygen.nl/) documentation for source C++ code in R packages, and optionally make it accessible as an R vignette.  Includes an [**RStudio** Addin](https://rstudio.github.io/rstudioaddins/) to easily trigger the doxygenize process.\n\n### Installation\n\nTo use **rdoxygen** you need to first install doxygen, for which detailed instructions are provided [here](http://www.doxygen.nl/manual/install.html).  Next, install **rdoxygen** either from [CRAN](https://CRAN.R-project.org/package=rdoxygen), or obtain the latest development version from GitHub by first installing the R package [**devtools**](https://CRAN.R-project.org/package=devtools), then run\n```r\ndevtools::install_github(\"mlysy/rdoxygen\")\n```\n\n### Usage\n\nThe following is a C++ code snippet taken from [Rcpp Modules](https://CRAN.R-project.org/package=Rcpp/vignettes/Rcpp-modules.pdf), with added doxygen-style comments to be parsed into source code documentation.  For simplicity only a few doxygen features are illustrated here; the complete set is extensively documented on the [doxygen website](http://www.doxygen.nl/manual/index.html).\n\n\u003ca id=\"doxygen_example\"\u003e\u003c/a\u003e\n```c\n/// A class for uniform random number generation.\n///\n/// Provides an example of doxygen class documentation.\nclass Uniform {\npublic:\n  /// Construct a uniform random number generator.\n  Uniform(double min_, double max_) : min(min_), max(max_) {}\n\n  /// Obtain iid draws from a uniform distribution.\n  NumericVector draw(int n);\n\n  double min; ///\u003c Minimum value of the uniform.\n  double max; ///\u003c Maximum value of the uniform.\n};\n\n/// Creates an object to sample from \\f$U \\sim \\mathrm{Uniform}(a, b)\\f$.\n///\n/// @param[in] min_ The minimum value \\f$a\\f$ of the uniform.\n/// @param[in] max_ The maximum value \\f$b\\f$ of the uniform.\nUniform::Uniform(double min_, double max_) : min(min_), max(max_) {}\n\n/// Returns a sample \\f$U_1,\\ldots,U_n \\stackrel{\\mathrm{iid}}{\\sim} \\mathrm{Uniform}(a, b)\\f$.\n///\n/// @param[in] n Number of iid draws to produce.\n/// @return Vector of `n` draws from the uniform distribution.\nNumericVector Uniform::draw(int n) {\n  RNGScope scope;\n  return runif( n, min, max );\n}\n```\n\n#### Processing with **rdoxygen**\n\nSuppose that the [code snippet](#doxygen_example) above is in a file called `rdoxygenExample.cpp`.  Then a typical doxygen documentation (doxydoc) processing workflow is as follows:\n\n1.  Create a default `Doxyfile` containing a list of options to render the documentation in `rdoxygenExample.cpp`.\n2.  Edit the `Doxyfile` to customize rendering options as desired.  The relevant settings are extensively documented on the [doxygen website](http://www.doxygen.nl/manual/config.html) and within the default `Doxyfile` itself.\n3.  Run doxygen on the `Doxyfile` to create the doxydoc HTML.\n\nThe rdoxygen package provides several convenience files to do all of this from within an R session during the package development process.  That is, suppose `rdoxygenExample.cpp` is located in the `src` folder of the R package **DoxygenExample**.  From an R session with working directory anywhere within the folder structure of **DoxygenExample**, the package developer can parse the doxydoc with the following R code:\n```r\nrequire(rdoxygen)\n\n# create doxydoc with default options, wrap it as an R vignette\ndoxy(vignette = TRUE)\n\n# --- separate the steps above ---\n\n# 1. Create just the Doxyfile for the package documentation.\n#    In particular, this looks for any doxygen markup in\n#    the src and inst/include subdirectories.\ndoxy_init()\n\n# 2. Optionally, edit the package Doxyfile\ndoxy_edit(options = c(SHOW_INCLUDE_FILES = \"NO\"))\n\n# 3. Create the doxygen HTML documentation\ndoxy(vignette = FALSE)\n\n# 4. Wrap the HTML documentation into an R vignette\ndoxy_vignette()\n```\nThe HTML output of these calls can be viewed [here](http://htmlpreview.github.io/?https://github.com/mlysy/rdoxygen/blob/master/inst/doxygen/html/index.html).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlysy%2Frdoxygen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlysy%2Frdoxygen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlysy%2Frdoxygen/lists"}