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

Avoid logo distortion #211

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Avoid logo distortion #211

merged 1 commit into from
Sep 13, 2024

Conversation

robinhasse
Copy link
Contributor

@robinhasse robinhasse commented Sep 12, 2024

Sets maximum height and width for the logo in README instead of fixed values to avoid distortion.

Instead of maximum height and width (not supported by github markdowns), logos are inserted only giving the height (just like before the problematic #209). But this height can now be changed from its default value of 139 px if one sets LogoHeightReadme in .buildlibrary.

@jnnsbrr
Copy link
Contributor

jnnsbrr commented Sep 13, 2024

Dear @robinhasse thank you,
again I tested the output https://github.com/jnnsbrr/lpjmlkit/blob/master/README.md but it still does not align correctly. I tested some potential solutions but without success for png and the github markdown (which behaves differently than standard markdown). For pngs its still to large and also you need a line break inbetween HTML code and markdown header ("#") otherwise its not recognized.
You can see what I tried here: https://github.com/jnnsbrr/lpjmlkit/commits/potential_solution/

I also used the SVG version of the lpjmlkit logo but then it has a line crossing the logo: https://github.com/jnnsbrr/lpjmlkit/tree/potential_solution/README.md

I think it has a reason why they use this standard in R packages like ggplot2 or tidyr. Sorry to say but I would be in favour to revert it or you find a solution that satisfies both needs which may take some time 😬

@robinhasse
Copy link
Contributor Author

Dear @jnnsbrr,

thanks for your efforts fixing my attempts here. I was not aware that github markups are lacking some html support of usual markups so my tests in VSC where not accurate.

Your manual compilation of the title line isn't exactly what the code did. The line always starts with #, so switching the order or title and html code is actually not the problem.

But as there seems to be no way to proportionally scale images within a given box in github markdowns, I added LogoHeightReadme as another optional parameter for .buildlibrary which allows to deviate from the default height of 139px. The html code is now quite similar to your original one just with customisable height.

I tested lucode2::buildlLibrary on your repo here. Hope this is fine now. Sorry for keeping you busy and thanks again for your help.

@jnnsbrr
Copy link
Contributor

jnnsbrr commented Sep 13, 2024

Ah great, this looks good! Thanks a lot for the effort. Good to go from my side 👍

@robinhasse robinhasse merged commit 535ba8a into pik-piam:master Sep 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants