module utils, add article wololo

This commit is contained in:
Tykayn 2025-02-28 16:37:59 +01:00 committed by tykayn
parent 3b9061514f
commit 3bf5856bab
12 changed files with 307 additions and 85 deletions

24
utils/maker.py Normal file
View file

@ -0,0 +1,24 @@
# génère le contenu d'un nouvel article avec les propriétés spécifiées en config.
def make_article(config):
"""
Génère le contenu d'un nouvel article org-mode
"""
template = f"""#+TITLE: {config['title']}
#+DATE: {config['date_string_full']}
#+AUTHOR:
#+EMAIL:
#+LANGUAGE: {config['lang'] if 'lang' in config else 'fr'}
#+OPTIONS: toc:nil num:nil
#+STARTUP: showall
#+PERMALINK: {config['schema_slug']}
#+ID: {config['uuid']}
* Article
:PROPERTIES:
:ID: {config['uuid']}
:END:
** {config['title']}
"""
return template