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

Add new functions #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ntluong95
Copy link

The two new functions deal with the situation when there is not yet available translation version of the main language.
Take this book as an example:

project:
  type: book

format:
  html: 
    theme:
      light: cosmo
      dark: [darkly, theme-dark.scss]
    toc: true
    number-sections: false
    number-depth: 0
    css:
    - webex.css
    include-after-body:
    - webex.js
  # pdf:
  #   documentclass: scrreprt

bibliography: references.bib
babelquarto:
  languagecodes:

  - name: es
    text: "Español"
  - name: en
    text: "English"

  mainlanguage: 'en'
  languages: ['es']

title-es: "Estudios de casos de AppliedEpi"
lang: en

book:
  title: "AppliedEpi cases studies"
  search:
    type: textbox
  author: AppliedEpi
  date: today
  date-format: "MMM D, YYYY"
  chapters:
  # INTRO 
  - index.qmd                           

  # ABOUT BOOK
  - part: "Case studies"
    part-es: "Estudios de caso"
    chapters:
    - pages/fulton.qmd          
    - pages/r_practical_epiet.qmd
    - pages/tbe.qmd                
    - pages/oswego.es.qmd

The English version has 3 chapter fulton.qmd, r_practical_epiet.qmd, tbe.qmd , while the Spanish version only has oswego.es.qmd. Adding two new function babelquarto::render_dynamic_book() and babelquarto::render_dynamic_website() creates a flexibility, so when all language variants are there, we can use babelquarto::render_book() and babelquarto::render_website() as usual

@ntluong95
Copy link
Author

I forgot to mention that the index file for language versions is the must. For example, in this case we need index.es.qmd.
@maelle It would be nice if I can be added as a contributor of the package 😊

@maelle
Copy link
Contributor

maelle commented Aug 12, 2024

Thank you @ntluong95! I need to think a bit about this. I feel it's adding some maintenance work (and duplication) on the side of the package, while it's not a lot of work for users to add the placeholders file. 🤔

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