antoyo / relm

Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust
MIT License
2.44k stars 78 forks source link

Add example screenshots and generator script #82

Closed zzeroo closed 6 years ago

zzeroo commented 6 years ago

The result of my daily kata looks good for me, this targets #56 as well.

This commit consists a shell script https://github.com/antoyo/relm/pull/82/commits/2079e8bf41b3f36aa3f250b718fb8f43a5105848#diff-e95bfe5505138b45c64a16da00551a59 which generates a examples/README.md and the needed screenshots. Please look at the header of that shell script.

P.S. I could expand this to run on the CI and I'm not sad if this is rejected.

antoyo commented 6 years ago

Thanks your this script (and sorry for being so late to answer). Could you please add a line like this in the script:

convert buttons-construct-prop-attribute.png -trim buttons-construct-prop-attribute-crop.png 

to automatically crop the images and thus remove the black background? Also, I'm not sure if generating a HTML file with pandoc is necessary, since GitHub can show it from the Markdown: what do you think? Thanks for your work.

zzeroo commented 6 years ago

So your which is my order ><. I've implemented the crop and removed the pandoc driven .html generation. The pandoc solution was only for local testing without the travis CI.

To be honest I'm unsure if I find this PR good. The more I think about it the more I found that so many examples aren't good. Relm should have a side project like gtk3-demo. With code examples, screenshots and some little annotations about the current example. And most important, the screenshots should be made by the ci and not manually triggered as it is here the case.

antoyo commented 6 years ago

I agree that many examples are not good. Actually, many of them should be moved to the tests/ folder as they are tests, not examples :) .

antoyo commented 6 years ago

I'm closing for now. Please reopen when there will be good demo examples.