Version 1.1 release
diff --git a/docs/using_kableExtra_in_radix.html b/docs/using_kableExtra_in_radix.html
index b719724..70a336c 100644
--- a/docs/using_kableExtra_in_radix.html
+++ b/docs/using_kableExtra_in_radix.html
@@ -25,8 +25,8 @@
<!-- https://schema.org/Article -->
- <meta property="article:published" itemprop="datePublished" content="2018-10-16" />
- <meta property="article:created" itemprop="dateCreated" content="2018-10-16" />
+ <meta property="article:published" itemprop="datePublished" content="2019-03-15" />
+ <meta property="article:created" itemprop="dateCreated" content="2019-03-15" />
<meta name="article:author" content="Hao Zhu" />
<!-- https://developers.facebook.com/docs/sharing/webmasters#markup -->
@@ -44,7 +44,7 @@
<!--radix_placeholder_rmarkdown_metadata-->
<script type="text/json" id="radix-rmarkdown-metadata">
- {"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["title","description","author","date","output"]}},"value":[{"type":"character","attributes":{},"value":["Using kableExtra in Radix"]},{"type":"character","attributes":{},"value":["A new article describing how to use kableExtra in Radix\n"]},{"type":"list","attributes":{},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","url"]}},"value":[{"type":"character","attributes":{},"value":["Hao Zhu"]},{"type":"character","attributes":{},"value":["https://github.com/haozhu233"]}]}]},{"type":"character","attributes":{},"value":["2018-10-16"]},{"type":"character","attributes":{},"value":["radix::radix_article"]}]}
+ {"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["title","description","author","date","output"]}},"value":[{"type":"character","attributes":{},"value":["Using kableExtra in Radix"]},{"type":"character","attributes":{},"value":["A new article describing how to use kableExtra in Radix\n"]},{"type":"list","attributes":{},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","url"]}},"value":[{"type":"character","attributes":{},"value":["Hao Zhu"]},{"type":"character","attributes":{},"value":["https://github.com/haozhu233"]}]}]},{"type":"character","attributes":{},"value":["2019-03-15"]},{"type":"character","attributes":{},"value":["radix::radix_article"]}]}
</script>
<!--/radix_placeholder_rmarkdown_metadata-->
@@ -65,6 +65,10 @@
width: 100%;
}
+ .pandoc-table>caption {
+ margin-bottom: 10px;
+ }
+
.pandoc-table th:not([align]) {
text-align: left;
}
@@ -81,6 +85,10 @@
padding-right: 16px;
}
+ .l-screen .caption {
+ margin-left: 10px;
+ }
+
.shaded {
background: rgb(247, 247, 247);
padding-top: 20px;
@@ -188,6 +196,10 @@
/* Tweak code blocks (note that this CSS is repeated above in an injection
into the d-code shadow dom) */
+ d-code {
+ overflow-x: auto !important;
+ }
+
pre.d-code code.d-code {
padding-left: 10px;
font-size: 12px;
@@ -218,6 +230,11 @@
}
@media(min-width: 768px) {
+
+ d-code {
+ overflow-x: visible !important;
+ }
+
pre.d-code code.d-code {
padding-left: 18px;
font-size: 14px;
@@ -600,9 +617,9 @@
var fn = $('#' + id);
var fn_p = $('#' + id + '>p');
fn_p.find('.footnote-back').remove();
- var text = fn_p.text();
+ var text = fn_p.html();
var dtfn = $('<d-footnote></d-footnote>');
- dtfn.text(text);
+ dtfn.html(text);
$(this).replaceWith(dtfn);
});
// remove footnotes
@@ -628,7 +645,10 @@
var clz = "";
var language = pre.attr('class');
if (language) {
- if ($.inArray(language, ["r", "cpp", "c", "java"]) != -1)
+ // map unknown languages to "clike" (without this they just dissapear)
+ if ($.inArray(language, ["bash", "clike", "css", "go", "html",
+ "javascript", "js", "julia", "lua", "markdown",
+ "markup", "mathml", "python", "svg", "xml"]) == -1)
language = "clike";
language = ' language="' + language + '"';
var dt_code = $('<d-code block' + language + clz + '></d-code>');
@@ -843,9 +863,19 @@
// prevent underline for linked images
$('a > img').parent().css({'border-bottom' : 'none'});
- // mark figures created by knitr chunks as 100% width
+ // mark non-body figures created by knitr chunks as 100% width
$('.layout-chunk').each(function(i, val) {
- $(this).find('img, .html-widget').css('width', '100%');
+ var figures = $(this).find('img, .html-widget');
+ if ($(this).attr('data-layout') !== "l-body") {
+ figures.css('width', '100%');
+ } else {
+ figures.css('max-width', '100%');
+ figures.filter("[width]").each(function(i, val) {
+ var fig = $(this);
+ fig.css('width', fig.attr('width') + 'px');
+ });
+
+ }
});
// auto-append index.html to post-preview links in file: protocol
@@ -857,7 +887,7 @@
// get rid of index.html references in header
if (window.location.protocol !== "file:") {
- $('.radix-site-header a').each(function(i,val) {
+ $('.radix-site-header a[href]').each(function(i,val) {
$(this).attr('href', $(this).attr('href').replace("index.html", "./"));
});
}
@@ -866,6 +896,8 @@
$('tr.header').parent('thead').parent('table').addClass('pandoc-table');
$('.kable-table').children('table').addClass('pandoc-table');
+ // add figcaption style to table captions
+ $('caption').parent('table').addClass("figcaption");
// initialize posts list
if (window.init_posts_list)
@@ -877,6 +909,7 @@
$('#disqus_thread').toggleClass('hidden');
if (!$('#disqus_thread').hasClass('hidden')) {
var offset = $(this).offset();
+ $(window).resize();
$('html, body').animate({
scrollTop: offset.top - 35
});
@@ -895,13 +928,14 @@
<!--/radix_placeholder_distill-->
<script>$(document).ready(function(){
- $('[data-toggle="tooltip"]').tooltip();
- $('[data-toggle="popover"]').popover();
+ if (typeof $('[data-toggle="tooltip"]').tooltip === 'function') {
+ $('[data-toggle="tooltip"]').tooltip();
+ }
+ if ($('[data-toggle="popover"]').popover === 'function') {
+ $('[data-toggle="popover"]').popover();
+ }
});
</script>
- <style type="text/css">
-table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:14px;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}
-</style>
<style type="text/css">.pagedtable {
overflow: auto;
padding-left: 8px;
@@ -3184,7 +3218,7 @@
<!--radix_placeholder_front_matter-->
<script id="distill-front-matter" type="text/json">
-{"title":"Using kableExtra in Radix","description":"A new article describing how to use kableExtra in Radix","authors":[{"author":"Hao Zhu","authorURL":"https://github.com/haozhu233","affiliation":" ","affiliationURL":"#"}],"publishedDate":"2018-10-16T00:00:00.000-04:00","citationText":"Zhu, 2018"}
+{"title":"Using kableExtra in Radix","description":"A new article describing how to use kableExtra in Radix","authors":[{"author":"Hao Zhu","authorURL":"https://github.com/haozhu233","affiliation":" ","affiliationURL":"#"}],"publishedDate":"2019-03-15T00:00:00.000-04:00","citationText":"Zhu, 2019"}
</script>
<!--/radix_placeholder_front_matter-->
@@ -3201,16 +3235,18 @@
<div class="d-byline">
Hao Zhu <a href="https://github.com/haozhu233" class="uri">https://github.com/haozhu233</a>
-<br />2018-10-16
+<br />2019-03-15
</div>
<div class="d-article">
+<p><strong>Starting from kableExtra 1.1.0, you don’t need to turn on this option as it’s turned on by default for Radix and gitbook, for everyone’s convenience. This Documentation is here to help you understand the logics behind the scene. </strong></p>
+<p><strong>If you want to this kind of native support to other html format, please submit a PR and add the template name to <a href="https://github.com/haozhu233/kableExtra/blob/f3b6aa4bf1648979bbf48bb6f827755387eebed5/R/zzz.R#L23">this line</a>.</strong></p>
<p>People may find some features in <code>kableExtra</code>, such as hovering/striped rows are not working in <code>radix</code>. The reason is that <code>kableExtra</code> relies on <code>bootstrap</code> stylesheet to do these jobs while <code>radix</code> doesn’t have those css load. Therefore you need to tell <code>kableExtra</code> to load the table css for you by setting <code>options(kableExtra.html.bsTable = T)</code>.</p>
<div class="layout-chunk" data-layout="l-body">
<pre class="r"><code>
library(kableExtra)
-options(kableExtra.html.bsTable = T)
+# options(kableExtra.html.bsTable = T) # No need for version 1.1.0+
kable(iris[1:6, ], caption = "kable with kableExtra") %>%
kable_styling(c("striped", "hover", "condensed"), full_width = F,
@@ -3220,7 +3256,7 @@
row_spec(0, italic = T)</code></pre>
<table class="table table-striped table-hover table-condensed" style="width: auto !important; ">
<caption>
-kable with kableExtra
+<span id="tab:unnamed-chunk-1">Table 1: </span>kable with kableExtra
</caption>
<thead>
<tr>
@@ -3366,7 +3402,7 @@
kable(iris[1:6, ], caption = "Basic kable")</code></pre>
<table>
<caption>
-Basic kable
+<span id="tab:unnamed-chunk-2">Table 2: </span>Basic kable
</caption>
<thead>
<tr>