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

Remove hard-coded, preceding space of figure caption prefix #446

Closed
wants to merge 2 commits into from

Conversation

smcgu
Copy link
Contributor

@smcgu smcgu commented May 29, 2024

Description of the Change

Removed the hard-coded space that precedes the figure caption prefix to permit captions similar to Table captions, such as Figure N. Xyz....

The relevant change is on line 56, self.prefix_figure = f"{prefix_figure} ". All other changes were formatting to pass black and flake8 checks.

Before:

  • prefix = "."
  • figure_prefix = " {prefix} "
  • {figure_label} N{figure_prefix} -> "Figure N . "

After:

  • prefix = "."
  • figure_prefix = "{prefix} "
  • {figure_label} N{figure_prefix} -> "Figure N. "

Alternate Designs

There were no other methods observed to prevent the preceding space that would allow for Figure N. Xyz....

It might be beneficial in the long-term to remove the hard-coded space after the prefix, too, to provide the most flexibility for Ghostwriter admins and users.

Possible Drawbacks

This will require current users that expect the preceding, hard-coded space to change their figure prefix from "-" to " -" if they need the spacing. Or, perhaps, this PR should be accompanied by a modification to add a space to the current figure prefix. I'll look into that.

Re-configuring the install defaults from "-" to " -" may be desired, too.

Verification Process

  1. Built Ghostwriter instance with the change.
  2. Generated report and confirmed that space was removed in Figure caption.

I'll follow up with tests and needed changes whenever I can get Docker and Ghostwriter functional on my development system.

Release Notes

  • Removed hard-coded preceding space from Figure caption prefix to permit captions similar to Tables.

@smcgu smcgu changed the title Remove hard-code, preceding space of figure caption prefix Remove hard-coded, preceding space of figure caption prefix May 29, 2024
@chrismaddalena
Copy link
Collaborator

I'm for this. Thanks for the submission!

Both spaces should be removed for consistency and to avoid any confusion.

@smcgu
Copy link
Contributor Author

smcgu commented May 30, 2024

Awesome. I'll work on this shortly. Putting together some other PRs.

@chrismaddalena
Copy link
Collaborator

If you'd like to target this PR to merge into the 4-1-dev branch, we can merge it for this upcoming release. Otherwise, since the changes are quick, I can make the adjustments and credit you.

@smcgu
Copy link
Contributor Author

smcgu commented Jun 10, 2024

I'll put this together this upcoming week of June 10th.

@chrismaddalena
Copy link
Collaborator

No problem, @smcgu! We were getting this release completed, so I made the necessary additions in the release. Thanks for the submission! Your changes are live in v4.2.

@smcgu smcgu deleted the modify-figure-caption-prefix branch July 14, 2024 22:55
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

Successfully merging this pull request may close these issues.

2 participants