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

Select Caption Type for Evidence #478

Open
wexew-ware opened this issue Jul 11, 2024 · 3 comments
Open

Select Caption Type for Evidence #478

wexew-ware opened this issue Jul 11, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@wexew-ware
Copy link

Currently when attaching evidence the caption used is always the "Figure" caption even when the evidence used is a table and not an image. Would it be possible to have an option to choose a "Table" Caption and have it use the 'Label Used for Tables' that is set within the Global Report Configuration menu?

Screenshot from 2024-07-10 16-42-51

@chrismaddalena
Copy link
Collaborator

That's something we could do. We'd have to figure out how and where to make that an option.

Ghostwriter uses the figure options because it assumes evidence files are images or text. Are you uploading images of tables? You can insert tables with the WYSIWYG editor, but that doesn't add a caption or table label.

@smcgu
Copy link
Contributor

smcgu commented Jul 23, 2024

We use both evidence images/charts and tables. For tables, we have a "Table Caption" style and it appears above the table. For evidence/images/charts, we use a "Figure Caption" style and the caption appears below the evidence. I have no idea how widespread this arrangement is in the technical writing world, but our technical editor enforces it and some technical writing guides recommend it.

So, we would have:

Some paragraph explaining the situation that provides data in {{.ref my-super-awesome-table}}
with a proof of concept in {{.ref super-awesome-screenshot}}.

{{.caption my-super-awesome-table}}My Table Header That Should Use a Table Caption Style
<some table>
{{super-awesome-screenshot}}

I was thinking that we could create two new Ghostwriter placeholders such as {{.figure}} and {{.table}}, with {{.caption}} being equivalent to {{.figure}} for backwards compatibility. They would be configurable to have their own:

  • Style (but would default to Caption)
  • Title case toggle
  • Title case exceptions

Figures would use the current configuration options and tables would be the new config options; again, to maintain backwards compatibility.

So, from the above example, the change in the WYSIWYG would be minimal:

Some paragraph explaining the situation that provides data in {{.ref my-super-awesome-table}}
with a proof of concept in {{.ref super-awesome-screenshot}}.

{{.table my-super-awesome-table}}My Table Header That Should Use a Table Caption Style
<some table>
{{super-awesome-screenshot}}

And, if you wanted to manually create a figure caption with maybe some code block:

The proof of concept code execution is in {{.ref my-code-block}}.

`
code block
code block
code block
`
{{.figure my-code-block}}This is my POC code block

{{.caption}} could also work for this situation, too.

@smcgu
Copy link
Contributor

smcgu commented Jul 23, 2024

Implementation wise, I was looking to:

  1. Implement the {{.figure}} placeholder that reuses the current {{.caption}} code that creates FIGURE sequence items.
  2. Implement the {{.table}} placeholder that creates TABLE sequence items.
  3. Create/adjust the Django admin panel and database for the distinct config items.
  4. Sanity check the template for the configured styles. I am a bit less clear on how this would work and the template validation code, but it would probably be good to check templates for the styles that are configured.

@github-actions github-actions bot added the stale label Aug 23, 2024
@GhostManager GhostManager deleted a comment from github-actions bot Sep 10, 2024
@chrismaddalena chrismaddalena added enhancement New feature or request help wanted Extra attention is needed labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants