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)
Wed, Mar 27, 09:26
Unknown Object (File)
Wed, Mar 27, 07:35
Unknown Object (File)
Wed, Mar 27, 07:09
Unknown Object (File)
Wed, Mar 27, 07:09
Unknown Object (File)
Wed, Mar 27, 06:51
Unknown Object (File)
Wed, Mar 27, 06:51
Unknown Object (File)
Wed, Mar 27, 06:50
Unknown Object (File)
Wed, Mar 27, 05:27
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 Not Applicable
Unit
Tests Not Applicable

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
16

Probably best to keep the same syntax everywhere.

29

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

What about something like $propertyMaxLength?

37

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–12

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 <>

29

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
36

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.