Skip to content

Commit

Permalink
Revert "[#2021] DOC: clarify Format Specifier errors"
Browse files Browse the repository at this point in the history
This reverts commit f168d8e.
  • Loading branch information
remkop committed May 6, 2023
1 parent f168d8e commit 8bcafaa
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 153 deletions.
2 changes: 1 addition & 1 deletion docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6634,7 +6634,7 @@ These are converted to the platform-specific line separator when the usage help

See the https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html[java.util.Formatter JavaDoc] for details.

IMPORTANT: Note that to show percent `'%'` characters in the usage help message, they need to be escaped with another `%`. For example: `@Parameters(description = "%%-age of the total")` is rendered as `%-age of the total`. Unescaped `'%'` characters in the usage help message may result in picocli printing "Unrecognized conversion specifier" errors to the console.
IMPORTANT: Note that to show percent `'%'` characters in the usage help message, they need to be escaped with another `%`. For example: `@Parameters(description = "%%-age of the total")` is rendered as `%-age of the total`.

An alternative way to control the layout of the usage help message is that some sections (`header`, `footer`, and `description`) can be specified as an array of Strings,
where each element of the array is displayed on a separate line in the usage help message.
Expand Down
229 changes: 77 additions & 152 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1709,156 +1709,81 @@
});
});
</script>
<style>

.hidden {

display: none;

}



.switch {

border-width: 1px 1px 0 1px;

border-style: solid;

border-color: #7a2518;

display: inline-block;

}



.switch--item {

padding: 10px;

background-color: #ffffff;

color: #7a2518;

display: inline-block;

cursor: pointer;

}



.switch--item.selected {

background-color: #7a2519;

color: #ffffff;

}



</style>

<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>

<script type="text/javascript">

function addBlockSwitches() {

$('.primary').each(function() {

primary = $(this);

createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");

primary.children('.title').remove();

});

$('.secondary').each(function(idx, node) {

secondary = $(node);

primary = findPrimary(secondary);

switchItem = createSwitchItem(secondary, primary.children('.switch'));

switchItem.content.addClass('hidden');

findPrimary(secondary).append(switchItem.content);

secondary.remove();

});

}



function createBlockSwitch(primary) {

blockSwitch = $('<div class="switch"></div>');

primary.prepend(blockSwitch);

return blockSwitch;

}



function findPrimary(secondary) {

candidate = secondary.prev();

while (!candidate.is('.primary')) {

candidate = candidate.prev();

}

return candidate;

}



function createSwitchItem(block, blockSwitch) {

blockName = block.children('.title').text();

content = block.children('.content').first().append(block.next('.colist'));

item = $('<div class="switch--item">' + blockName + '</div>');

item.on('click', '', content, function(e) {

$(this).addClass('selected');

$(this).siblings().removeClass('selected');

e.data.siblings('.content').addClass('hidden');

e.data.removeClass('hidden');

});

blockSwitch.append(item);

return {'item': item, 'content': content};

}



$(addBlockSwitches);



</script>

<style>
.hidden {
display: none;
}

.switch {
border-width: 1px 1px 0 1px;
border-style: solid;
border-color: #7a2518;
display: inline-block;
}

.switch--item {
padding: 10px;
background-color: #ffffff;
color: #7a2518;
display: inline-block;
cursor: pointer;
}

.switch--item.selected {
background-color: #7a2519;
color: #ffffff;
}

</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
<script type="text/javascript">
function addBlockSwitches() {
$('.primary').each(function() {
primary = $(this);
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
primary.children('.title').remove();
});
$('.secondary').each(function(idx, node) {
secondary = $(node);
primary = findPrimary(secondary);
switchItem = createSwitchItem(secondary, primary.children('.switch'));
switchItem.content.addClass('hidden');
findPrimary(secondary).append(switchItem.content);
secondary.remove();
});
}

function createBlockSwitch(primary) {
blockSwitch = $('<div class="switch"></div>');
primary.prepend(blockSwitch);
return blockSwitch;
}

function findPrimary(secondary) {
candidate = secondary.prev();
while (!candidate.is('.primary')) {
candidate = candidate.prev();
}
return candidate;
}

function createSwitchItem(block, blockSwitch) {
blockName = block.children('.title').text();
content = block.children('.content').first().append(block.next('.colist'));
item = $('<div class="switch--item">' + blockName + '</div>');
item.on('click', '', content, function(e) {
$(this).addClass('selected');
$(this).siblings().removeClass('selected');
e.data.siblings('.content').addClass('hidden');
e.data.removeClass('hidden');
});
blockSwitch.append(item);
return {'item': item, 'content': content};
}

$(addBlockSwitches);

</script>

</head>
<body class="article toc2 toc-left">
Expand Down Expand Up @@ -10635,7 +10560,7 @@ <h3 id="_format_specifiers"><a class="anchor" href="#_format_specifiers"></a>14.
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
Note that to show percent <code>'%'</code> characters in the usage help message, they need to be escaped with another <code>%</code>. For example: <code>@Parameters(description = "%%-age of the total")</code> is rendered as <code>%-age of the total</code>. Unescaped <code>'%'</code> characters in the usage help message may result in picocli printing "Unrecognized conversion specifier" errors to the console.
Note that to show percent <code>'%'</code> characters in the usage help message, they need to be escaped with another <code>%</code>. For example: <code>@Parameters(description = "%%-age of the total")</code> is rendered as <code>%-age of the total</code>.
</td>
</tr>
</table>
Expand Down Expand Up @@ -19211,4 +19136,4 @@ <h3 id="_source"><a class="anchor" href="#_source"></a>37.2. Source</h3>
handleTocOnResize();
</script>
</body>
</html>
</html>

0 comments on commit 8bcafaa

Please sign in to comment.