jhudsl / ottrpal

Tools for converting OTTR courses into Leanpub or Coursera courses :otter:
https://jhudatascience.org/ottrpal/
GNU General Public License v3.0
3 stars 1 forks source link

quarto `get_chapters()` compatibility #129

Closed cansavvy closed 3 weeks ago

cansavvy commented 1 month ago

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?

howardbaek commented 3 weeks ago

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
cansavvy commented 3 weeks ago

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