django-pattern-library icon indicating copy to clipboard operation
django-pattern-library copied to clipboard

feat: use pathlib.Path for template paths

Open reedjones opened this issue 11 months ago • 0 comments

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

  • [ x ] My code follows the style guidelines of this project
  • [ x ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes
  • [ ] I have added an appropriate CHANGELOG entry

reedjones avatar Mar 07 '24 18:03 reedjones