Skip to content

peakrdl html passes title=None, preventing fallback to top node name #63

@alexfarell-eng

Description

@alexfarell-eng

Description

The peakrdl html CLI appears to treat --title as effectively required, even though the exporter API and docs describe it as an override.

HTMLExporter.export() documents title as an optional override, and when title is omitted it falls back to the top node's name property. However, the CLI plugin defines --title with a default of None and always forwards title=options.title into html.export(...). That means the exporter receives an explicit None instead of having the kwarg omitted, so the fallback never triggers.

Current behavior

When peakrdl html is run without --title, generated output shows None in places where a derived title is expected.

For example, the generated HTML can show:

  • page title: None
  • navigation/sidebar title: None

Expected behavior

If --title is not provided, the CLI should not force title=None into the exporter. The exporter should be allowed to use its normal fallback based on the top node name.

In other words, --title should behave as an override, not as a de facto requirement.

Suggested fix

Only pass title=... to HTMLExporter.export() when options.title is not None.

Pseudo-patch:

kwargs = {"home_url": options.home_url}
if options.title is not None:
    kwargs["title"] = options.title

html.export(top_node, options.output, **kwargs)

Notes

The PyPI/repo docs describe title as "Override title text", which also suggests it is intended to be optional rather than mandatory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions