Comments (9)
-
I was curious why we have this
|
-> in fact, this appending of chapter name to title books is a bookdown feature inprepend_chapter_title()
called insplit_chapters()
. Usually, the prepending does not happen on first page of the bookdown because book title is the same as first header. But this is not the case withbs4_book()
and any other template that would not add a title part in there template. I can deal with it in bookdown.org but it feels that this preprend feature can maybe evolved to not preprend anything onindex.html
? -
Metadata are missing for now in
bs4_book()
: rstudio/bookdown#1034 -
The file for
bs4_book()
is calledsearch.json
. It returns:
httr::headers(httr::HEAD(paste0("https://adv-r.hadley.nz/", 'search.json')))$`content-length`
#> [1] "759493"
- No
bs4_book()
does not have the date in header. Ifdate
field is passed in YAML header, it is used to fill a text in the footer: See https://devguide.ropensci.org/
I think we could adapt the script here, but also suggest some addition in bs4_book()
.
from bookdown.org.
Just sharing here for reference why bookdown will prepend the header of the file in title.
I think this because sometimes, users forgot to set the title:
field in index.Rmd and the filename will be used as title. This leads to title like this (source)
<title>Dissertating with RMarkdown and Bookdown | dissertating_rmd_presentation.utf8.md</title>
So, sometimes the second part of the title is not what we want...
from bookdown.org.
- Okay, I see. It was because of https://github.com/rstudio/bookdown/blob/6ae8ead/R/html.R#L1112. Let's just do
title = gsub('.*\\|\\s*', '', title)
for now. - I see.
- I see. It will be nice if
bs4_book
could use the same filename asgitbook
(i.e.,search_index.json
), so we don't need to try two locations here. - It doesn't matter where the date is inserted on the page, as long as it can be found.
Thanks!
from bookdown.org.
After running the new script for test, it seems there is also an issue with the summary description.
diff --git a/content/archive/external/adv-r-hadley-nz.md b/content/archive/external/adv-r-hadley-nz.md
index f731283..adbcadc 100644
--- a/content/archive/external/adv-r-hadley-nz.md
+++ b/content/archive/external/adv-r-hadley-nz.md
@@ -4,10 +4,8 @@ author: "Hadley Wickham"
date: ""
tags: [Advanced R, R Programming]
link: "https://adv-r.hadley.nz/"
-length_weight: "35%"
-cover: "https://adv-r.hadley.nz/cover.png"
-repo: "hadley/adv-r"
+length_weight: "32.8%"
pinned: true
---
-The book is designed primarily for R users who want to improve their programming skills and understanding of the language. It should also be useful for programmers coming to R from other languages, as help you to understand why R works the way it does. [...] This is the website for the 2nd edition of “Advanced R”, a book in Chapman & Hall’s R Series. The book is designed primarily for R users who want to improve their programming skills and understanding of the language. It should also be useful for programmers coming to R from other languages, as it helps you to understand why R works the ...
+View book source This is the website for 2nd edition of “Advanced R”, a book in Chapman & Hall’s R Series. The book is designed primarily for R users who want to improve their programming skills and understanding of the language. It should also be useful for programmers coming to R from other languages, as help you to understand why R works the way it does. If you’re looking for the 1st edition, you can find it at http://adv-r.had.co.nz/. This work, as a whole, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. The code contained in this
book ...
View book source
is a button text that we should not retrieve.
from bookdown.org.
It seems also that some JSON file does not offer content-length
in the header.
str(httr::headers(httr::HEAD("https://advanced-r-solutions.rbind.io/search.json")))
#> List of 16
#> $ date : chr "Mon, 08 Mar 2021 16:48:21 GMT"
#> $ content-type : chr "application/json"
#> $ connection : chr "keep-alive"
#> $ set-cookie : chr "__cfduid=dbb4b62d94d5ea2fdac23cb9cba7f2fa61615222100; expires=Wed, 07-Apr-21 16:48:20 GMT; path=/; domain=.rbin"| __truncated__
#> $ cache-control : chr "public, max-age=0, must-revalidate"
#> $ etag : chr "W/\"cb7a3c92d216f158f69b287f9782556b-ssl\""
#> $ age : chr "2360"
#> $ x-nf-request-id : chr "7c4cca55-d8a8-42bf-a4ea-2a326e13fe5b-65283787"
#> $ cf-cache-status : chr "DYNAMIC"
#> $ cf-request-id : chr "08b4566b890000088332b1d000000001"
#> $ expect-ct : chr "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""
#> $ report-to : chr "{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report?s="| __truncated__
#> $ nel : chr "{\"report_to\":\"cf-nel\",\"max_age\":604800}"
#> $ server : chr "cloudflare"
#> $ cf-ray : chr "62cd8cf27ca50883-CDG"
#> $ content-encoding: chr "gzip"
#> - attr(*, "class")= chr [1:2] "insensitive" "list"
Created on 2021-03-08 by the reprex package (v1.0.0.9002)
This will lead to O length. Do we want to prevent this ?
It would require reading the file probably and maybe we don't want that.
from bookdown.org.
Also a another note on book length: It seems the length of bs4_book() json is different for gitbook()
- as we normalize the length, I think it will reduce the length of all books.
That maybe because json is different. Don't know how we want this to be a useful and correct measure.
from bookdown.org.
I have dealt for bs4_book()
with
- Book cover not in meta but in main page
- Repo url which is in another place we can find
- description creation if none is provided
This should cover most of the case we have. I'll share this in a PR soon
from bookdown.org.
This is mainly taken into account by #64
from bookdown.org.
It seems also that some JSON file does not offer
content-length
in the header.
Just ignore them.
Also a another note on book length: It seems the length of bs4_book() json is different for
gitbook()
- as we normalize the length, I think it will reduce the length of all books.That maybe because json is different. Don't know how we want this to be a useful and correct measure.
The measure doesn't need to be accurate. A rough estimator is fine.
from bookdown.org.
Related Issues (20)
- Issue with weekly build and curl package installation HOT 1
- Add R Developer’s Guide if not present
- Update process regarding new bookdown template
- Remove more demo book
- Fix workflow to update site HOT 6
- Broken link in about page HOT 1
- Commit after unstaging a new book does not trigger rebuild
- Add R Development Guide HOT 6
- Pin tidy finance book on homepage
- Please remove these two book entries
- Update GHA workflow to remove warnings
- Add new book on R Torch HOT 2
- Build error : Failed to retrieve package sources for MASS 7.3-60.0.1 from CRAN HOT 2
- Automate fetching books and publishing the site HOT 8
- When description contains emoji the tags are not correctly matched
- Fix issue with the auto PR creation HOT 1
- Modify staging workflow to work with fork HOT 7
- Change pins code when pins 1.0.0 will be out. HOT 1
- Build error : Failed to retrieve package sources HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bookdown.org.