Skip to content

Commit 6d7a1b9

Browse files
Adding extension for style and functions (#19)
* added new extension and sccs rules * fixed datasets * made esplicit events to keep in pupil processing * rendering
1 parent 5736046 commit 6d7a1b9

81 files changed

Lines changed: 338183 additions & 352546 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTENT/EyeTracking/PupilPreprocessing.qmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Great job making it this far! Fixing the data to make it usable in **Pupillometr
208208
209209
library(PupillometryR) # Library to process pupil signal
210210
library(tidyverse) # Library to wrangle dataframes
211-
library(patchwork)
211+
library(patchwork)
212212
213213
csv_files = list.files(
214214
path = "resources/Pupillometry/RAW",
@@ -232,6 +232,9 @@ Time = seq(from = -Pre_stim, by=Step, length.out = Pre_stim_samples+Post_stim_sa
232232
233233
# Event fixes --------------------------------------------------------------------
234234
235+
# Events to keep
236+
Events_to_keep = c('Circle','Square')
237+
235238
List_of_subject_dataframes = list() # Empty list to be filled with dataframes
236239
237240
# Loop for each subject
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
title: "Cell output styling"
2+
author: "Andrew Heiss"
3+
version: "0.1.0"
4+
quarto-required: ">=1.5.0"
5+
contributes:
6+
filters:
7+
- output-styling.lua
8+
resources:
9+
- output-styling-default.css
10+
- output-styling-minimal.css
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* All kinds of output */
2+
.cell-output.cell-output-stdout, /* Regular output for R and warnings for Julia */
3+
.cell-output.cell-output-display, /* Regular output for Python and Julia and Observable JS */
4+
.cell-output.cell-output-error, /* Errors for R and Python and Julia */
5+
.cell-output.cell-output-stderr { /* Warnings and messages for R and Python */
6+
margin: 0 0 1em;
7+
padding: .4em;
8+
border: 1px solid var(--bs-border-color);
9+
border-radius: .25rem;
10+
}
11+
12+
.cell-output.cell-output-stdout pre,
13+
.cell-output.cell-output-display pre ,
14+
.cell-output.cell-output-error pre,
15+
.cell-output.cell-output-stderr pre {
16+
margin-bottom: 0;
17+
}
18+
19+
/* Errors */
20+
.cell-output.cell-output-error {
21+
background-color: var(--bs-danger-bg-subtle);
22+
background-color: color-mix(in srgb, var(--bs-danger-bg-subtle) 30%, transparent);
23+
border: 1px solid var(--bs-danger-border-subtle);
24+
}
25+
26+
.cell-output.cell-output-error pre {
27+
color: var(--bs-danger-text-emphasis);
28+
}
29+
30+
/* Warnings */
31+
/* R and Python output warnings in stderr; Julia outputs them in stdout */
32+
.cell-output-stderr.cell-output-warning,
33+
.cell-output-stdout.cell-output-warning {
34+
background-color: var(--bs-warning-bg-subtle) !important;
35+
background-color: color-mix(in srgb, var(--bs-warning-bg-subtle) 30%, transparent) !important;
36+
border: 1px solid var(--bs-warning-border-subtle) !important;
37+
}
38+
39+
.cell-output-stderr.cell-output-warning pre,
40+
.cell-output-stdout.cell-output-warning pre {
41+
color: var(--bs-warning-text-emphasis) !important;
42+
}
43+
44+
/* Messages */
45+
.cell-output.cell-output-stderr {
46+
background-color: var(--bs-primary-bg-subtle);
47+
background-color: color-mix(in srgb, var(--bs-primary-bg-subtle) 30%, transparent);
48+
border: 1px solid var(--bs-primary-border-subtle);
49+
}
50+
51+
.cell-output.cell-output-stderr pre {
52+
color: var(--bs-primary-text-emphasis);
53+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* All kinds of output */
2+
.cell-output.cell-output-stdout, /* Regular output for R and warnings for Julia */
3+
.cell-output.cell-output-display, /* Regular output for Python and Julia and Observable JS */
4+
.cell-output.cell-output-error, /* Errors for R and Python and Julia */
5+
.cell-output.cell-output-stderr { /* Warnings and messages for R and Python */
6+
margin: 0 0 1em;
7+
padding: .4em;
8+
border: 1px solid var(--bs-border-color);
9+
border-radius: .25rem;
10+
}
11+
12+
.cell-output.cell-output-stdout pre,
13+
.cell-output.cell-output-display pre ,
14+
.cell-output.cell-output-error pre,
15+
.cell-output.cell-output-stderr pre {
16+
margin-bottom: 0;
17+
}
18+
19+
/* Errors */
20+
.cell-output.cell-output-error {
21+
border: 1px solid var(--bs-danger-border-subtle);
22+
}
23+
24+
.cell-output.cell-output-error pre {
25+
color: var(--bs-danger);
26+
}
27+
28+
/* Warnings */
29+
/* R and Python output warnings in stderr; Julia outputs them in stdout */
30+
.cell-output-stderr.cell-output-warning,
31+
.cell-output-stdout.cell-output-warning {
32+
border: 1px solid var(--bs-warning-border-subtle) !important;
33+
}
34+
35+
.cell-output-stderr.cell-output-warning pre,
36+
.cell-output-stdout.cell-output-warning pre {
37+
color: var(--bs-warning) !important;
38+
}
39+
40+
/* Messages */
41+
.cell-output.cell-output-stderr {
42+
border: 1px solid var(--bs-primary-border-subtle);
43+
}
44+
45+
.cell-output.cell-output-stderr pre {
46+
color: var(--bs-primary);
47+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
function Div(div)
2+
-- Check if this div has warning output classes
3+
-- R/Python warnings: cell-output-stderr
4+
-- Julia warnings: cell-output-stdout
5+
if div.classes:includes('cell-output-stderr') or div.classes:includes('cell-output-stdout') then
6+
-- Check if any CodeBlock or RawBlock in this div contains warning patterns
7+
for _, block in ipairs(div.content) do
8+
local should_add_warning = false
9+
10+
if block.tag == "CodeBlock" then
11+
-- R/Python warnings in CodeBlocks (stderr)
12+
if div.classes:includes('cell-output-stderr') and
13+
string.match(block.text, "^%w*Warning:") then
14+
should_add_warning = true
15+
end
16+
elseif block.tag == "RawBlock" and block.format == "html" then
17+
-- Julia warnings in HTML RawBlocks (stdout)
18+
if div.classes:includes('cell-output-stdout') and
19+
string.match(block.text, "Warning: ") then
20+
should_add_warning = true
21+
end
22+
elseif block.tag == "Div" and block.classes:includes('ansi-escaped-output') then
23+
-- Julia warnings are nested in ansi-escaped-output divs
24+
if div.classes:includes('cell-output-stdout') then
25+
for _, nested_block in ipairs(block.content) do
26+
if nested_block.tag == "RawBlock" and nested_block.format == "html" then
27+
if string.match(nested_block.text, "Warning: ") then
28+
should_add_warning = true
29+
break
30+
end
31+
end
32+
end
33+
end
34+
end
35+
36+
if should_add_warning then
37+
div.classes:insert('cell-output-warning')
38+
break
39+
end
40+
end
41+
end
42+
43+
return div
44+
end
45+
46+
-- Add the CSS file to the document
47+
function Pandoc(doc)
48+
if not (quarto.doc and quarto.doc.is_format and quarto.doc.is_format("html")) then
49+
return doc
50+
end
51+
52+
-- Get value of `appearance` key from YAML fron matter
53+
local appearance_value = "default"
54+
55+
if doc.meta['output-styling'] and doc.meta['output-styling'].appearance then
56+
local raw_appearance = pandoc.utils.stringify(doc.meta['output-styling'].appearance)
57+
58+
-- Possible values here
59+
-- MAYBE: someday add others?
60+
local valid_appearances = {default = true, minimal = true, custom = true}
61+
62+
if valid_appearances[raw_appearance] then
63+
appearance_value = raw_appearance
64+
else
65+
quarto.log.warning(
66+
"Invalid value for `appearance` '" .. raw_appearance ..
67+
"'. Using 'default'. Valid options are: `default`, `minimal`, or `custom`"
68+
)
69+
end
70+
end
71+
72+
-- Include CSS file only if not custom
73+
if appearance_value ~= "custom" then
74+
local css_file = "output-styling-" .. appearance_value .. ".css"
75+
76+
quarto.doc.add_html_dependency({
77+
name = 'output-styling',
78+
stylesheets = {css_file}
79+
})
80+
end
81+
82+
return doc
83+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: custom-callout
2+
author: James Joseph Balamuta
3+
version: 0.0.1-dev.2
4+
quarto-required: ">=1.5.0"
5+
contributes:
6+
filters:
7+
- customcallout.lua
8+
- fa.lua
9+

0 commit comments

Comments
 (0)