Questions about Cloning Routine


#1

We’ve had some users note a little bit of unexpected behavior in the cloning routine, and I wasn’t able to find specific answers in currently available public documentation. Before filing an issue on GitHub, I wanted to ask here first.

  1. The source book in question had custom styles applied. It does not appear that these custom styles were cloned along with the book’s content. Is that by design? Could this be included, if desired?

  2. The user reports that “all html code that was in between <pre> tage was messed up (no end of lines were cloned).” I don’t have more clarity than this, but can try to provide an example if needed?

  3. Finally, in this case the user was cloning their own book and (I think) plans to delete or unpublish the source at some point. Is there a way that they can remove the notice that “this book was cloned from a pre-existing book at the above URL. This information will be displayed on the webbook homepage.”

Tagging @lrizquierdo since the answers here will likely be of interest to him.


#2

Hi @SteelWagstaff (and @lrizquierdo), answers below:

  1. Yes, this is by design. The Pressbooks REST API exposes content and metadata, not styling (custom styles, choice of theme, theme options). We may revisit this at a future date but this was an explicit decision on our part, and allowing custom styles to be cloned would be a non-trivial change. It would require adding additional endpoints to the REST API, additional steps to the cloning routine, etc.
  2. Yes, an example would be helpful, but I’ll test on my own and will probably open a bug ticket.
  3. This is a feature that we intend to enable at some point, but it needs consideration because we don’t want to encourage the removal of attribution data.

#3

Ticket for #2 (I was able to reproduce): https://github.com/pressbooks/pressbooks/issues/1225


#4

Thanks for speedy reply Ned. We’ll note #1 in our local documentation for users about cloning. As long as users know this will need to be replicated, they should be fine. In cases where they’re not admins on the source book, is there a quick and reliable method to find the css file that custom styles applies so it could be copied (if desired) to the child book? #3 makes sense–I think we’re ok waiting as this gets puzzled through.


#5

There’s actually no file; it’s stored in the database. So unfortunately not.


#6

This is slightly off topic, but I recently cloned the Rebus Groups guide to making textbooks with students. I wanted to print off several copies for a professional development workshop that I was running.

The PDF that was provided wasn’t great for my purposes, because I wanted to put the 3 hole punched copies in those folders with the 3 clasps, so I needed to regenerate the PDFs with larger inside margins.

Because their book was a multi-author volume, their theme had the author listed at the top of every chapter. I wasn’t able to figure out what theme that was under my time constraints, or if they had just built it with custom CSS. I thought it might be Lewis by looking at pressbooks.com/themes/ , but I couldn’t find that theme on GitHub.

I have some books that we are working on on my campus where we have had to do customization within QuickLatex, using styles and calling additional packages. We were going to include that extra information in an appendix, because if we don’t cloning would not be an effective way to share material.


#7

Hi Ed–yes, the theme for that book is Lewis. It’s not one of the free, open-source themes, but appears to be one of the custom themes available to paid users of Pressbooks. I hadn’t considered including the custom styles CSS in an appendix file, but that’s quite an interesting idea for the short term, though I think allowing it to be cloned with the book might be a better path for us in the longer-term.