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

Update screenshots in documentation to match latest designs #1844

Closed
simonw opened this issue Oct 14, 2022 · 18 comments
Closed

Update screenshots in documentation to match latest designs #1844

simonw opened this issue Oct 14, 2022 · 18 comments

Comments

@simonw
Copy link
Owner

simonw commented Oct 14, 2022

https://docs.datasette.io/en/0.62/full_text_search.html has this out-of-date screenshot:

image

simonw added a commit to simonw/datasette-screenshots that referenced this issue Oct 14, 2022
@simonw simonw changed the title Update screenshot on full text search page Update screenshots in documentation to match latest designs Oct 14, 2022
@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

I just spotted some other out-dated screenshots in the docs/ directory:

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

For the advanced export one:

shot-scraper 'https://register-of-members-interests.datasettes.com/regmem/items?_search=hamper' -s '#export' -p 10

Produces:

register-of-members-interests-datasettes-com-regmem-items 2

Current image is:

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

simonw added a commit to simonw/datasette-screenshots that referenced this issue Oct 14, 2022
@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

For this image:

https://latest.datasette.io/fixtures/binary_data has an extra row these days:

image

This deletes every row past the first two (first three including the header row):

Array.from(document.querySelectorAll('tr:nth-child(n+3)'), el => el.parentNode.removeChild(el));

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

So:

shot-scraper 'https://latest.datasette.io/fixtures/binary_data' \
  -j "Array.from(document.querySelectorAll('tr:nth-child(n+3)'), el => el.parentNode.removeChild(el));" \
  -s table -p 10

latest-datasette-io-fixtures-binary_data 1

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

Here's the new advanced export image:

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

I'm going to use this page for the facets screenshot: https://congress-legislators.datasettes.com/legislators/legislator_terms?_facet=type&_facet=party&_facet=state&_facet_size=10

Trying for this bit:

image

Which incorporates .suggested-facets but also the first 3 rows and 10 columns of the table, I wonder if I can specify that in a single selector?

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

This seems to get every table cell in that table for the first 3 rows and the columns up to party:

document.querySelectorAll('tr:not(:nth-child(n+4)) td:not(:nth-child(n+10))')

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

This works:

shot-scraper
  'https://congress-legislators.datasettes.com/legislators/legislator_terms?_facet=type&_facet=party&_facet=state&_facet_size=10' \
  -s '.suggested-facets a' \
  --selector-all 'tr:not(tr:nth-child(n+4)) td:not(:nth-child(n+11))' \
  -p 10

congress-legislators-datasettes-com-legislators-legislator_terms 6

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

I'm going to link the documentation screenshots directly to the images in the https://github.com/simonw/datasette-screenshots repository - but I don't want those images to reflect main when the documentation may reflect a specific version.

So I'm going to start tagging releases of datasette-screenshots so I can get permanent URLs to those images.

simonw added a commit to simonw/datasette-screenshots that referenced this issue Oct 14, 2022
simonw added a commit to simonw/datasette-screenshots that referenced this issue Oct 14, 2022
@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

That's the last two screenshots:

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

I'm going to tag datasette-screenshots with the current Datasette version, 0.62.

simonw added a commit to simonw/datasette-screenshots that referenced this issue Oct 14, 2022
@simonw simonw closed this as completed in fdf9891 Oct 14, 2022
@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

Here's the YAML I added to https://github.com/simonw/datasette-screenshots/blob/main/shots.yml for this issue:

- url: https://register-of-members-interests.datasettes.com/regmem/items?_search=hamper&_sort_desc=date
  height: 585
  width: 960
  output: regmem-search.png
- url: https://register-of-members-interests.datasettes.com/regmem/items?_search=hamper
  selector: "#export"
  output: advanced-export.png
  padding: 10
- url: https://congress-legislators.datasettes.com/legislators/legislator_terms?_facet=type&_facet=party&_facet=state&_facet_size=10
  selectors_all:
  - .suggested-facets a
  - tr:not(tr:nth-child(n+4)) td:not(:nth-child(n+11))
  padding: 10
  output: faceting-details.png
- url: https://latest.datasette.io/fixtures/binary_data
  selector: table
  javascript: |-
    Array.from(
      document.querySelectorAll('tr:nth-child(n+3)'),
      el => el.parentNode.removeChild(el)
    );
  padding: 10
  output: binary-data.png

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

Twitter thread about this issue: https://twitter.com/simonw/status/1581012617526595584

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

@simonw
Copy link
Owner Author

simonw commented Oct 14, 2022

Blogged about this here: https://simonwillison.net/2022/Oct/14/automating-screenshots/

simonw added a commit that referenced this issue Oct 24, 2022
@simonw simonw mentioned this issue Oct 27, 2022
simonw added a commit that referenced this issue Oct 27, 2022
simonw added a commit that referenced this issue Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant