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

Apply colour to HTML output #176

Merged
merged 3 commits into from
Nov 8, 2023
Merged

Apply colour to HTML output #176

merged 3 commits into from
Nov 8, 2023

Conversation

hugovk
Copy link
Owner

@hugovk hugovk commented Nov 8, 2023

Fixes #175.

For example:

eol go --html
<table>
    <thead>
        <tr>
            <th>cycle</th>
            <th>release</th>
            <th>latest</th>
            <th>latest release</th>
            <th>eol</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td align="left">1.21</td>
            <td align="left">2023-08-08</td>
            <td align="left">1.21.4</td>
            <td align="left">2023-11-07</td>
            <td align="left"><font color="green">False</font></td>
        </tr>
        <tr>
            <td align="left">1.20</td>
            <td align="left">2023-02-01</td>
            <td align="left">1.20.11</td>
            <td align="left">2023-11-07</td>
            <td align="left"><font color="green">False</font></td>
        </tr>
        <tr>
            <td align="left">1.19</td>
            <td align="left">2022-08-02</td>
            <td align="left">1.19.13</td>
            <td align="left">2023-09-06</td>
            <td align="left"><font color="red">2023-08-08</font></td>
        </tr>
        <tr>
            <td align="left">1.18</td>
            <td align="left">2022-03-15</td>
            <td align="left">1.18.10</td>
            <td align="left">2023-01-10</td>
            <td align="left"><font color="red">2023-02-01</font></td>
        </tr>
        <tr>
            <td align="left">1.17</td>
            <td align="left">2021-08-16</td>
            <td align="left">1.17.13</td>
            <td align="left">2022-08-01</td>
            <td align="left"><font color="red">2022-08-02</font></td>
        </tr>
        <tr>
            <td align="left">1.16</td>
            <td align="left">2021-02-16</td>
            <td align="left">1.16.15</td>
            <td align="left">2022-03-03</td>
            <td align="left"><font color="red">2022-03-15</font></td>
        </tr>
        <tr>
            <td align="left">1.15</td>
            <td align="left">2020-08-11</td>
            <td align="left">1.15.15</td>
            <td align="left">2021-08-04</td>
            <td align="left"><font color="red">2021-08-16</font></td>
        </tr>
        <tr>
            <td align="left">1.14</td>
            <td align="left">2020-02-25</td>
            <td align="left">1.14.15</td>
            <td align="left">2021-02-04</td>
            <td align="left"><font color="red">2021-02-16</font></td>
        </tr>
        <tr>
            <td align="left">1.13</td>
            <td align="left">2019-09-03</td>
            <td align="left">1.13.15</td>
            <td align="left">2020-08-06</td>
            <td align="left"><font color="red">2020-08-11</font></td>
        </tr>
        <tr>
            <td align="left">1.12</td>
            <td align="left">2019-02-25</td>
            <td align="left">1.12.17</td>
            <td align="left">2020-02-12</td>
            <td align="left"><font color="red">2020-02-25</font></td>
        </tr>
        <tr>
            <td align="left">1.11</td>
            <td align="left">2018-08-24</td>
            <td align="left">1.11.13</td>
            <td align="left">2019-08-13</td>
            <td align="left"><font color="red">2019-09-03</font></td>
        </tr>
        <tr>
            <td align="left">1.10</td>
            <td align="left">2018-02-16</td>
            <td align="left">1.10.8</td>
            <td align="left">2019-01-23</td>
            <td align="left"><font color="red">2019-02-25</font></td>
        </tr>
    </tbody>
</table>

This is with the default --color auto, and we get the same output with --color yes.

For no colour:

eol go --html --color no
<table>
    <thead>
        <tr>
            <th>cycle</th>
            <th>release</th>
            <th>latest</th>
            <th>latest release</th>
            <th>eol</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td align="left">1.21</td>
            <td align="left">2023-08-08</td>
            <td align="left">1.21.4</td>
            <td align="left">2023-11-07</td>
            <td align="left">False</td>
        </tr>
        <tr>
            <td align="left">1.20</td>
            <td align="left">2023-02-01</td>
            <td align="left">1.20.11</td>
            <td align="left">2023-11-07</td>
            <td align="left">False</td>
        </tr>
        <tr>
            <td align="left">1.19</td>
            <td align="left">2022-08-02</td>
            <td align="left">1.19.13</td>
            <td align="left">2023-09-06</td>
            <td align="left">2023-08-08</td>
        </tr>
        <tr>
            <td align="left">1.18</td>
            <td align="left">2022-03-15</td>
            <td align="left">1.18.10</td>
            <td align="left">2023-01-10</td>
            <td align="left">2023-02-01</td>
        </tr>
        <tr>
            <td align="left">1.17</td>
            <td align="left">2021-08-16</td>
            <td align="left">1.17.13</td>
            <td align="left">2022-08-01</td>
            <td align="left">2022-08-02</td>
        </tr>
        <tr>
            <td align="left">1.16</td>
            <td align="left">2021-02-16</td>
            <td align="left">1.16.15</td>
            <td align="left">2022-03-03</td>
            <td align="left">2022-03-15</td>
        </tr>
        <tr>
            <td align="left">1.15</td>
            <td align="left">2020-08-11</td>
            <td align="left">1.15.15</td>
            <td align="left">2021-08-04</td>
            <td align="left">2021-08-16</td>
        </tr>
        <tr>
            <td align="left">1.14</td>
            <td align="left">2020-02-25</td>
            <td align="left">1.14.15</td>
            <td align="left">2021-02-04</td>
            <td align="left">2021-02-16</td>
        </tr>
        <tr>
            <td align="left">1.13</td>
            <td align="left">2019-09-03</td>
            <td align="left">1.13.15</td>
            <td align="left">2020-08-06</td>
            <td align="left">2020-08-11</td>
        </tr>
        <tr>
            <td align="left">1.12</td>
            <td align="left">2019-02-25</td>
            <td align="left">1.12.17</td>
            <td align="left">2020-02-12</td>
            <td align="left">2020-02-25</td>
        </tr>
        <tr>
            <td align="left">1.11</td>
            <td align="left">2018-08-24</td>
            <td align="left">1.11.13</td>
            <td align="left">2019-08-13</td>
            <td align="left">2019-09-03</td>
        </tr>
        <tr>
            <td align="left">1.10</td>
            <td align="left">2018-02-16</td>
            <td align="left">1.10.8</td>
            <td align="left">2019-01-23</td>
            <td align="left">2019-02-25</td>
        </tr>
    </tbody>
</table>

Also update some config, including switching from Flake8 to Ruff.

@hugovk hugovk added the changelog: Added For new features label Nov 8, 2023
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Merging #176 (9524208) into main (1e79906) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   98.96%   98.97%   +0.01%     
==========================================
  Files           7        7              
  Lines         386      390       +4     
==========================================
+ Hits          382      386       +4     
  Misses          4        4              
Flag Coverage Δ
macos-latest 98.97% <100.00%> (+0.01%) ⬆️
ubuntu-latest 98.97% <100.00%> (+0.01%) ⬆️
windows-latest 98.97% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/norwegianblue/__init__.py 98.68% <100.00%> (+0.03%) ⬆️
tests/data/expected_output.py 100.00% <ø> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@hugovk hugovk force-pushed the colour-html branch 2 times, most recently from 26de525 to f97a589 Compare November 8, 2023 16:23
@hugovk hugovk merged commit de0738b into main Nov 8, 2023
44 checks passed
@hugovk hugovk deleted the colour-html branch November 8, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Added For new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add colourized output for html formatted tables
1 participant