Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
120b301
Merge pull request #614 from OHDSI/main
clairblacketer Feb 2, 2024
f75106e
Merge pull request #692 from OHDSI/main
clairblacketer May 23, 2024
d8e49eb
Merge pull request #798 from OHDSI/main
clairblacketer Jul 29, 2026
2ccb893
Closes #697
clairblacketer Jul 29, 2026
d3a5f04
Closes #531
clairblacketer Jul 29, 2026
d0d8e68
Closes #455
clairblacketer Jul 29, 2026
e8aea66
closes #702
clairblacketer Jul 29, 2026
46ed715
Closes #639
clairblacketer Jul 29, 2026
e8d9848
Closes #536
clairblacketer Jul 30, 2026
03b01ac
Closes #598
clairblacketer Jul 30, 2026
8079c53
Closes #742
clairblacketer Jul 30, 2026
1b25b3f
closes #560
clairblacketer Jul 30, 2026
9480c7d
closes #707
clairblacketer Jul 30, 2026
ecf3844
closes #539
clairblacketer Jul 30, 2026
b7f005e
closes #528
clairblacketer Jul 30, 2026
77de49f
aligns the v5.3 and v6.0 documentation with the v5.4 documentation
clairblacketer Jul 30, 2026
88b78a6
Updating constraints for v5.4
clairblacketer Jul 30, 2026
f151b8a
Regenerating docs for bugfix release
clairblacketer Jul 31, 2026
071636a
Changes to github actions codespell to fix error
clairblacketer Jul 31, 2026
08d0969
Update R_CMD_Check to get rid of versioning errors
clairblacketer Jul 31, 2026
9e42a7a
Fixing additional version errors
clairblacketer Jul 31, 2026
d26709c
Fixing additional packages issues identified by github actions
clairblacketer Jul 31, 2026
f7033b5
Fixes to hints for SqlRender
clairblacketer Jul 31, 2026
a68363c
Removing hints from all files besides redshift
clairblacketer Jul 31, 2026
0dd2175
Avoid wrapping sql to try to address errors
clairblacketer Jul 31, 2026
40ff52f
More error fixes
clairblacketer Jul 31, 2026
fbd2161
updated the drop table function
clairblacketer Jul 31, 2026
da85e56
additional test fixes to address errors
clairblacketer Jul 31, 2026
10e7f0a
Update setup.R
clairblacketer Jul 31, 2026
d9d0a26
Removing the uniqueDQIdentifiers column from csvs
clairblacketer Aug 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
extras/*
docs/*
rmd/*
site/*
^CRAN-SUBMISSION$
^cran-comments\.md$
6 changes: 3 additions & 3 deletions .github/workflows/R_CMD_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3.3.1
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
Expand Down Expand Up @@ -111,14 +111,14 @@ jobs:

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: Upload source package
if: success() && runner.os == 'macOS' && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: package_tarball
path: check/*.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ Suggests:
RSQLite,
withr
NeedsCompilation: no
RoxygenNote: 7.2.3
RoxygenNote: 7.3.3
Config/testthat/edition: 3
55 changes: 45 additions & 10 deletions R/createDdl.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,55 @@ createDdl <- function(cdmVersion){

tableList <- tableSpecs$cdmTableName

# Define sort keys for major tables
sortKeyMap <- list(
visit = "visit_concept_id,person_id",
visit_detail = "visit_detail_concept_id,person_id",
condition_occurrence = "condition_concept_id,person_id",
drug_exposure = "drug_concept_id,person_id",
device_exposure = "device_concept_id,person_id",
procedure_occurrence = "procedure_concept_id,person_id",
observation = "observation_concept_id,person_id",
drug_era = "drug_concept_id,person_id"
)

sql_result <- c()
sql_result <- c(paste0("--@targetDialect CDM DDL Specification for OMOP Common Data Model ", cdmVersion))
for (tableName in tableList){
fields <- subset(cdmSpecs, cdmTableName == tableName)
fieldNames <- fields$cdmFieldName

# Build HINT statement with DISTRIBUTE_ON_KEY (Redshift only)
if ('person_id' %in% fieldNames){
query <- "\n\n--HINT DISTRIBUTE ON KEY (person_id)\n"
hintContent <- "--HINT DISTRIBUTE_ON_KEY(person_id)"
} else {
query <- "\n\n--HINT DISTRIBUTE ON RANDOM\n"
hintContent <- "--HINT DISTRIBUTE_ON_KEY(RANDOM)"
}

# Add SORT_ON_KEY if table is in sortKeyMap and has all the sort fields
if (tableName %in% names(sortKeyMap)){
sortFieldStr <- sortKeyMap[[tableName]]
# Split by comma to get individual fields
sortFields <- trimws(strsplit(sortFieldStr, ",")[[1]])
# Check if all sort fields exist in the table
if (all(sortFields %in% fieldNames)){
hintContent <- paste0(hintContent, " SORT_ON_KEY(INTERLEAVED:", sortFieldStr, ")")
}
}

# Use HINT as a single-line comment
# Redshift will recognize and apply --HINT directives
# Non-Redshift dialects will have these removed in writeDdl()
hint <- hintContent

query <- paste0("\n", hint, "\n")
sql_result <- c(sql_result, query, paste0("CREATE TABLE @cdmDatabaseSchema.", tableName, " ("))

n_fields <- length(fieldNames)
for(fieldName in fieldNames) {

if (subset(fields, cdmFieldName == fieldName, isRequired) == "Yes") {
req_val <- subset(fields, cdmFieldName == fieldName, isRequired)
if (req_val == "Yes" || req_val == "true" || req_val == TRUE) {
nullable_sql <- (" NOT NULL")
} else {
nullable_sql <- (" NULL")
Expand Down Expand Up @@ -109,7 +140,7 @@ createPrimaryKeys <- function(cdmVersion){
cdmFieldCsvLoc <- system.file(file.path("csv", paste0("OMOP_CDMv", cdmVersion, "_Field_Level.csv")), package = "CommonDataModel", mustWork = TRUE)
cdmSpecs <- read.csv(cdmFieldCsvLoc, stringsAsFactors = FALSE)

primaryKeys <- subset(cdmSpecs, isPrimaryKey == "Yes")
primaryKeys <- subset(cdmSpecs, isPrimaryKey == "true" | isPrimaryKey == "Yes" | isPrimaryKey == TRUE)
pkFields <- primaryKeys$cdmFieldName

sql_result <- c(paste0("--@targetDialect CDM Primary Key Constraints for OMOP Common Data Model ", cdmVersion, "\n"))
Expand All @@ -136,16 +167,20 @@ createForeignKeys <- function(cdmVersion){
cdmFieldCsvLoc <- system.file(file.path("csv", paste0("OMOP_CDMv", cdmVersion, "_Field_Level.csv")), package = "CommonDataModel", mustWork = TRUE)
cdmSpecs <- read.csv(cdmFieldCsvLoc, stringsAsFactors = FALSE)

foreignKeys <- subset(cdmSpecs, isForeignKey == "Yes")
foreignKeys$key <- paste0(foreignKeys$cdmTableName, "_", foreignKeys$cdmFieldName)

foreignKeys <- subset(cdmSpecs, isForeignKey == "true" | isForeignKey == "Yes" | isForeignKey == TRUE)

sql_result <- c(paste0("--@targetDialect CDM Foreign Key Constraints for OMOP Common Data Model ", cdmVersion, "\n"))
for (foreignKey in foreignKeys$key){

subquery <- subset(foreignKeys, foreignKeys$key==foreignKey)

# Only process if there are foreign keys
if (nrow(foreignKeys) > 0) {
foreignKeys$key <- paste0(foreignKeys$cdmTableName, "_", foreignKeys$cdmFieldName)

for (foreignKey in foreignKeys$key){
subquery <- subset(foreignKeys, foreignKeys$key==foreignKey)

sql_result <- c(sql_result, paste0("\nALTER TABLE @cdmDatabaseSchema.", subquery$cdmTableName, " ADD CONSTRAINT fpk_", subquery$cdmTableName, "_", subquery$cdmFieldName, " FOREIGN KEY (", subquery$cdmFieldName , ") REFERENCES @cdmDatabaseSchema.", subquery$fkTableName, " (", subquery$fkFieldName, ");\n"))

}
}
return(paste0(sql_result, collapse = ""))
}
Expand Down
35 changes: 31 additions & 4 deletions R/writeDDL.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,22 @@ writeDdl <- function(targetDialect, cdmVersion, outputfolder, cdmDatabaseSchema
sql <- SqlRender::render(sql = sql, cdmDatabaseSchema = cdmDatabaseSchema, targetDialect = targetDialect)
sql <- SqlRender::translate(sql, targetDialect = targetDialect)

# Post-processing: remove conditional markers and handle dialects
lines <- strsplit(sql, "\n")[[1]]

if (tolower(targetDialect) == "redshift") {
# For Redshift: remove conditional markers but keep the HINT lines
lines <- lines[!grepl("\\{#?if|\\{/if\\}", lines)]
} else {
# For non-Redshift: remove HINT directives and conditional markers
lines <- lines[!grepl("--HINT|\\{#?if|\\{/if\\}", lines)]
}

sql <- paste(lines, collapse = "\n")

filename <- paste("OMOPCDM", gsub(" ", "_", targetDialect), cdmVersion, "ddl.sql", sep = "_")
SqlRender::writeSql(sql = sql, targetFile = file.path(outputfolder, filename))
# Use writeLines instead of SqlRender::writeSql to avoid line wrapping that breaks SQL
writeLines(sql, con = file.path(outputfolder, filename))
invisible(filename)
}

Expand All @@ -71,8 +85,14 @@ writePrimaryKeys <- function(targetDialect, cdmVersion, outputfolder, cdmDatabas
sql <- SqlRender::render(sql = sql, cdmDatabaseSchema = cdmDatabaseSchema, targetDialect = targetDialect)
sql <- SqlRender::translate(sql, targetDialect = targetDialect)

# Post-processing: remove any conditional markers that may have been added
lines <- strsplit(sql, "\n")[[1]]
lines <- lines[!grepl("\\{#?if|\\{/if\\}", lines)]
sql <- paste(lines, collapse = "\n")

filename <- paste("OMOPCDM", gsub(" ", "_", targetDialect), cdmVersion, "primary", "keys.sql", sep = "_")
SqlRender::writeSql(sql = sql, targetFile = file.path(outputfolder, filename))
# Use writeLines instead of SqlRender::writeSql to avoid line wrapping
writeLines(sql, con = file.path(outputfolder, filename))
invisible(filename)
}

Expand All @@ -96,8 +116,14 @@ writeForeignKeys <- function(targetDialect, cdmVersion, outputfolder, cdmDatabas
sql <- SqlRender::render(sql = sql, cdmDatabaseSchema = cdmDatabaseSchema, targetDialect = targetDialect)
sql <- SqlRender::translate(sql, targetDialect = targetDialect)

# Post-processing: remove any conditional markers that may have been added
lines <- strsplit(sql, "\n")[[1]]
lines <- lines[!grepl("\\{#?if|\\{/if\\}", lines)]
sql <- paste(lines, collapse = "\n")

filename <- paste("OMOPCDM", gsub(" ", "_", targetDialect), cdmVersion, "constraints.sql", sep = "_")
SqlRender::writeSql(sql = sql, targetFile = file.path(outputfolder, filename))
# Use writeLines instead of SqlRender::writeSql to avoid line wrapping
writeLines(sql, con = file.path(outputfolder, filename))
invisible(filename)
}

Expand All @@ -123,6 +149,7 @@ writeIndex <- function(targetDialect, cdmVersion, outputfolder, cdmDatabaseSchem
sql <- SqlRender::translate(sql, targetDialect = targetDialect)

filename <- paste("OMOPCDM", gsub(" ", "_", targetDialect), cdmVersion, "indices.sql", sep = "_")
SqlRender::writeSql(sql = sql, targetFile = file.path(outputfolder, filename))
# Use writeLines instead of SqlRender::writeSql to avoid line wrapping
writeLines(sql, con = file.path(outputfolder, filename))
invisible(filename)
}
32 changes: 14 additions & 18 deletions docs/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.8.27">
<meta name="generator" content="quarto-1.7.29">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -33,19 +33,18 @@
<link href="./man/favicon.ico" rel="icon">
<script src="site_libs/quarto-html/quarto.js" type="module"></script>
<script src="site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
<script src="site_libs/quarto-html/axe/axe-check.js" type="module"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-ed96de9b727972fe78a7b5d16c58bf87.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-dark-4d9afe2b8d18ee9fa5d0d57b5ed4214d.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-ed96de9b727972fe78a7b5d16c58bf87.css" rel="stylesheet" class="quarto-color-scheme-extra" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-0815c480559380816a4d1ea211a47e91.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-dark-748b535e376f14d4692bf2b2e5fd6380.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-0815c480559380816a4d1ea211a47e91.css" rel="stylesheet" class="quarto-color-scheme-extra" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap-5b4ad623e5705c0698d39aec6f10cf02.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap-dark-0d4a9d19931feb4fee1ddab4b2489000.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
<link href="site_libs/bootstrap/bootstrap-5b4ad623e5705c0698d39aec6f10cf02.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme-extra" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap-c1fac2584b48ed01fb6e278e36375074.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap-dark-ccd81253fefb92e9cd3f9eb5b5d87b54.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
<link href="site_libs/bootstrap/bootstrap-c1fac2584b48ed01fb6e278e36375074.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme-extra" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
"location": "navbar",
"copy-button": false,
Expand Down Expand Up @@ -242,7 +241,6 @@
toggleColorMode(toAlternate);
setStyleSentinel(toAlternate);
toggleGiscusIfUsed(toAlternate, darkModeDefault);
window.dispatchEvent(new Event('resize'));
};
// Switch to dark mode if need be
if (hasAlternateSentinel()) {
Expand All @@ -258,8 +256,7 @@
<div class="navbar-container container-fluid">
<div class="navbar-brand-container mx-auto">
<a href="./index.html" class="navbar-brand navbar-brand-logo">
<img src="./man/ohdsi16x16.png" alt="" class="navbar-logo light-content">
<img src="./man/ohdsi16x16.png" alt="" class="navbar-logo dark-content">
<img src="./man/ohdsi16x16.png" alt="" class="navbar-logo">
</a>
<a class="navbar-brand" href="./index.html">
<span class="navbar-title">OMOP Common Data Model</span>
Expand Down Expand Up @@ -582,14 +579,13 @@ <h2 class="anchored" data-anchor-id="design-principles">Design Principles</h2>
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const outerScaffold = trigger.parentElement.cloneNode(true);
const codeEl = outerScaffold.querySelector('code');
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
}
return codeEl.innerText;
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
Expand Down
32 changes: 14 additions & 18 deletions docs/cdm30.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.8.27">
<meta name="generator" content="quarto-1.7.29">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -33,19 +33,18 @@
<link href="./man/favicon.ico" rel="icon">
<script src="site_libs/quarto-html/quarto.js" type="module"></script>
<script src="site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
<script src="site_libs/quarto-html/axe/axe-check.js" type="module"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-ed96de9b727972fe78a7b5d16c58bf87.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-dark-4d9afe2b8d18ee9fa5d0d57b5ed4214d.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-ed96de9b727972fe78a7b5d16c58bf87.css" rel="stylesheet" class="quarto-color-scheme-extra" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-0815c480559380816a4d1ea211a47e91.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-dark-748b535e376f14d4692bf2b2e5fd6380.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-0815c480559380816a4d1ea211a47e91.css" rel="stylesheet" class="quarto-color-scheme-extra" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap-5b4ad623e5705c0698d39aec6f10cf02.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap-dark-0d4a9d19931feb4fee1ddab4b2489000.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
<link href="site_libs/bootstrap/bootstrap-5b4ad623e5705c0698d39aec6f10cf02.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme-extra" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap-c1fac2584b48ed01fb6e278e36375074.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap-dark-ccd81253fefb92e9cd3f9eb5b5d87b54.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
<link href="site_libs/bootstrap/bootstrap-c1fac2584b48ed01fb6e278e36375074.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme-extra" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
"location": "navbar",
"copy-button": false,
Expand Down Expand Up @@ -242,7 +241,6 @@
toggleColorMode(toAlternate);
setStyleSentinel(toAlternate);
toggleGiscusIfUsed(toAlternate, darkModeDefault);
window.dispatchEvent(new Event('resize'));
};
// Switch to dark mode if need be
if (hasAlternateSentinel()) {
Expand All @@ -258,8 +256,7 @@
<div class="navbar-container container-fluid">
<div class="navbar-brand-container mx-auto">
<a href="./index.html" class="navbar-brand navbar-brand-logo">
<img src="./man/ohdsi16x16.png" alt="" class="navbar-logo light-content">
<img src="./man/ohdsi16x16.png" alt="" class="navbar-logo dark-content">
<img src="./man/ohdsi16x16.png" alt="" class="navbar-logo">
</a>
<a class="navbar-brand" href="./index.html">
<span class="navbar-title">OMOP Common Data Model</span>
Expand Down Expand Up @@ -540,14 +537,13 @@ <h1 class="title">CDM v3</h1>
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const outerScaffold = trigger.parentElement.cloneNode(true);
const codeEl = outerScaffold.querySelector('code');
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
}
return codeEl.innerText;
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
Expand Down
Loading
Loading