from shiny import ui
# https://icons.getbootstrap.com/icons/question-circle-fill/
def question_circle_fill() -> str:
ui.HTML(
''
)
def background_img(url: str, opacity: float) -> str:
"""
Generate CSS style for setting a somewhat transparent background image.
Parameters
----------
url : str
URL of the image to be used as a background.
opacity : float
Opacity level of the background image (0.0 to 1.0).
Returns
-------
str
A CSS style string to set the somewhat transparent background image.
"""
return f"""
"""
def read_markdown_file(path):
with open(path, 'r') as file:
lines = file.readlines()
# Find the start and end of the YAML header
yaml_delimiters = [i for i, line in enumerate(lines) if line.strip() == '---']
# Skip the YAML header if it exists (assuming there are two delimiters)
if len(yaml_delimiters) == 2:
content_start = yaml_delimiters[1] + 1
return ''.join(lines[content_start:])
else:
# No YAML header found, return the entire content
return ''.join(lines)