torchbox / django-pattern-library

UI pattern libraries for Django templates
https://torchbox.github.io/django-pattern-library/
BSD 3-Clause "New" or "Revised" License
360 stars 44 forks source link

feat: use pathlib.Path for template paths #244

Open reedjones opened 6 months ago

reedjones commented 6 months ago

Description

note (haven't tested yet will do asap) This commit modifies utils.py to use pathlib.Path for template paths. This ensures that the paths are handled consistently across different operating systems, including Windows. The following functions have been modified to use pathlib.Path: path_to_section() section_for() get_template_dirs() get_pattern_config_str() get_pattern_markdown() Additionally, the TemplateRenderer.get_pattern_templates() method has been updated to use pathlib.Path for template paths.

Fixes #116 possibly related issue: https://github.com/torchbox/django-pattern-library/issues/116

Checklist