/
build_site.html
263 lines (224 loc) · 10.1 KB
/
build_site.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Build pkgdown website — build_site • pkgdown</title>
<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<!-- mathjax -->
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">pkgdown</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../articles/pkgdown.html">Intro</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hadley/pkgdown">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Build pkgdown website</h1>
</div>
<p><code>build_site()</code> is a convenient wrapper around four functions:
<ul>
<li> <code><a href='build_articles.html'>build_articles</a>()</code>
</li>
<li> <code><a href='build_home.html'>build_home</a>()</code>
</li>
<li> <code><a href='build_reference.html'>build_reference</a>()</code>
</li>
<li> <code><a href='build_news.html'>build_news</a>()</code>
</li>
</ul></p>
<p>See the documentation for the each function to learn how to control
that aspect of the site.</p>
<pre><span class='fu'>build_site</span>(<span class='kw'>pkg</span> <span class='kw'>=</span> <span class='st'>"."</span>, <span class='kw'>path</span> <span class='kw'>=</span> <span class='st'>"docs"</span>, <span class='kw'>examples</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>run_dont_run</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>mathjax</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>preview</span> <span class='kw'>=</span> <span class='fu'>interactive</span>(),
<span class='kw'>seed</span> <span class='kw'>=</span> <span class='fl'>1014</span>)
<span class='fu'>init_site</span>(<span class='kw'>pkg</span> <span class='kw'>=</span> <span class='st'>"."</span>, <span class='kw'>path</span> <span class='kw'>=</span> <span class='st'>"docs"</span>)</pre>
<h2 class="hasAnchor" id="arguments">
<a class="anchor" href="#arguments"></a>
Arguments
</h2>
<dl class="dl-horizontal">
<dt>pkg</dt>
<dd>Path to source package.</dd>
<dt>path</dt>
<dd>Location in which to save website, relative to package
path.</dd>
<dt>examples</dt>
<dd>Run examples?</dd>
<dt>run_dont_run</dt>
<dd>Run examples that are surrounded in \dontrun?</dd>
<dt>mathjax</dt>
<dd>Use mathjax to render math symbols?</dd>
<dt>preview</dt>
<dd>If <code>TRUE</code>, will preview freshly generated site</dd>
<dt>seed</dt>
<dd>Seed used to initialize so that random examples are
reproducible.</dd>
</dl>
<h2 class="hasAnchor" id="yaml-config"><a class="anchor" href="#yaml-config"></a>YAML config</h2>
<p></p>
<p>There are five top-level YAML settings that affect the entire site:
<code>title</code>, <code>template</code>, and <code>navbar</code>.</p>
<p><code>title</code> overrides the default site title, which is the package name.
It's used in the page title and default navbar.</p>
<p>You can also provided information to override the default display of
the authors. Provided a list named with the name of each author,
including <code>href</code> to add a link, or <code>html</code> to override the
text:</p>
<p><pre>
authors:
Hadley Wickham:
href: http://hadley.nz
RStudio:
href: https://www.rstudio.com
html: <img src="http://tidyverse.org/rstudio-logo.svg" height="24" />
</pre></p>
<h2 class="hasAnchor" id="yaml-config-navbar"><a class="anchor" href="#yaml-config-navbar"></a>YAML config - navbar</h2>
<p></p>
<p><code>navbar</code> controls the navbar at the top of the page. It uses the same
syntax as <a href = 'http://rmarkdown.rstudio.com/rmarkdown_websites.html#site_navigation'>RMarkdown</a>.
The following YAML snippet illustrates some of the most important features.</p>
<p><pre>
navbar:
type: inverse
left:
- text: "Home"
href: index.html
- text: "Reference"
href: reference/index.html
- text: "Articles"
menu:
- text: "Heading 1"
- text: "Article A"
href: articles/page_a.html
- text: "Article B"
href: articles/page_b.html
- text: "---------"
- text: "Heading 2"
- text: "Article C"
href: articles/page_c.html
- text: "Article D"
href: articles/page_d.html
right:
- icon: fa-github fa-lg
href: https://example.com
</pre></p>
<p>Use <code>type</code> to choose between "default" and "inverse" themes.</p>
<p>You position elements by placing under either <code>left</code> or <code>right</code>.
Components can contain sub-<code>menu</code>s with headings (indicated by missing
<code>href</code>) and separators. Currently pkgdown only supports fontawesome
icons. You can see a full list of options at
<a href = 'http://fontawesome.io/icons/'>http://fontawesome.io/icons/</a>.</p>
<p>Any missing components (<code>type</code>, <code>left</code>, or <code>right</code>)
will be automatically filled in from the default navbar: you can see
those values by running <code><a href='template_navbar.html'>template_navbar</a>()</code>.</p>
<h2 class="hasAnchor" id="yaml-config-template"><a class="anchor" href="#yaml-config-template"></a>YAML config - template</h2>
<p></p>
<p>You can get complete control over the appearance of the site using the
<code>template</code> component. There are two components to the template:
the HTML templates used to layout each page, and the css/js assets
used to render the page in the browser.</p>
<p>The easiest way to tweak the default style is to use a bootswatch template,
by passing on the <code>bootswatch</code> template parameter to the built-in
template:</p>
<p><pre>
template:
params:
bootswatch: cerulean
</pre></p>
<p>See a complete list of themes and preview how they look at
<a href = 'https://gallery.shinyapps.io/117-shinythemes/'>https://gallery.shinyapps.io/117-shinythemes/</a>:</p>
<p>You can also override the default templates and provide additional
assets. You can do so by either storing in a <code>package</code> with
directories <code>inst/pkgdown/assets</code> and <code>inst/pkgdown/templates</code>,
or by supplying <code>path</code> and <code>asset_path</code>. To suppress inclusion
of the default assets, set <code>default_assets</code> to false.</p>
<p><pre>
template:
package: mycustompackage</p>
<p># OR:</p>
<p>template:
path: path/to/templates
assets: path/to/assets
default_assets: false
</pre></p>
<p>These settings are currently recommended for advanced users only. There
is little documentation, and you'll need to read the existing source
for pkgdown templates to ensure that you use the correct components.</p>
<h2 class="hasAnchor" id="examples">
<a class="anchor" href="#examples"></a>
Examples
</h2>
<pre class="examples"><div class='input'><span class='co'>## Not run: ------------------------------------</span>
<span class='co'># build_site()</span>
<span class='co'>## ---------------------------------------------</span></div></pre>
</div>
<div class="col-md-3 hidden-xs">
<div id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#arguments">Arguments</a></li>
<li><a href="#yaml-config">YAML config</a></li>
<li><a href="#yaml-config-navbar">YAML config - navbar</a></li>
<li><a href="#yaml-config-template">YAML config - template</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
</div>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by <a href='http://hadley.nz'>Hadley Wickham</a>, <a href='https://www.rstudio.com'><img src='http://tidyverse.org/rstudio-logo.svg' height='24' /></a>.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>