Skip to content

Commit 6c461ce

Browse files
committed
chemin absolu
1 parent 0694878 commit 6c461ce

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

build/colab/callout_colab.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,17 @@ def create_python_snippet(title, content, callout_type):
1616
Returns:
1717
str: A styled HTML snippet.
1818
"""
19+
20+
css_file_path = "./build/colab/colab.css"
21+
if not os.path.exists(css_file_path):
22+
raise FileNotFoundError(f"{css_file_path} not found. Please ensure the file exists.")
23+
24+
with open(css_file_path, "r") as css_file:
25+
style = css_file.read()
26+
1927
style = """
2028
<style>
21-
.callout {
22-
border: 2px solid #d1d5db;
23-
border-radius: 8px;
24-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
25-
margin-bottom: 20px;
26-
background-color: #ffffff;
27-
padding: 15px;
28-
}
29-
.callout-header {
30-
font-weight: bold;
31-
margin-bottom: 10px;
32-
color: #ffffff;
33-
background-color: #1d4ed8;
34-
padding: 10px;
35-
border-radius: 6px 6px 0 0;
36-
}
37-
.callout-body {
38-
margin: 10px 0;
39-
}
29+
{style}
4030
</style>
4131
"""
4232

@@ -121,7 +111,7 @@ def process_file(input_file_path, regex_pattern, output_file_path=None):
121111
# Check if the input file exists
122112
if not os.path.exists(input_file_path):
123113
logger.error(f"Input file does not exist: {input_file_path}")
124-
exit(1)
114+
return None
125115

126116
# Read the content of the input file
127117
logger.info(f"Reading content from {input_file_path}")

build/colab/colab.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.callout {
2+
border: 2px solid #d1d5db;
3+
border-radius: 8px;
4+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
5+
margin-bottom: 20px;
6+
background-color: #ffffff;
7+
padding: 15px;
8+
}
9+
.callout-header {
10+
font-weight: bold;
11+
margin-bottom: 10px;
12+
color: #ffffff;
13+
background-color: #1d4ed8;
14+
padding: 10px;
15+
border-radius: 6px 6px 0 0;
16+
}
17+
.callout-body {
18+
margin: 10px 0;
19+
}

build/colab/tweak_quarto_project.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ def list_render_files(file_path):
4242
yaml_content = read_quarto_yaml(file_path)
4343

4444
if not yaml_content:
45-
logger.warning("No content to process.")
46-
raise ValueError
45+
raise FileNotFoundError("No content to process.")
4746

4847
files = yaml_content.get("project").get("render")
4948

0 commit comments

Comments
 (0)