fastai / nbdev

Create delightful software with Jupyter Notebooks
https://nbdev.fast.ai/
Apache License 2.0
4.8k stars 484 forks source link

Enum renders kind of weird #1377

Open kevinbird15 opened 8 months ago

kevinbird15 commented 8 months ago

Provide a minimally reproducible example

#| export
from enum import Enum

#| export
class Role(Enum):
    SYSTEM = "system"
    USER = "user"
    ASSISTANT = "assistant"
    FUNCTION = "function"

creates the following doc: image

kevinbird15 commented 8 months ago

The first question here is what should an Enum like this look like in the docs? I think even just showing the mappings would be a good starting point. So


Role

System = "system" USER = "user" ASSISTANT = "assistant" FUNCTION = "function"

Maybe a comment down here?


Definitely interested to hear other ideas of what format would be useful/expected in this case though as well