Page MenuHomeDevCentral

Output report in HTML and Markdown
ClosedPublic

Authored by DorianWinty on Feb 8 2022, 22:45.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 27, 22:57
Unknown Object (File)
Fri, Dec 27, 15:25
Unknown Object (File)
Fri, Dec 27, 14:54
Unknown Object (File)
Fri, Dec 27, 12:23
Unknown Object (File)
Thu, Dec 26, 19:40
Unknown Object (File)
Sun, Dec 22, 13:39
Unknown Object (File)
Sun, Dec 22, 06:55
Unknown Object (File)
Sat, Dec 21, 12:31
Subscribers

Details

Summary

HTML implementation notes

HTML is more useful as a fragment than as full page,
to be able to be included in a regular application.

An entry can be divided as several paragraphs,
as it could represent several ideas.

Ref T1678

Test Plan

Unit tests for a regular report are provided.

Only missing some cases if the rapport, or a part of it like properties, is empty.

Diff Detail

Repository
rKREPORT Keruald Report
Lint
Lint Skipped
Unit
Tests Skipped
Branch
repport_show
Build Status
Buildable 3900
Build 4151: arc lint + arc unit

Event Timeline

DorianWinty created this revision.
DorianWinty retitled this revision from making the HTMLOutput and MarkdownOuput work to Make the HTMLOutput and MarkdownOuput work.Feb 8 2022, 22:49
dereckson edited the test plan for this revision. (Show Details)
dereckson retitled this revision from Make the HTMLOutput and MarkdownOuput work to Output report in HTML and Markdown.
dereckson edited the test plan for this revision. (Show Details)
dereckson edited the summary of this revision. (Show Details)
dereckson added inline comments.
src/Output/MarkdownOutput.php
15

Probably best to keep the same syntax everywhere.

28

Should express the idea is the maximal length, not the properties count.

What about something like $propertyMaxLength?

36

To avoid such a long line, we can split it by column:

$send[] = '| Property' . str_repeat(' ', $maxProp - 8)
        .' | ' . str_repeat(' ', $maxValue) . ' |';
src/Output/HTMLOutput.php
7

Method names use camel case e.g. makeId

DorianWinty marked 4 inline comments as done.

camel case for makeId

modify the syntax for the $send[] and make the same everywere
to improve the readability

Need to be rebased against D2503.

I can help rebasing if you push it with git branch -m report_show && git push origin report_show (let's avoid repport).

This revision is now accepted and ready to land.Feb 14 2022, 21:17

avoiding problem with html in report

src/Output/HTMLOutput.php
12

Ah yes thanks to thing about those ones too!

Encoding for URL parts is different: you can use https://www.php.net/manual/en/function.urlencode.php

For example we need to escape # ? & / but we don't need to escape <>

25

Encoded twice, once here, once afterwards.

As the URL part should be encoded with urlencode() we can just discard that one

DorianWinty marked 2 inline comments as done.

modify from informations in comments

removing self::encode how are repeted

src/Output/MarkdownOutput.php
35

Ah by the way, you've min() and max() in a lot of languages: $propertyMaxLength = min($propertyMaxLength, 8);

This revision was automatically updated to reflect the committed changes.