Skip to content

Overhaul#77

Open
kbvernon wants to merge 16 commits intoextendr:mainfrom
kbvernon:overhaul
Open

Overhaul#77
kbvernon wants to merge 16 commits intoextendr:mainfrom
kbvernon:overhaul

Conversation

@kbvernon
Copy link
Collaborator

@kbvernon kbvernon commented Mar 13, 2026

Addresses #76

Changes:

  1. Added consistent styling and official palette in extendr.scss
  2. Added contributor guide (or the start of one)
  3. Consolidated text and content in intro-rust and added more output for examples (showing result of cargo run --quiet)
  4. Moved most of the user-guide into _drafts (these will be brought out and updated once we move to new r/extendr)
  5. Simplified the landing page
  6. Added dark mode
  7. Switched to flatly bootswatch
  8. Added _variables.yml to make it easier to update R, Rust, extendr, and rextendr version numbers everywhere they are referenced.
  9. Added iconify quarto extension

Comment on lines +27 to +28
- Every exported function in rextendr must include the following roxygen
variables:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Every exported function in rextendr must include the following roxygen
variables:
roclets:

- the default value, if one exists
- `@return` — what the function returns, including the R type.
- The `@details` and `@examples` sections are optional, but should in general be
included.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples are required by CRAN. this is not optional

The extendr project has three main areas where you can contribute:

**extendr crates** — The core Rust library. This is where the `#[extendr]`
macro, R type bindings, and the bulk of the Rust API live.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
macro, R type bindings, and the bulk of the Rust API live.
macro, R type bindings, and the Rust API live.

Comment on lines +17 to +18
**rextendr package** — The R package that scaffolds new extendr projects
and generates R wrapper functions. Contributions here require R
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**rextendr package** — The R package that scaffolds new extendr projects
and generates R wrapper functions. Contributions here require R
**rextendr package** — The R package that scaffolds new extendr projects.
Contributions here require R

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically devtools::document() does the wrapper generation now

Comment on lines +149 to +170
```{.rust filename="inst/templates/document.rs"}
// Generated by extendr: Do not edit by hand
fn main() -> Result<(), Box<dyn std::error::Error>> {
let wrapper_path = "../R/extendr-wrappers.R";
let header = "\
# Generated by extendr: Do not edit by hand\n\
# nolint start\n\
\n\
#' @usage NULL\n\
#' @useDynLib {{{pkg_name}}}, .registration = TRUE\n\
NULL\n\
\n\
";
let footer = "# nolint end\n";
let wrappers = {{{lib_name}}}::get_{{{mod_name}}}_metadata()
.make_r_wrappers(true, "{{{pkg_name}}}")
.map_err(|e| format!("failed to generate wrappers: {e}"))?;
std::fs::write(wrapper_path, format!("{header}{wrappers}{footer}"))
.map_err(|e| format!("failed to write {wrapper_path}: {e}"))?;
Ok(())
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```{.rust filename="inst/templates/document.rs"}
// Generated by extendr: Do not edit by hand
fn main() -> Result<(), Box<dyn std::error::Error>> {
let wrapper_path = "../R/extendr-wrappers.R";
let header = "\
# Generated by extendr: Do not edit by hand\n\
# nolint start\n\
\n\
#' @usage NULL\n\
#' @useDynLib {{{pkg_name}}}, .registration = TRUE\n\
NULL\n\
\n\
";
let footer = "# nolint end\n";
let wrappers = {{{lib_name}}}::get_{{{mod_name}}}_metadata()
.make_r_wrappers(true, "{{{pkg_name}}}")
.map_err(|e| format!("failed to generate wrappers: {e}"))?;
std::fs::write(wrapper_path, format!("{header}{wrappers}{footer}"))
.map_err(|e| format!("failed to write {wrapper_path}: {e}"))?;
Ok(())
}
```

this isn't necessary and may change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did this go?

Comment on lines +198 to +199
Shell scripts run by R when the package is uninstalled. They remove the
generated `src/Makevars` and `src/Makevars.win` files respectively. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct. These are run at the end of package installation

Comment on lines +1 to +5
version:
r: "4.2"
rust: "1.65.0"
extendr: "0.8.1"
rextendr: "0.4.2.9000"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm anti yaml.

Think we can change this to?

[versions]
r = "4.5"
rust = "1.71"
rextendr = "0.4"

Can read it with tomledit::read_toml(".variables.toml")

## Codebase

**extendr**
version: 0.8.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version is gonna trip claude up. This is the type of false flag that claude LOVES to get hung up on!

Suggested change
version: 0.8.1

need to understand extendr's API, types, macros, or implementation details.

**rextendr**
version: 0.4.2.9000 (dev)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: 0.4.2.9000 (dev)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants