snehilvj / dmc-docs

Documentation for Dash Mantine Components library.
https://github.com/snehilvj/dash-mantine-components
MIT License
58 stars 19 forks source link

Updated lib/directives.py to fix Windows error. #15

Closed tringuy1993 closed 2 years ago

tringuy1993 commented 2 years ago

Windows gives error due to the following function in directives.py:

def create_prism(file):
    source = Path(file).read_text()
    source = source.replace("component = ", "", 1)
    return dmc.Prism(source, language="python")

Adding encoding='utf-8' solves the error for Windows user:

def create_prism(file):
    source = Path(file).read_text(encoding='utf-8')
    source = source.replace("component = ", "", 1)
    return dmc.Prism(source, language="python")
snehilvj commented 2 years ago

This PR should only have 1 file: directives.py.