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

Autogenerate contents table if user doesn't supply one #38

Open
matt-dray opened this issue Feb 28, 2022 · 2 comments
Open

Autogenerate contents table if user doesn't supply one #38

matt-dray opened this issue Feb 28, 2022 · 2 comments
Labels
could MoSCoW priority ('on ice') discuss Point for discussion enhancement New feature or request
Milestone

Comments

@matt-dray
Copy link
Collaborator

matt-dray commented Feb 28, 2022

new_a11ytable() captures all the information required to make the contents page without the need for the user to create it themselves. It's just tab_title and sheet_title from the a11ytables-class object in a table format.

Would users want to add anything more to the contents table? Might be beneficial to be restrictive and stop this (better consistency, fewer inputs for end user, less chance for contents/tabs mismatch errors as per #34). They can always add things after the a11ytable has been created.

So for this demo dataset:

> mtcars_df
# # A tibble: 4 × 6
#   tab_title sheet_type sheet_title                                          source             table_name        table        
#   <chr>     <chr>      <chr>                                                <chr>              <chr>             <list>       
# 1 Cover     cover      The mtcars demo datset: 'Motor Trend Car Road Tests' NA                 cover_sheet       <df [2 × 2]> 
# 2 Contents  contents   Table of contents                                    NA                 table_of_contents <df [2 × 2]> 
# 3 Notes     notes      Notes                                                NA                 notes_table       <df [6 × 2]> 
# 4 Table 1   tables     Motor Trend Car Road Tests                           Motor Trend (1974) car_scores        <df [32 × 6]>

You can grab the tab and sheet titles and put them in a data.frame:

x <- mtcars_df[mtcars_df$sheet_type %in% c("notes", "tables"),  ]

contents_df <- data.frame(
  `Sheet name` = x$tab_title,
  `Sheet title` = x$sheet_title
)

Or whatever.

@matt-dray matt-dray added enhancement New feature or request discuss Point for discussion labels Feb 28, 2022
@matt-dray matt-dray changed the title Autogenerate contents table Autogenerate contents table? Mar 4, 2022
@matt-dray
Copy link
Collaborator Author

I think it might be conceptually weird for the user not to provide the contents table, since they'll be providing a table for all the other sheets. I think this provides maximum flexibility for the user as well, who might want to add more colums into the contents table for whatever reason and they should be able to do it at the step where they add the table, rather than having to create the a11ytable and then amend it afterwards.

@matt-dray matt-dray added the could MoSCoW priority ('on ice') label Apr 19, 2022
@matt-dray
Copy link
Collaborator Author

Better: generate the notes sheet on behalf of the user if they do not provide the information to create one. This would maintain backwards compatibility too.

@matt-dray matt-dray changed the title Autogenerate contents table? Autogenerate contents table if user doesn't supply one Dec 27, 2023
@matt-dray matt-dray added this to the Backlog milestone May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could MoSCoW priority ('on ice') discuss Point for discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant