Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Coloring the navigation sidebar with the movement of the mouse#1133

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
prdm0 wants to merge26 commits intorstudio:main
base:main
Choose a base branch
Loading
fromprdm0:master

Conversation

@prdm0
Copy link
Contributor

@prdm0prdm0 commentedApr 11, 2021
edited
Loading

Colorful navigation between sections was added in the sidebar of thegitbook 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 examplehttps://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 linkhttps://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.

bookdown::gitbook:split_by:sectioncss:style.cssconfig:sharing:whatsapp:yesall:['whatsapp']stylish:cover_image:"https://raw.githubusercontent.com/rstudio/bookdown/master/inst/examples/images/cover.jpg"justify:yes

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, dojustify: no

bookdown::gitbook:split_by:sectioncss:style.cssconfig:sharing:github:nofacebook:notwitter:nowhatsapp:yesall:['whatsapp']stylish:cover_image:"#F79A48"justify:yes

I believe that this change is useful and could please a large number of users.

prdm0and others added26 commitsApril 4, 2021 01:11
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.
@cderv
Copy link
Collaborator

Thanks for your suggestion!

First let me start with some good practice for contribution:

  • It would be great if next time you first open an issue for a new feature request so that we can discuss the interest of included it directly insidebookdown.
  • Also, please create a branch and do a PR from your feature branch to master. This will allow to have cleaner Pull Request with only commits related to your feature. Currently, there are 26 commits but only the 8 last ones are relevant

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 ofbookdown directly but some helpers function to insert into your Rmd.
However, I understand the interest in easy customization of the style.

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.

@prdm0
Copy link
ContributorAuthor

Thanks for your suggestion!

First let me start with some good practice for contribution:

* It would be great if next time you first open an issue for a new feature request so that we can discuss the interest of included it directly inside **bookdown**.* Also, please create a branch and do a PR from your feature branch to master. This will allow to have cleaner Pull Request with only commits related to your feature. Currently, there are 26 commits but only the 8 last ones are relevant

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 ofbookdown directly but some helpers function to insert into your Rmd.
However, I understand the interest in easy customization of the style.

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.

@prdm0
Copy link
ContributorAuthor

prdm0 commentedApr 12, 2021
edited
Loading

First let me start with some good practice for contribution:

  • It would be great if next time you first open an issue for a new feature request so that we can discuss the interest of included it directly insidebookdown.
  • Also, please create a branch and do a PR from your feature branch to master. This will allow to have cleaner Pull Request with only commits related to your feature. Currently, there are 26 commits but only the 8 last ones are relevant

Thank you very much for the suggestions. It really makes the job of verifying the suggested changes a lot easier.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign ourContributor License Agreement before we can accept your contribution.
1 out of2 committers have signed the CLA.

✅ cderv
❌ prdm0
You have signed the CLA already but the status is still pending? Let usrecheck it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@prdm0@cderv@CLAassistant

[8]ページ先頭

©2009-2025 Movatter.jp