You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm facing challenges understanding the usage of processor. I have a list of tuples named error_description in my Obsidian double-links, which I'd like to keep unaltered during the Obsidian-to-Hugo conversion. I am attempting to use processors to replace [[error_description]] with (error_description) during this process.
However, I've noticed that the code seems to go directly to the else block, printing Debug: No match for [[error_description]]). I confirmed that [[error_description]] does indeed exist in the original text. Below is the snippet of code in question:
defprocess_file(file_contents: str) ->str:
processed_contents=file_contentsprint(f"Debug: error_descriptions = {error_descriptions}")
forerror_descriptioninerror_descriptions:
search_str=f'[[error_description]])'print(f"Debug: Looking for {search_str}")
ifsearch_strinprocessed_contents:
print(f"Debug: Replacing {search_str}")
processed_contents=processed_contents.replace(search_str, f'({error_description})')
else:
print(f"Debug: No match for {search_str}")
print(f"Debug: Final file contents: {processed_contents[:100]}") # Output the first 100 chars after modification# Build and Run ObsidianToHugoobsidian_to_hugo=ObsidianToHugo(
obsidian_vault_dir=obsidian_vault_dir_path,
hugo_content_dir=hugo_content_dir_path,
processors=[process_file],
)
obsidian_to_hugo.run()
The text was updated successfully, but these errors were encountered:
Hello, I'm facing challenges understanding the usage of
processor
. I have a list of tuples namederror_description
in my Obsidian double-links, which I'd like to keep unaltered during the Obsidian-to-Hugo conversion. I am attempting to useprocessors
to replace[[error_description]]
with(error_description)
during this process.However, I've noticed that the code seems to go directly to the
else
block, printingDebug: No match for [[error_description]])
. I confirmed that[[error_description]]
does indeed exist in the original text. Below is the snippet of code in question:The text was updated successfully, but these errors were encountered: