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

quarto get_chapters() compatibility #129

Merged
merged 5 commits into from
Jun 11, 2024
Merged

quarto get_chapters() compatibility #129

merged 5 commits into from
Jun 11, 2024

Conversation

cansavvy
Copy link
Contributor

@cansavvy cansavvy commented May 16, 2024

Purpose/implementation Section

What changes are being implemented in this Pull Request?

The get_chapters() function is used to collect chapter information. This is used in turn by the bookdown_to_leanpub() function in ottrpal.

It retrieves chapters based on the html node structure for bookdown but quarto has a different structure.

So this is adding compatibility for the quarto structure.

What this needs

The only true changes are in R/bookdown_to_leanpub.R the rest is styling changes.

@howardbaek Can you double check this and see if it makes sense?

Copy link
Contributor

@howardbaik howardbaik May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran get_chapters() with index.html generated by the Quarto version of ottr, and got this error message:

Error in `dplyr::mutate()`:
ℹ In argument: `url = paste0(base_url, data_path)`.
Caused by error:
! object 'data_path' not found

The error stems from Line 472.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We pair programmed on this and determined it was a simple logic issue.

Can you test this again?

@cansavvy cansavvy requested a review from howardbaik June 5, 2024 18:20
R/bookdown_to_leanpub.R Outdated Show resolved Hide resolved
@howardbaik
Copy link
Contributor

howardbaik commented Jun 10, 2024

After applying my code suggestion, I get this data frame for chapt_data:

> chapt_data
                chapt_titles data_level                       data_path
1 Introduction to the Course          1                      intro.html
2                New Chapter          2  first-section-new-chapter.html
3                New Chapter          3 second-section-new-chapter.html
4                New Chapter          4  third-section-new-chapter.html
5                 Conclusion          5                 conclusion.html

Co-authored-by: Howard Baek <[email protected]>
@cansavvy
Copy link
Contributor Author

Thanks for these fixes @howardbaek I think this all makes sense.

@cansavvy cansavvy merged commit 828539f into main Jun 11, 2024
4 checks passed
@cansavvy cansavvy deleted the cansavvy/quarto branch June 11, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants