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

[ENH] render table from TSV #1783

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Apr 15, 2024

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Apr 15, 2024

@yarikoptic @sappelhoff

http://127.0.0.1:8000/en/stable/longitudinal-and-multi-site-studies.html#longitudinal-and-multi-site-studies

How would this look:

image

Note that grabbing the content from the HTML (with copy-paste) gives this (where separators are one space + one tab):

session_id 	acq_time 	systolic_blood_pressure
ses-predrug 	2009-06-15T13:45:30 	120
ses-postdrug 	2009-06-16T13:45:30 	100

@Remi-Gau
Copy link
Collaborator Author

if we are OK with this look, I could do the other TSV examples in the spec.

@Remi-Gau Remi-Gau added the exclude-from-changelog This item will not feature in the automatically generated changelog label Apr 15, 2024
@sappelhoff
Copy link
Member

I think this is a great improvement!

one space + one tab

why the space though 🤔

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Apr 15, 2024

why the space though 🤔

No idea

@yarikoptic
Copy link
Collaborator

looks neat! I would have still adjusted styling to remove even row separators visually.

re "space" -- worth checking on https://github.com/timvink/mkdocs-table-reader-plugin/issues?

how would it work for PDFs?

@Remi-Gau
Copy link
Collaborator Author

how would it work for PDFs?

will add a bit of code to inject content during the pdf build

@Remi-Gau
Copy link
Collaborator Author

if we need to add a warning for copy pasting directly from the HTML, I would suggest using mkdocs annotations:

https://squidfunk.github.io/mkdocs-material/reference/annotations/#using-annotations

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.93%. Comparing base (943c20e) to head (72705c7).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1783   +/-   ##
=======================================
  Coverage   87.93%   87.93%           
=======================================
  Files          16       16           
  Lines        1351     1351           
=======================================
  Hits         1188     1188           
  Misses        163      163           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Remi-Gau
Copy link
Collaborator Author

PDF looks good to me:

image

@Remi-Gau Remi-Gau marked this pull request as ready for review April 16, 2024 08:57
@Remi-Gau
Copy link
Collaborator Author

For the PDF could also just opt for a more verbatim rendering rather than actual tables.

Though not sure how often people will "copy paste" from the pdf.

@effigies
Copy link
Collaborator

I hate to throw a towel on all of this, but I feel like moving the examples into separate files will only make the spec more difficult to contribute to. One thing we could consider is writing a custom fence formatter and write a renderer that would convert

```tsv
session_id	body_weight
ses-01	58
ses-02	59
```

into

| session_id | body_weight |
|--|--|
| ses-01 | 58 |
| ses-02 | 59 |

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Apr 18, 2024

I hate to throw a towel on all of this, but I feel like moving the examples into separate files will only make the spec more difficult to contribute to.

To be fair this was an unvoiced concern of mine when working on this, so thanks for raising it.

In any case this is not urgent so we can definitely wait before merging: moving back to draft.

In the meantime I will try to work on those fencer thing you linked to.

🤺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-from-changelog This item will not feature in the automatically generated changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Harmonize .tsv examples (and their rendering)
4 participants