50
50
}
51
51
pre .numberSource { margin-left : 3em ; border-left : 1px solid # aaaaaa ; padding-left : 4px ; }
52
52
div .sourceCode
53
- { }
53
+ { color : # 00769e ; background-color : # f1f3f5 ; }
54
54
@media screen {
55
55
pre > code .sourceCode > span > a : first-child ::before { text-decoration : underline; }
56
56
}
57
+ code span { color : # 00769e ; } /* Normal */
57
58
code span .al { color : # ad0000 ; } /* Alert */
58
59
code span .an { color : # 5e5e5e ; } /* Annotation */
59
- code span .at { } /* Attribute */
60
+ code span .at { color : # 657422 ; } /* Attribute */
60
61
code span .bn { color : # ad0000 ; } /* BaseN */
61
62
code span .bu { } /* BuiltIn */
62
- code span .cf { color : # 007ba5 ; } /* ControlFlow */
63
+ code span .cf { color : # 00769e ; } /* ControlFlow */
63
64
code span .ch { color : # 20794d ; } /* Char */
64
65
code span .cn { color : # 8f5902 ; } /* Constant */
65
66
code span .co { color : # 5e5e5e ; } /* Comment */
73
74
code span .fu { color : # 4758ab ; } /* Function */
74
75
code span .im { } /* Import */
75
76
code span .in { color : # 5e5e5e ; } /* Information */
76
- code span .kw { color : # 007ba5 ; } /* Keyword */
77
+ code span .kw { color : # 00769e ; } /* Keyword */
77
78
code span .op { color : # 5e5e5e ; } /* Operator */
78
- code span .ot { color : # 007ba5 ; } /* Other */
79
+ code span .ot { color : # 00769e ; } /* Other */
79
80
code span .pp { color : # ad0000 ; } /* Preprocessor */
80
81
code span .sc { color : # 5e5e5e ; } /* SpecialChar */
81
82
code span .ss { color : # 20794d ; } /* SpecialString */
@@ -1033,10 +1034,6 @@ <h3>${suggestion.title}</h3>
1033
1034
margin-top : 1.5em ;
1034
1035
}
1035
1036
1036
- .figure img {
1037
- width : 100% ;
1038
- }
1039
-
1040
1037
.figure .caption {
1041
1038
color : rgba (0 , 0 , 0 , 0.6 );
1042
1039
font-size : 12px ;
@@ -1866,6 +1863,12 @@ <h3>${suggestion.title}</h3>
1866
1863
1867
1864
// hoverable references
1868
1865
$ ( 'span.citation[data-cites]' ) . each ( function ( ) {
1866
+ if ( $ ( this ) . children ( ) [ 0 ] . nodeName == "D-FOOTNOTE" ) {
1867
+ var fn = $ ( this ) . children ( ) [ 0 ]
1868
+ $ ( this ) . html ( fn . shadowRoot . querySelector ( "sup" ) )
1869
+ $ ( this ) . id = fn . id
1870
+ fn . remove ( )
1871
+ }
1869
1872
var refs = $ ( this ) . attr ( 'data-cites' ) . split ( " " ) ;
1870
1873
var refHtml = refs . map ( function ( ref ) {
1871
1874
return "<p>" + $ ( '#ref-' + ref ) . html ( ) + "</p>" ;
@@ -1881,6 +1884,31 @@ <h3>${suggestion.title}</h3>
1881
1884
} ) ;
1882
1885
} ) ;
1883
1886
1887
+ // fix footnotes in tables (#411)
1888
+ // replacing broken distill.pub feature
1889
+ $ ( 'table d-footnote' ) . each ( function ( ) {
1890
+ // we replace internal showAtNode methode which is triggered when hovering a footnote
1891
+ this . hoverBox . showAtNode = function ( node ) {
1892
+ // ported from https://github.com/distillpub/template/pull/105/files
1893
+ calcOffset = function ( elem ) {
1894
+ let x = elem . offsetLeft ;
1895
+ let y = elem . offsetTop ;
1896
+ // Traverse upwards until an `absolute` element is found or `elem`
1897
+ // becomes null.
1898
+ while ( elem = elem . offsetParent && elem . style . position != 'absolute' ) {
1899
+ x += elem . offsetLeft ;
1900
+ y += elem . offsetTop ;
1901
+ }
1902
+
1903
+ return { left : x , top : y } ;
1904
+ }
1905
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop
1906
+ const bbox = node . getBoundingClientRect ( ) ;
1907
+ const offset = calcOffset ( node ) ;
1908
+ this . show ( [ offset . left + bbox . width , offset . top + bbox . height ] ) ;
1909
+ }
1910
+ } )
1911
+
1884
1912
// clear polling timer
1885
1913
clearInterval ( tid ) ;
1886
1914
@@ -1979,6 +2007,8 @@ <h3>${suggestion.title}</h3>
1979
2007
// mark non-body figures created by knitr chunks as 100% width
1980
2008
$ ( '.layout-chunk' ) . each ( function ( i , val ) {
1981
2009
var figures = $ ( this ) . find ( 'img, .html-widget' ) ;
2010
+ // ignore leaflet img layers (#106)
2011
+ figures = figures . filter ( ':not(img[class*="leaflet"])' )
1982
2012
if ( $ ( this ) . attr ( 'data-layout' ) !== "l-body" ) {
1983
2013
figures . css ( 'width' , '100%' ) ;
1984
2014
} else {
@@ -2001,7 +2031,7 @@ <h3>${suggestion.title}</h3>
2001
2031
// get rid of index.html references in header
2002
2032
if ( window . location . protocol !== "file:" ) {
2003
2033
$ ( '.distill-site-header a[href]' ) . each ( function ( i , val ) {
2004
- $ ( this ) . attr ( 'href' , $ ( this ) . attr ( 'href' ) . replace ( " index. html" , "./" ) ) ;
2034
+ $ ( this ) . attr ( 'href' , $ ( this ) . attr ( 'href' ) . replace ( / ^ i n d e x [ . ] h t m l / , "./" ) ) ;
2005
2035
} ) ;
2006
2036
}
2007
2037
@@ -2040,7 +2070,7 @@ <h3>${suggestion.title}</h3>
2040
2070
</ script >
2041
2071
2042
2072
<!--/radix_placeholder_distill-->
2043
- < script src ="site_libs/header-attrs-2.13 /header-attrs.js "> </ script >
2073
+ < script src ="site_libs/header-attrs-2.16 /header-attrs.js "> </ script >
2044
2074
< script src ="site_libs/popper-2.6.0/popper.min.js "> </ script >
2045
2075
< link href ="site_libs/tippy-6.2.7/tippy.css " rel ="stylesheet " />
2046
2076
< link href ="site_libs/tippy-6.2.7/tippy-light-border.css " rel ="stylesheet " />
@@ -2130,48 +2160,44 @@ <h3 id="tips">Tips</h3>
2130
2160
< h4 id ="clone-or-fork-from-github "> Clone or fork from GitHub</ h4 >
2131
2161
< div class ="layout-chunk " data-layout ="l-body ">
2132
2162
< div class ="sourceCode ">
2133
- < pre class ="sourceCode r "> < code class ="sourceCode r "> < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/create_from_github.html '> create_from_github</ a > </ span > < span class ='op '> (</ span > < span class ='st '> "https://github.com/data-and-visualization/git-tutorial"</ span > < span class ='op '> )</ span >
2134
- </ code > </ pre >
2163
+ < pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/create_from_github.html '> create_from_github</ a > </ span > < span class ='op '> (</ span > < span class ='st '> "https://github.com/data-and-visualization/git-tutorial"</ span > < span class ='op '> )</ span > </ span > </ code > </ pre >
2135
2164
</ div >
2136
2165
</ div >
2137
2166
< h4 id ="create-the-github-repo-from-local "> Create the GitHub repo from
2138
2167
local</ h4 >
2139
2168
< div class ="layout-chunk " data-layout ="l-body ">
2140
2169
< div class ="sourceCode ">
2141
- < pre class ="sourceCode r "> < code class ="sourceCode r "> < span class ='kw '> < a href ='https://rdrr.io/r/base/library.html '> library</ a > </ span > < span class ='op '> (</ span > < span class ='va '> < a href ='https://usethis.r-lib.org '> usethis</ a > </ span > < span class ='op '> )</ span >
2142
- < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/use_git.html '> use_git</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > < span class ='co '> # initialize a git repo</ span >
2143
- < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/use_git_ignore.html '> use_git_ignore</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2144
- < span class ='fu '> use_readme.Rmd</ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2145
- < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/licenses.html '> use_ccby_license</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2146
- < span class ='co '> # Before next step → stage & commit changes</ span >
2147
- < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/use_github.html '> use_github</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > < span class ='co '> # Connect local repo to GitHub</ span >
2148
- </ code > </ pre >
2170
+ < pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='kw '> < a href ='https://rdrr.io/r/base/library.html '> library</ a > </ span > < span class ='op '> (</ span > < span class ='va '> < a href ='https://usethis.r-lib.org '> usethis</ a > </ span > < span class ='op '> )</ span > </ span >
2171
+ < span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/use_git.html '> use_git</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > < span class ='co '> # initialize a git repo</ span > </ span >
2172
+ < span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/use_git_ignore.html '> use_git_ignore</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2173
+ < span > < span class ='fu '> use_readme.Rmd</ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2174
+ < span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/licenses.html '> use_ccby_license</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2175
+ < span > < span class ='co '> # Before next step → stage & commit changes</ span > </ span >
2176
+ < span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/use_github.html '> use_github</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > < span class ='co '> # Connect local repo to GitHub</ span > </ span > </ code > </ pre >
2149
2177
</ div >
2150
2178
</ div >
2151
2179
< h4 id ="rename-default-branch "> Rename default branch</ h4 >
2152
2180
< div class ="layout-chunk " data-layout ="l-body ">
2153
2181
< div class ="sourceCode ">
2154
- < pre class ="sourceCode r "> < code class ="sourceCode r "> < span class ='kw '> < a href ='https://rdrr.io/r/base/library.html '> library</ a > </ span > < span class ='op '> (</ span > < span class ='va '> < a href ='https://usethis.r-lib.org '> usethis</ a > </ span > < span class ='op '> )</ span >
2155
- < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git-default-branch.html '> git_default_branch</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2156
- < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git-default-branch.html '> git_default_branch_rename</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2157
- < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git-default-branch.html '> git_default_branch_rediscover</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2158
- </ code > </ pre >
2182
+ < pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='kw '> < a href ='https://rdrr.io/r/base/library.html '> library</ a > </ span > < span class ='op '> (</ span > < span class ='va '> < a href ='https://usethis.r-lib.org '> usethis</ a > </ span > < span class ='op '> )</ span > </ span >
2183
+ < span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git-default-branch.html '> git_default_branch</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2184
+ < span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git-default-branch.html '> git_default_branch_rename</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2185
+ < span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git-default-branch.html '> git_default_branch_rediscover</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span > </ code > </ pre >
2159
2186
</ div >
2160
2187
</ div >
2161
2188
< h4 id ="set-up-git-and-manage-github-credentials "> set-up git and manage
2162
2189
GitHub credentials</ h4 >
2163
2190
< div class ="layout-chunk " data-layout ="l-body ">
2164
2191
< div class ="sourceCode ">
2165
- < pre class ="sourceCode r "> < code class ="sourceCode r "> < span class ='co '> # Sign-in to your GitHub account</ span >
2166
- < span class ='co '> # Read: https://usethis.r-lib.org/articles/articles/git-credentials.html</ span >
2167
- < span class ='co '> # Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html</ span >
2168
- < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/github-token.html '> create_github_token</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2169
- < span class ='fu '> gitcreds</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://rdrr.io/pkg/gitcreds/man/gitcreds_get.html '> gitcreds_set</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2170
- < span class ='fu '> gh</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://gh.r-lib.org/reference/gh_whoami.html '> gh_whoami</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2171
- < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git_sitrep.html '> git_sitrep</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2172
- < span class ='
fu '
> usethis
</ span > < span class ='
fu '
> ::
</ span > < span class ='
fu '
> < a href ='
https://usethis.r-lib.org/reference/use_git_config.html '
> use_git_config
</ a > </ span > < span class ='
op '
> (
</ span > user.name
< span class ='
op '
> =
</ span > < span class ='
st '
> "Jane Doe"
</ span > , user.email
< span class ='
op '
> =
</ span > < span class ='
st '
> "
[email protected] "
</ span > < span class ='
op '
> )
</ span >
2173
- < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/git_sitrep.html '> git_sitrep</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span >
2174
- </ code > </ pre >
2192
+ < pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='co '> # Sign-in to your GitHub account</ span > </ span >
2193
+ < span > < span class ='co '> # Read: https://usethis.r-lib.org/articles/articles/git-credentials.html</ span > </ span >
2194
+ < span > < span class ='co '> # Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html</ span > </ span >
2195
+ < span > < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/github-token.html '> create_github_token</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2196
+ < span > < span class ='fu '> gitcreds</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://rdrr.io/pkg/gitcreds/man/gitcreds_get.html '> gitcreds_set</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2197
+ < span > < span class ='fu '> gh</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://gh.r-lib.org/reference/gh_whoami.html '> gh_whoami</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2198
+ < span > < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/github-token.html '> gh_token_help</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span >
2199
+ < span > < span class ='
fu '
> usethis
</ span > < span class ='
fu '
> ::
</ span > < span class ='
fu '
> < a href ='
https://usethis.r-lib.org/reference/use_git_config.html '
> use_git_config
</ a > </ span > < span class ='
op '
> (
</ span > user.name
< span class ='
op '
> =
</ span > < span class ='
st '
> "Jane Doe"
</ span > , user.email
< span class ='
op '
> =
</ span > < span class ='
st '
> "
[email protected] "
</ span > < span class ='
op '
> )
</ span > </ span >
2200
+ < span > < span class ='fu '> usethis</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://usethis.r-lib.org/reference/github-token.html '> gh_token_help</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > </ span > </ code > </ pre >
2175
2201
</ div >
2176
2202
</ div >
2177
2203
< h3 id ="next-level "> Next Level…</ h3 >
0 commit comments