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

Refactoring of the MD and HTLM helper #660

Closed
19 tasks done
BioPhoton opened this issue Apr 30, 2024 · 0 comments
Closed
19 tasks done

Refactoring of the MD and HTLM helper #660

BioPhoton opened this issue Apr 30, 2024 · 0 comments
Labels
➕ enhancement new feature or request 🧩 utils 🤓 UX UX improvement for CLI users

Comments

@BioPhoton
Copy link
Collaborator

BioPhoton commented Apr 30, 2024

User story

As a developer of the CLI and of custom plugins I don't want to care to much about edge cases in MD and HTML reports.
At the moment there are slight inconsistencies in the code that I have to know as CLI developer and as plugin developer I have to care about 3rd party information and treat edge cases like considering new lines after code blocks etc.

Acceptance criteria

The utils package should restructure the folders containing MD and HTML formats.

  • the 2 formats should live in the root of utils in folders called html and md
utils/
|-- src/
    |-- lib/
        |-- md/
        |-- html/
  • remove constants like SPACE, TAB or NEW_LINE and place the characters directly
  • as some helpers are named the same (e.g. fontStyle) we should think about exporting the 2 formats in a way that does not cause duplicated exports
  • all produces content form helpers should be formatted readable
  • #635
  • The italics and code formatting can be in Markdown now we no longer have HTML tables.

The utils package should provide all needed MD elements as helper including good defaults:

  • fontStyle - **{content}**
  • heading - # H1\n
  • lines - {content}\n{content}\n
    • the lines helper should autodetect existing new lines and add a maximum of 1 new lines to the contents
  • paragraph - {content}\n\n
    • the paragraph helper should autodetect existing new lines and add a maximum of 2 new lines to the contents
  • paragraphs - {content}\n\n{content}\n\n
    • the paragraphs helper should autodetect existing new lines and add a maximum of 2 new lines to the contents
  • table | Heading 1|......\n\n
    • the table helper is typed with the table model maintained in models
    • the table helper ends on 2 new lines to have the MD content rendered correctly

The utils package should provide all needed MD elements as helper including good defaults:

  • fontStyle - <b>{content}</b>
  • table <table></table>\n\n
  • details - <details>\n<summary>{summary}<summary>\n{content}\n<details>
    • it should automatically consider a second new line if the content ends with a code block "```"

Implementation details

No response

@BioPhoton BioPhoton added ➕ enhancement new feature or request 🤓 UX UX improvement for CLI users 🧩 utils labels Apr 30, 2024
@BioPhoton BioPhoton changed the title Refactoring of the MD and HRLM helper Refactoring of the MD and HTLM helper Apr 30, 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 🧩 utils 🤓 UX UX improvement for CLI users
Projects
None yet
Development

No branches or pull requests

1 participant