Skip to content

bug: New lines removed in an attribute signature #275

@webdjoe

Description

@webdjoe

Thank you for the great library! I am currently building a documentation site using the separate_signature: true option and it keeps the formatting and new lines for all attributes and methods except one single attribute. I tried to reformat the code and remove and add items back but it still removes the new lines. The strange thing is it keeps the formatting on attributes with the same structure in the same module. Do you have any idea what might be going on? Could it be an object not being resolved?

Image

To Reproduce

I haven't pushed the update yet, but here is my markdown:

# Device Map Configuration

::: pyvesync.device_map
    options:
      show_root_heading: true
      force_inspection: true
       show_submodules: true
       show_signature_annotations: true
       signature_crossrefs: true
       separate_signature: true

Here is the code that is not working:

humidifier_modules = [
    HumidifierMap(
        class_name="VeSyncHumid200300S",
        dev_types=[
            "Classic300S",
            "LUH-A601S-WUSB",
            "LUH-A601S-AUSW",
        ],
        features=[HumidifierFeatures.NIGHTLIGHT],
        mist_modes={
            HumidifierModes.AUTO: "auto",
            HumidifierModes.SLEEP: "sleep",
            HumidifierModes.MANUAL: "manual",
        },
        mist_levels=list(range(1, 10)),
        device_alias="Classic 300S",
        model_display="LUH-A601S Series",
        model_name="Classic 300S",
        setup_entry="Classic300S",
    ),
]

Here is an example of the list that is working:

outlet_modules = [
    OutletMap(
        dev_types=["wifi-switch-1.3"],
        class_name="VeSyncOutlet7A",
        features=[OutletFeatures.ENERGY_MONITOR],
        model_name="WiFi Outlet US/CA",
        model_display="ESW01-USA Series",
        setup_entry="wifi-switch-1.3",
    ),
    # OutletMap(
    #     dev_types=["ESW10-USA"],
    #     class_name="VeSyncOutlet10A",
    #     features=[OutletFeatures.ENERGY_MONITOR],
    #     model_name="10A WiFi Outlet USA",
    #     model_display="ESW10-USA Series",
    #     setup_entry="ESW03-USA",
    # ),
    OutletMap(
        dev_types=["ESW01-EU"],
        class_name="VeSyncOutlet10A",
        features=[OutletFeatures.ENERGY_MONITOR],
        model_name="10A WiFi Outlet Europe",
        model_display="ESW01-EU",
        setup_entry="ESW01-EU",
    ),
    OutletMap(
        dev_types=["ESW15-USA"],
        class_name="VeSyncOutlet15A",
        features=[OutletFeatures.ENERGY_MONITOR, OutletFeatures.NIGHTLIGHT],
        nightlight_modes=[NightlightModes.ON, NightlightModes.OFF, NightlightModes.AUTO],
        model_name="15A WiFi Outlet US/CA",
        model_display="ESW15-USA Series",
        setup_entry="ESW15-USA",
    ),
    OutletMap(
        dev_types=["ESO15-TB"],
        class_name="VeSyncOutdoorPlug",
        features=[OutletFeatures.ENERGY_MONITOR],
        model_name="Outdoor Plug",
        model_display="ESO15-TB Series",
        setup_entry="ESO15-TB",
    ),
    OutletMap(
        dev_types=["BSDOG01"],
        class_name="VeSyncOutletBSDGO1",
        features=[OutletFeatures.ONOFF],
        model_name="Smart Plug",
        model_display="Smart Plug Series",
        setup_entry="BSDOG01",
        device_alias="Greensun Smart Plug",
    ),
]

Full traceback

I can post if necessary but I read through the logs using -v but there was no error or lines showing that there was an issue loading the page.

Expected behavior

Environment information

- __System__: Windows-11-10.0.26100-SP0
- __Python__: cpython 3.12.8 (D:\Develop\pyvesync\.venv\Scripts\python.exe)
- __Environment variables__:
  - `PYTHONPATH`: `D:\Develop\pyvesync/src`
- __Installed packages__:
  - `mkdocstrings-python` v1.16.10

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions