Skip to content

Template formatting: rendering revision (part 1) #213

Closed
@kalbfled

Description

@kalbfled

User Story - Business Need

This is a ticket to implement a subset of markdown conversion according to a specification developed via previous tickets.

User Story(ies)

As a Notify stakeholder,
I want to translate markdown to HTML or plain text according to a specification
So that future changes to the code don't cause undetected regressions.

Additional Info and Resources

Work for #198 and #199 codified a specification for rendering markdown templates as HTML and plain text. Skipped unit tests exist in tests/test_template2.py. Unskip a subset of those tests for markdown files listed below, and implement the code needed to make those tests pass!

Much of the code in formatters.py for the custom Mistune markdown renderers should be reused, but the new code should not apply any CSS to markdown. (#215 addresses CSS.) If the output of Mistune yields minor changes in spacing compared to the output expected by the tests, it might be permissible to change the expected output. Use good judgement.

Acceptance Criteria

The objective of this ticket is to make the test tests/test_template2.py::test_render_notify_markdown pass for these markdown file inputs:

  • headers.md
  • emphasis.md
  • images.md
  • tables.md
  • thematic_break.md

Other criteria:

  • No modifications to pre-existing files other than tests/test_template2.py and possibly files in tests/test_files/
  • tests related to the above .md files are passing.
  • This work is added to the sprint review slide deck (key win bullet point and demo slide)
  • Created Template formatting: rendering revision (part 2) #234 to continue this work with other markdown inputs

Future tickets should address the remaining markdown file inputs.

QA Considerations

This work cannot be QAed effectively until it is integrated into notification-api. We are relying on unit tests for now.

Out of Scope

Do not make any changes in notification-api for this ticket. The end result of this ticket should be an implementation for markdown conversion that exists in parallel to the existing implementation in template.py and formatters.py. Future tickets will modify notification-api to use the new implementation.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions