-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Long-term support for themes #232
Comments
Love it. I like the way hugo themes are organized. I think we could borrow some ideas from them. Like having a master repo for showcase and organize themes in different repo. But I think the submodule stuff is likely to be an overkill. Just download the theme file should be enough. To make my point clear, my case is that all my slides sit under "projectA/slides/". They are individual Rmd files, so adding a submodule to the project repo feels strange to me. To keep things simple, I also propose
|
I'd go with that.
Yes probably. What about a This function could run in the setup chunk of the Rmd file and external people looking at the source Rmd would directly see that there is this call for installing an external theme. |
I like it and it's straightforward to implement. It should be flexible to deal with existing themes and new themes hosted individually |
I suggest using A user-friendly way to use a theme should be something like dropping |
Just found a convenient way to include CSS into the RMD using htmltools, which is an existing dependency of xaringan. Add the following chunk into the Rmd, There's no need to modify the yaml header or to download the CSS file and it will always up to date with the online CSS version.
Then the only work left to do is to organize a repo for hosting themes and maybe write a wrapper function in xaringan. |
You mean in detail that Additionally we should state that |
@tcgriffith: I'm not sure if (always) directly using the (latest) online version is the right thing to do. |
@pat-s yes, exactly.
Separating the theme stuff(contributing/updating themes) from the xaringan package. I think that's your initial purpose right? @mschilli87 |
I quickly came up with this demo repo to demonstrate how I would like a theme to be The css add three classes to change the background color:
the theme is xaringan_theme_example.css, which uses the same name as the repo. The
The ref parameter should be sufficient to make the slide reproducible. @mschilli87 |
@tcgriffith: If I read this correctly, the CSS is downloaded and the local copy is included in the HTML. In that case, as long as I don't re-render my RMarkdown file, I'd get the same result even with |
I think there are several ways to approach this problem.
=== update: I embedded the info in the author's note in the presentation mode |
Maybe this is a little off-topic but why not… I deployed a blogdown site as a theme showcase (hugo theme: xmag by @yihui ) The showcase is not compulsory, people can host their own themes at their own will. The structure of a theme is pretty flexible: only that CSS is required, I also added an index.md, which works in both hugo+netlify and jekyll+gh pages |
That escalated quickly 😄 I like the current approach @tcgriffith. Havin a "ref" arg gives control for versioning.
And we're back at submodules 😃 How do you want to keep track of upstream changes? Automate the submodule update process somehow? |
The showcase repo is only intended for the blogdown site, not for actually using them so submodule is totally fine in this case. So only a handful of showcase maintainers and the theme author are responsible to keep the showcase up to date. |
So shall we propose a PR or gather more discussions for a few days ? |
Your approach looks fine for me. More comments when the PR is ready then. @yihui's opinion would be important before you get started to not waste resources and time. |
Update: and the Hugo theme is also changed. |
PRed, please have a look! @pat-s |
Due to #229 I was wondering if there would be the need for a different approach of updating/contributing themes.
Rather than adding individual CSS files for a theme to
xaringan
directly,xaringan
could import themes from an upstream repo via git submodules.As submodules are somewhat complicated, one could come up with a wrapper function named
install_theme(update = TRUE/FALSE)
(use_theme()
) which takes care of this in the background.In general modular approaches have a lot of advantages seem from a maintenance point of view. However, it is hard to change the system if one did not start this way.
There haven't been many new theme contributions lately and most of the time themes won't be updated. So maybe I am trying to use sledgehammer to crack a nut here...
Advantages
xaringan
and the upstream repo) if there is a dedicated upstream repoDisadvantages
The text was updated successfully, but these errors were encountered: