Re:Shot-scraper: automated screenshots for documentation, bu...
by spockz on Thursday March 10, 2022 @02:43AM
(#30624236)
Yes, I agree that SVG and cans are powerful tools. But the amount of JavaScript in the examples isn’t insignificant. I saw a simple dsl for annotating pictures with arrows, rectangles, circles, and text from the Cli. But I can’t find it anymore.
Re:Shot-scraper: automated screenshots for documentation, bu...
by simonw on Thursday March 10, 2022 @09:33AM
(#30627317)
One idea I had there was to build a utility library that gets made available automatically, so you could write JavaScript that looks something like this:
ShotScraper.annotate(
".facet-link",
ShotScraper.Arrow({
color: "pink",
width: 150,
direction: "right"
})
)
Building this out is a lot of extra work though, so I decided to ship without that and see what kind of things people needed.
Re:Shot-scraper: automated screenshots for documentation, bu...
by spockz on Thursday March 10, 2022 @05:00PM
(#30633056)
That would be neat indeed. Would it be a lot of extra work?
If there is a transparant SVG canvas placed over the element, then the positioning of elements should be relatively trivial? It would basically follow the example JavaScript in the post.
Re:Shot-scraper: automated screenshots for documentation, bu...
by simonw on Thursday March 10, 2022 @06:18PM
(#30633963)
My concern is more about the long-term maintenance of it.
If I ship a JavaScript library with the tool, then modify that JavaScript library later, I risk breaking the automated screenshots that were scripted against previous versions of the library.
If I'm committing to shipping a library that won't break backwards compatibility, I have to be very confident that I'm designing it well from the start.
So I'm probably going to do it at some point, but I'm not going to rush into it.
I'm hoping people with stronger frontend skills than me will provide some more interesting examples there!