Skip to content

Commit 4333a4d

Browse files
Display global params in the sidebar
1 parent 8be2779 commit 4333a4d

File tree

269 files changed

+415
-8362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+415
-8362
lines changed

Phakefile.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
6262
$docs = preg_replace( '/ &lt;&lt;/', ' <<', $docs );
6363
$docs = preg_replace( '/&quot;/', '"', $docs );
6464

65+
// Strip global parameters -> added in footer
66+
$docs = preg_replace( '/#?## GLOBAL PARAMETERS.+/s', '', $docs );
67+
6568
$binding['docs'] = $docs;
6669
}
6770

@@ -97,6 +100,7 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
97100

98101
$out = '';
99102

103+
$global_args = array();
100104
foreach ( $config_spec as $key => $details ) {
101105
if ( isset( $details['hidden'] ) || isset( $details['deprecated'] ) )
102106
continue;
@@ -120,9 +124,16 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
120124
$description = ( isset( $details['desc'] ) ) ? $details['desc'] : '';
121125

122126
$out .= render( 'config.mustache', compact( 'config', 'flag', 'default', 'description' ) );
127+
if ( ! empty( $flag ) ) {
128+
$global_args[] = array(
129+
'flag' => $flag,
130+
'description' => $description,
131+
);
132+
}
123133
}
124134

125135
file_put_contents( '_includes/param-list.html', $out );
136+
file_put_contents( '_includes/global-parameters.html', render( 'global-parameters.mustache', array( 'args' => $global_args ) ) );
126137
});
127138

128139
desc( 'Update the /docs/internal-api/ page.' );

_includes/footer.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
</section>
22
</div>
33

4+
{% if page.display_global_parameters %}
5+
{% include global-parameters.html %}
6+
{% endif %}
7+
48
<footer>Project maintained by <a href="https://github.com/danielbachhuber">Daniel Bachhuber</a>. Initial code by <a href="https://github.com/andreascreten">Andreas Creten</a> and <a href="https://github.com/scribu">Cristi Burc&#259;</a>.</footer>
59

610
{% include analytics.html %}

_includes/global-parameters.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<aside class="global-parameters">
2+
3+
<h3>Global Parameters</h3>
4+
5+
<p><code>--path=&lt;path&gt;</code>
6+
Path to the WordPress files.</p>
7+
<p><code>--url=&lt;url&gt;</code>
8+
Pretend request came from given URL. In multisite, this argument is how the target site is specified.</p>
9+
<p><code>--user=&lt;id|login|email&gt;</code>
10+
Set the WordPress user.</p>
11+
<p><code>--skip-plugins[=&lt;plugin&gt;]</code>
12+
Skip loading all or some plugins.</p>
13+
<p><code>--skip-themes[=&lt;theme&gt;]</code>
14+
Skip loading all or some themes.</p>
15+
<p><code>--require=&lt;path&gt;</code>
16+
Load PHP file before running the command (may be used more than once).</p>
17+
<p><code>--[no-]color</code>
18+
Whether to colorize the output.</p>
19+
<p><code>--debug</code>
20+
Show all PHP errors; add verbosity to WP-CLI bootstrap.</p>
21+
<p><code>--prompt</code>
22+
Prompt the user to enter values for all command arguments.</p>
23+
<p><code>--quiet</code>
24+
Suppress informational messages.</p>
25+
26+
</aside>

_includes/header.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
<title>{{ page.title }} | WP-CLI</title>
1515
</head>
1616

17+
{% if page.display_global_parameters %}
18+
<body class="display-global-parameters">
19+
{% else %}
1720
<body>
21+
{% endif %}
1822

1923
<header class="cf">
2024
<div class="container">
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<aside class="global-parameters">
2+
3+
<h3>Global Parameters</h3>
4+
5+
{{#args}}
6+
<p><code>{{flag}}</code>
7+
{{description}}</p>
8+
{{/args}}
9+
10+
</aside>

_templates/subcmd-list.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: default
33
title: 'wp {{synopsis}}'
4+
display_global_parameters: true
45
---
56

67
`wp {{synopsis}}` - {{description}}

assets/css/stylesheet.css

Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ body {
2424
/* General & 'Reset' Stuff */
2525

2626
.container {
27-
width: 90%;
28-
max-width: 800px;
27+
width: 100%;
28+
max-width: 880px;
2929
margin: 0 auto;
30+
padding: 0 20px;
3031
}
3132

3233
section {
@@ -301,7 +302,7 @@ footer {
301302
display: block;
302303
text-align: center;
303304
font-size: 10px;
304-
margin: 20px 10px 10px 10px;
305+
margin: 20px 10px 40px 10px;
305306
}
306307

307308
.main-nav {
@@ -397,9 +398,26 @@ footer {
397398
/**
398399
* Main Content
399400
*/
401+
body.display-global-parameters {
402+
overflow-x: hidden;
403+
}
404+
405+
body.display-global-parameters #main_content {
406+
width: 65%;
407+
float: left;
408+
}
409+
410+
@media (max-width: 690px) {
411+
body.display-global-parameters #main_content{
412+
width: 100%;
413+
}
414+
}
400415

401416
#main_content {
402417
width: 100%;
418+
padding: 0 20px;
419+
margin: 0 -20px;
420+
box-sizing: border-box;
403421
-webkit-font-smoothing: antialiased;
404422
}
405423

@@ -433,6 +451,75 @@ footer {
433451
/*margin: 0 0 .3em 0;*/
434452
}
435453

454+
/**
455+
* Global Parameters
456+
*/
457+
458+
.global-parameters {
459+
width: 35%;
460+
float: right;
461+
margin: 0 -20px 40px -20px;
462+
padding: 0 20px;
463+
color: #888;
464+
background: #fff;
465+
font-size: 14px;
466+
box-sizing: border-box;
467+
padding-left: 30px
468+
}
469+
470+
@media (max-width: 690px) {
471+
.global-parameters {
472+
width: auto;
473+
margin:0;
474+
float: none;
475+
padding-left: 40px;
476+
padding-right: 40px;
477+
}
478+
}
479+
480+
481+
.global-parameters h3{
482+
text-transform: uppercase;
483+
color: #888;
484+
font-weight: bold;
485+
font-size: 16px;
486+
margin-left: -20px;
487+
}
488+
.global-parameters code {
489+
background: none;
490+
display: block;
491+
font-size: 14px;
492+
color: #0074A2;
493+
font-weight: bold;
494+
text-shadow: none;
495+
margin-left: -20px;
496+
}
497+
498+
.global-parameters p {
499+
margin-bottom: 5px;
500+
}
501+
502+
// Adjust visibility per page
503+
body.command-line-interface-for-wordpress .global-parameters,
504+
body.configuration .global-parameters{
505+
display: none;
506+
background: green;
507+
}
508+
509+
body.configuration .global-parameters{
510+
display: none;
511+
background: green;
512+
}
513+
514+
515+
.blog aside.global-parameters {
516+
display: none;
517+
}
518+
519+
.command-line-interface-for-wordpress #main_content,
520+
.blog #main_content {
521+
width: 100%;
522+
}
436523

437524

438525
/* Buttons */

commands/cache/add/index.md

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: default
33
title: 'wp cache add'
4+
display_global_parameters: true
45
---
56

67
`wp cache add` - Add a value to the object cache.
@@ -21,37 +22,5 @@ If a value already exists for the key, the value isn't added.
2122
[&lt;expiration&gt;]
2223
: Define how long to keep the value, in seconds. Defaults to 0 (as long as possible).
2324

24-
### GLOBAL PARAMETERS
25-
26-
\--path=&lt;path&gt;
27-
Path to the WordPress files.
28-
29-
\--url=&lt;url&gt;
30-
Pretend request came from given URL. In multisite, this argument is how the target site is specified.
31-
32-
\--user=&lt;id|login|email&gt;
33-
Set the WordPress user.
34-
35-
\--skip-plugins[=&lt;plugin&gt;]
36-
Skip loading all or some plugins.
37-
38-
\--skip-themes[=&lt;theme&gt;]
39-
Skip loading all or some themes.
40-
41-
\--require=&lt;path&gt;
42-
Load PHP file before running the command (may be used more than once).
43-
44-
\--[no-]color
45-
Whether to colorize the output.
46-
47-
\--debug
48-
Show all PHP errors; add verbosity to WP-CLI bootstrap.
49-
50-
\--prompt
51-
Prompt the user to enter values for all command arguments.
52-
53-
\--quiet
54-
Suppress informational messages.
55-
5625

5726

commands/cache/decr/index.md

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: default
33
title: 'wp cache decr'
4+
display_global_parameters: true
45
---
56

67
`wp cache decr` - Decrement a value in the object cache.
@@ -16,37 +17,5 @@ title: 'wp cache decr'
1617
[&lt;group&gt;]
1718
: Method for grouping data within the cache which allows the same key to be used across groups.
1819

19-
### GLOBAL PARAMETERS
20-
21-
\--path=&lt;path&gt;
22-
Path to the WordPress files.
23-
24-
\--url=&lt;url&gt;
25-
Pretend request came from given URL. In multisite, this argument is how the target site is specified.
26-
27-
\--user=&lt;id|login|email&gt;
28-
Set the WordPress user.
29-
30-
\--skip-plugins[=&lt;plugin&gt;]
31-
Skip loading all or some plugins.
32-
33-
\--skip-themes[=&lt;theme&gt;]
34-
Skip loading all or some themes.
35-
36-
\--require=&lt;path&gt;
37-
Load PHP file before running the command (may be used more than once).
38-
39-
\--[no-]color
40-
Whether to colorize the output.
41-
42-
\--debug
43-
Show all PHP errors; add verbosity to WP-CLI bootstrap.
44-
45-
\--prompt
46-
Prompt the user to enter values for all command arguments.
47-
48-
\--quiet
49-
Suppress informational messages.
50-
5120

5221

commands/cache/delete/index.md

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: default
33
title: 'wp cache delete'
4+
display_global_parameters: true
45
---
56

67
`wp cache delete` - Remove a value from the object cache.
@@ -13,37 +14,5 @@ title: 'wp cache delete'
1314
[&lt;group&gt;]
1415
: Method for grouping data within the cache which allows the same key to be used across groups.
1516

16-
### GLOBAL PARAMETERS
17-
18-
\--path=&lt;path&gt;
19-
Path to the WordPress files.
20-
21-
\--url=&lt;url&gt;
22-
Pretend request came from given URL. In multisite, this argument is how the target site is specified.
23-
24-
\--user=&lt;id|login|email&gt;
25-
Set the WordPress user.
26-
27-
\--skip-plugins[=&lt;plugin&gt;]
28-
Skip loading all or some plugins.
29-
30-
\--skip-themes[=&lt;theme&gt;]
31-
Skip loading all or some themes.
32-
33-
\--require=&lt;path&gt;
34-
Load PHP file before running the command (may be used more than once).
35-
36-
\--[no-]color
37-
Whether to colorize the output.
38-
39-
\--debug
40-
Show all PHP errors; add verbosity to WP-CLI bootstrap.
41-
42-
\--prompt
43-
Prompt the user to enter values for all command arguments.
44-
45-
\--quiet
46-
Suppress informational messages.
47-
4817

4918

0 commit comments

Comments
 (0)