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

Render reports with styled notes containing subscript and strikethrough #1762

Open
wants to merge 2 commits into
base: maintenance/gramps52
Choose a base branch
from

Commits on Oct 16, 2024

  1. Render reports with styled notes containing subscript and strikethrough

    Fixes #13417
    
    With this change all reports should be able to render styled notes using subscript or strikethrough without throwing exceptions.
    
    1. Add support for subscript and strikethough in DocBackend.
    2. Implement support for subscript and strikethrough in:
       a. CairoBackend
       b. LatexBackend
          i. Use package ulem for strikethrough support. ulem overrides rendering of emphasis, so specify normalel option to maintain the default.
         ii. A bug in str_inc was being triggered during my testing. I used AI to fix the code and it seems to work. I haven't investigated whether this will change anything, but the code seems to work. Looking for review on the code change, ways to test, or other comments
       c. HTMLBackend
       d. ODFBackend
          i. Add two new styles GSub and GStrikethrough to support subscript and strikethrough formatting, and implemented the two in odfdoc.py
    
    Testing
    1. Create a note that includes subscript and strikethrough, and attach to a person
    2. Run any report which would include that note. Example: Complete Individual Report for that person
    3. Render report in all formats and verify that (1) no exceptions are thrown and (2) output is rendered appropriately for the format. For Text and RTF, these styles will not have any effect, other formats including PDF, HTML, LaTeX, ODT, PS you will see the style applied.
    
    Todo
    1. Add methods similar to start[end]_superscript for subscript and strikethrough in each of the Doc classes so that plugins and addons can use the same functionality. For compatibility, this should be introduced in 5.3 so plugins can specify the version required.
    2. Add similar API for italics (emphasize) since no API is available for that today. See thread on discourse: https://gramps.discourse.group/t/reports-normal-italic-and-bold-within-a-paragraph/5106/5
    hgohel committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    6438ded View commit details
    Browse the repository at this point in the history
  2. Revert AI generated code explicitly disallowed by contribution rules.

    Code fix to str_incr() which was generated by AI has been reverted as this is explicitly disallowed by Gramps contribution rules.
    hgohel committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    c2afea9 View commit details
    Browse the repository at this point in the history