Skip to content

Commit

Permalink
Formatage
Browse files Browse the repository at this point in the history
Utiliser les guillemets doubles systématiquement
  • Loading branch information
slivering committed Nov 14, 2024
1 parent 04444f6 commit 9f94a32
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
dir_util = setuptools.distutils.dir_util


MAIN_SITE_URL = 'https://piaf-saclay.org'
BLOG_URL = 'https://blog.piaf-saclay.org'
YOUTUBE_CHANNEL = 'https://www.youtube.com/@GROUPE-PIAF'
GITHUB_PAGE = 'https://github.com/ai-safety-saclay'
DISCORD_SERVER = 'https://discord.gg/pWRjGuP4nE'
MAIN_SITE_URL = "https://piaf-saclay.org"
BLOG_URL = "https://blog.piaf-saclay.org"
YOUTUBE_CHANNEL = "https://www.youtube.com/@GROUPE-PIAF"
GITHUB_PAGE = "https://github.com/ai-safety-saclay"
DISCORD_SERVER = "https://discord.gg/pWRjGuP4nE"

KEYWORDS = 'IA, intelligence artificielle, fiable, association, école, étudiant, ingénieur, Saclay, conférence, Asimov, hackathon, recherche, numérique, dangers, sécurité, fiabilité, robustesse, sûreté, confiance, alignement, contrôle'
DESCRIPTION = 'Le PIAF est une association qui réunit des étudiants du plateau de Saclay autour de l\'intelligence artificielle fiable. Groupe de lecture, conférences, hackathons, et bien d\'autres projets.'
KEYWORDS = "IA, intelligence artificielle, fiable, association, école, étudiant, ingénieur, Saclay, conférence, Asimov, hackathon, recherche, numérique, dangers, sécurité, fiabilité, robustesse, sûreté, confiance, alignement, contrôle"
DESCRIPTION = "Le PIAF est une association qui réunit des étudiants du plateau de Saclay autour de l'intelligence artificielle fiable. Groupe de lecture, conférences, hackathons, et bien d'autres projets."

GLOBALS = {
"MAIN_SITE_URL": MAIN_SITE_URL,
Expand All @@ -36,11 +36,11 @@


def read_yml(path: str) -> dict:
with open(path, 'r') as f:
with open(path, "r") as f:
return yaml.safe_load(f)

def write_html(path: str, template):
with open(f"build/{path}", 'w') as f:
with open(f"build/{path}", "w") as f:
f.write(template.render())

def generate_home():
Expand All @@ -49,7 +49,7 @@ def generate_home():

template = env.get_template("home.html", globals={"page": page, "title": title})

write_html('index.html', template)
write_html("index.html", template)


def generate_page(title, template_path, **globals):
Expand All @@ -63,31 +63,31 @@ def generate_page(title, template_path, **globals):


ASIMOV_VIDEO_IDS = [
'd9tjp4-xJG4?start=2461', # Alexei Grinbaum
'dp5Yga_WKng?start=337', # Asma Mhalla
'c-MQPOoM6-E?start=2493', # Fabrice Epelboin
'FhFxlZzptys?start=1318', # David Chavalarias
'CoX5OZIbGl4?start=187', # Maxime Fournes
'ofs-9_yzcvY?start=449', # Alain Damasio
'LZWr5OZyBWE?start=849', # Raja Chatila
'sPyu_dTSma0?start=509', # Caroline Jeanmaire
"d9tjp4-xJG4?start=2461", # Alexei Grinbaum
"dp5Yga_WKng?start=337", # Asma Mhalla
"c-MQPOoM6-E?start=2493", # Fabrice Epelboin
"FhFxlZzptys?start=1318", # David Chavalarias
"CoX5OZIbGl4?start=187", # Maxime Fournes
"ofs-9_yzcvY?start=449", # Alain Damasio
"LZWr5OZyBWE?start=849", # Raja Chatila
"sPyu_dTSma0?start=509", # Caroline Jeanmaire
]

md_configs = {
'mdx_wikilink_plus': {
"mdx_wikilink_plus": {
"url_whitespace": "%20",
},
"mdx_math": {
"enable_dollar_delimiter": True
}
}

md = Markdown(extensions=['mdx_math', 'fenced_code', 'tables', 'full_yaml_metadata', 'mdx_wikilink_plus', 'markdown_gfm_admonition', 'nl2br'], extension_configs=md_configs)
md = Markdown(extensions=["mdx_math", "fenced_code", "tables", "full_yaml_metadata", "mdx_wikilink_plus", "markdown_gfm_admonition", "nl2br"], extension_configs=md_configs)

def generate_blog():
for filename in os.listdir("blog"):
if filename.endswith(".md"):
with open("blog/"+filename, 'r') as f:
with open("blog/"+filename, "r") as f:
text_content = f.read()
#content = Markup(md.convert(text_content))
content = md.convert(text_content)
Expand All @@ -104,37 +104,37 @@ def generate_blog():



if __name__ == '__main__':
# if 'build' folder does not exist, create it, copy content of 'static' folder to it
if __name__ == "__main__":
# if "build" folder does not exist, create it, copy content of "static" folder to it
# and generate html

# if build folder exists, delete it
if os.path.exists('./build'):
dir_util.remove_tree('./build')
if os.path.exists("./build"):
dir_util.remove_tree("./build")

if not os.path.exists('./bootstrap'):
if not os.path.exists("./bootstrap"):
Repo.clone_from(
'https://github.com/twbs/bootstrap',
'bootstrap',
multi_options=['--depth=1', '--branch=v5.3.3'],
"https://github.com/twbs/bootstrap",
"bootstrap",
multi_options=["--depth=1", "--branch=v5.3.3"],
)
Repo.clone_from(
'https://github.com/twbs/icons',
'bootstrap-icons',
multi_options=['--depth=1', '--branch=v1.11.3'],
"https://github.com/twbs/icons",
"bootstrap-icons",
multi_options=["--depth=1", "--branch=v1.11.3"],
)

dir_util.copy_tree('./static', './build')
dir_util.copy_tree("./static", "./build")
dir_util.copy_tree("blog/documents", "build/blog")

sass.compile(dirname=('scss', 'build'))
sass.compile(dirname=("scss", "build"))

dir_util.copy_tree('./bootstrap-icons/font/fonts', './build/fonts')
dir_util.copy_tree("./bootstrap-icons/font/fonts", "./build/fonts")

generate_home()
generate_page("Asimov : les dangers du numérique", "asimov.html", video_ids=ASIMOV_VIDEO_IDS)

lectures = reversed(read_yml('lectures.yml'))
lectures = reversed(read_yml("lectures.yml"))
generate_page("Notre groupe de lecture", "groupe-de-lecture.html", lectures=lectures)

generate_page("Politique de confidentialité", "confidentialite.md")
Expand Down

0 comments on commit 9f94a32

Please sign in to comment.