Skip to content

Commit 74063e5

Browse files
committed
Set today as default target date on md output format
1 parent c8bdd45 commit 74063e5

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

sfs_processor.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,21 @@ def make_document(data: Dict[str, Any], output_dir: Path, output_modes: List[str
7777
target_date: Optional target date (YYYY-MM-DD) for temporal title processing
7878
"""
7979

80+
# Default to markdown output if no modes specified
81+
if output_modes is None:
82+
output_modes = ["md"]
83+
84+
# Set default target_date to today for md format only
85+
if target_date is None and 'md' in output_modes:
86+
target_date = datetime.now().strftime('%Y-%m-%d')
87+
print(f"Varning: Använder dagens datum ({target_date}) som target_date för 'md' som output format")
88+
8089
# Apply temporal title processing if target_date is provided
8190
if target_date and data.get('rubrik'):
8291
rubrik_after_temporal = title_temporal(data['rubrik'], target_date)
8392
# Create a copy of data with the processed title
8493
data = data.copy()
8594
data['rubrik_after_temporal'] = rubrik_after_temporal
86-
87-
# Default to markdown output if no modes specified
88-
if output_modes is None:
89-
output_modes = ["md"]
9095

9196
# Git mode requires markdown mode to be active
9297
if "git" in output_modes and "md" not in output_modes:

0 commit comments

Comments
 (0)