Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions on malformed Quarto Attributes #55

Open
loris-intergalactique opened this issue Aug 15, 2024 · 0 comments
Open

Exceptions on malformed Quarto Attributes #55

loris-intergalactique opened this issue Aug 15, 2024 · 0 comments

Comments

@loris-intergalactique
Copy link

Hello,

I started using Entangled.py, thanks a lot for maintaining it! I have tons of project ideas using it.

While setting it up I had issues with these two types of code samples:

#|file:yoo.py

print("hey!")
#|file:yoo.py
#|id:me

print("hey!")

I checked the code and it looks like the strings produced are considered strings by PyYAML and the attrs variable is assumed to be a list in entangled/hooks/quarto_attributes.py. PyYAML behaves correctly if there is a space after the colon.

I might be wrong because I do not know the code base enough to give suggestions, but just in case it can help: I suggest adding a check on the type of attrs and warning the user that their quarto attributes are malformed if it is not a dict. And maybe replace the last condition if "id" in attrs by if "id" in attrs.keys()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant