Skip to content

Select Caption Type for Evidence #478

Description

@wexew-ware

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

Activity

  1. chrismaddalena commented on Jul 23, 2024

    @chrismaddalena
    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.

  2. smcgu commented on Jul 23, 2024

    @smcgu
    Contributor

    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.

  3. smcgu commented on Jul 23, 2024

    @smcgu
    Contributor

    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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions