Skip to content

Documentation of AnchoredText's prop keyword argument is misleading #12467

Closed

Description

@galenlynch

This bug is nearly identical to #12121, but affects AnchoredText instead of TextArea.

The documentation for AnchoredText strongly suggests that the keyword argument prop should be a FontProperties object. However, inspecting the source code suggests that prop should instead be a dictionary of keyword arguments that will be passed to the TextArea object inside of AnchoredText.

I propose rewording the documentation to make it clear that prop should be a dictionary of keyword arguments to construct the TextArea instance.

Perhaps it would be worthwhile to look over the documentation of other classes in offsetbox for similar issues, since this is the second time I've come across the same issue.

Activity

  1. changed the title [-]Documentation of AnchoredText's props keyword argument is misleading[/-] [+]Documentation of AnchoredText's prop keyword argument is misleading[/+] on Oct 9, 2018
  2. ImportanceOfBeingErnest commented on Oct 9, 2018

    @ImportanceOfBeingErnest
    Member

    Sure, judging from #12434 you already know how that would be fixed. So if you have the time, just go ahead (no need to open a new issue for each item you find).

  3. galenlynch commented on Oct 9, 2018

    @galenlynch
    ContributorAuthor

    Maybe I should make another issue for this, but it would be nice if TextArea and AnchoredText had a consistent API, maybe by renaming the prop argument of AnchoredText to be fontprops as is used by TextArea, which has the added benefit of being more descriptive.

    It seems like it would be fairly easy to also support the old keyword, to prevent breaking people's code.

    What's the attitude around here to such API changes? All things considered, it's a very minor complaint.

  4. added a commit that references this issue on Oct 9, 2018
    45f7d5d
  5. added this to the v3.0.0-doc milestone on Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions