-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Coloring the navigation sidebar with the movement of the mouse #1133
base: main
Are you sure you want to change the base?
Conversation
Update style.css (Font Awesome 4.7.0 to 5.15.3). I added all the icons available in the file all.min.css of version 5.15.3 of Font Awesome.
Update style.css (Font Awesome 4.7.0 to 5.15.3). I added all the icons available in the file all.min.css of version 5.15.3 of Font Awesome.
Added more icons and sharing on whatsapp
Only the whatsapp icon was added to the style.css file. Now it is possible to take advantage of the document sharing feature for whatsapp.
Colorful navigation between sections was added in the sidebar of the 'gitbook' format, using 'stylish' key in 'config'. It is possible to enter a valid RGB system color, in hexadecimal notation or an image (local or url), using in 'stylish' the 'cover_image' key. In the case of an image, the median of the color channels is considered. 'stylish' also has a key 'justify' that justifies all the text.
Colorful navigation between sections was added in the sidebar of the 'gitbook' format, using 'stylish' key in 'config'. It is possible to enter a valid RGB system color, in hexadecimal notation or an image (local or url), using in 'stylish' the 'cover_image' key. In the case of an image, the median of the color channels is considered. 'stylish' also has a key 'justify' that justifies all the text.
The NEWS.md file has been updated
Update DESCRIPTION file
Update version in DESCRIPTION file.
Improving code visualization and removing unnecessary css.
Thanks for your suggestion! First let me start with some good practice for contribution:
About the PR: Currently, this feature is adding a hard dependency (magick) and I am not sure we want one more hard dependency for an optional feature like this. Also this is a pretty specific feature. Adding a background color to the head of the sidebar is quite easy with CSS already, and all other customization for style has to be done in CSS directly. This kind of precise customization (getting color from an image) does not feel in the scope of bookdown directly but some helpers function to insert into your Rmd. Did you already have example of some books out there which would use this feature ? I am trying to see how broad the usage would be for such feature. Thanks. |
Hi @cderv, with respect to dependency, it can be removed only allowing the user of the package to pass a color, that is, removing the possibility of passing an image. I also believe that, although it is easy to activate some features via CSS, many people in the field of statistics and who need a bookdown to produce their documents arrive, at most, close to _output.yml, not "getting their hands dirty" with CSS. I believe that if this resource were available, it would be used. It is a simple customization that does not change the general shape of the document. I don't have many examples of who uses it, just a biased example from the book I'm writing on computational statistics, https://prdm0.github.io/aulas_computacional/, in Portuguese 😆. When I see other examples of customizations, these examples greatly modify the current form of the document and modify many elements, that is, they are made by people who "get their hands dirty" with CSS. Anyway, I understand your positions and that's fine with me. 👍 Thanks. |
Thank you very much for the suggestions. It really makes the job of verifying the suggested changes a lot easier. |
|
Colorful navigation between sections was added in the sidebar of the
gitbook
format, usingstylish
key inconfig
. It is possible to enter a valid RGB system color, in hexadecimal notation or an image (local or url), using instylish
thecover_image
key. In the case of an image, the median of the color channels is considered.stylish
also has a keyjustify
that justifies all the text. An example https://prdm0.github.io/regimento_interno/.For example, considered use in
_output.yml
:Passing a URL:
In this example, the color when placing the mouse in the section names, in the navigation sidebar, will be chosen by the average of the colors of the RGB system channels of the image from the link https://raw.githubusercontent.com/rstudio/bookdown/master/inst/examples/images/cover.jpg. For example, you can choose the color based on the cover of the book.
Passing a color in the RGB system
It is also possible to pass a specific color, if you do not want to be guided by the median color of an image. Also note that you may not want to justify the text. So, do
justify: no
I believe that this change is useful and could please a large number of users.