GhostManager / Ghostwriter

The SpecterOps project management and reporting engine
https://ghostwriter.wiki
BSD 3-Clause "New" or "Revised" License
1.23k stars 174 forks source link

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

Closed smcgu closed 3 weeks ago

smcgu commented 1 month ago

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:

After:

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

chrismaddalena commented 1 month ago

I'm for this. Thanks for the submission!

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

smcgu commented 1 month ago

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

chrismaddalena commented 4 weeks ago

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 commented 3 weeks ago

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

chrismaddalena commented 3 weeks ago

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.