mirror of
https://github.com/jqlang/jq.git
synced 2025-11-16 18:22:22 +03:00
Expand all manual examples in print mode
This commit is contained in:
@@ -97,7 +97,14 @@ h3 code {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-example {
|
@media print {
|
||||||
|
.manual-example {
|
||||||
|
display: block !important;
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-example table {
|
||||||
border-top: 1px solid #E5E5E5;
|
border-top: 1px solid #E5E5E5;
|
||||||
td {
|
td {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ $(function(){
|
|||||||
});
|
});
|
||||||
// add "Run" button to execute examples on jqplay.org
|
// add "Run" button to execute examples on jqplay.org
|
||||||
$(function() {
|
$(function() {
|
||||||
$.each($('table.manual-example'), function(index, value) {
|
$.each($('.manual-example table'), function(index, value) {
|
||||||
$value = $(value)
|
$value = $(value)
|
||||||
var j = $value.find('tr:nth-child(2) td:first').text();
|
var j = $value.find('tr:nth-child(2) td:first').text();
|
||||||
var q = $value.find('.jqprogram').text().replace(/^jq /, '').replace(/^'(.+)'$/, '$1');
|
var q = $value.find('.jqprogram').text().replace(/^jq /, '').replace(/^'(.+)'$/, '$1');
|
||||||
|
|||||||
4
docs/templates/manual.liquid
vendored
4
docs/templates/manual.liquid
vendored
@@ -48,9 +48,9 @@
|
|||||||
<i class="glyphicon glyphicon-chevron-right"></i>
|
<i class="glyphicon glyphicon-chevron-right"></i>
|
||||||
{% if entry.examples[1] %}Examples{%else%}Example{%endif%}
|
{% if entry.examples[1] %}Examples{%else%}Example{%endif%}
|
||||||
</a>
|
</a>
|
||||||
<div id="example{{exampleID}}" class="collapse">
|
<div id="example{{exampleID}}" class="manual-example collapse">
|
||||||
{% for example in entry.examples %}
|
{% for example in entry.examples %}
|
||||||
<table class="manual-example">
|
<table>
|
||||||
<tr><th></th><td class="jqprogram">jq '{{example.program | escape}}'</td></tr>
|
<tr><th></th><td class="jqprogram">jq '{{example.program | escape}}'</td></tr>
|
||||||
<tr><th>Input</th><td>{{example.input | escape}}</td></tr>
|
<tr><th>Input</th><td>{{example.input | escape}}</td></tr>
|
||||||
{% unless example.output[0] %}
|
{% unless example.output[0] %}
|
||||||
|
|||||||
Reference in New Issue
Block a user