Skip to content

Commit 3243e01

Browse files
Inject /config/ and /commands/ into docs list by default
1 parent 884fc69 commit 3243e01

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Phakefile.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,18 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
213213
task( 'doc-list', function( $app ){
214214
$docs = array(
215215
'Guides' => array(),
216-
'References' => array(),
216+
'References' => array(
217+
'Configuration options' => array(
218+
'path' => '/config/',
219+
'title' => 'Configuration options defining how a command is executed.',
220+
'description' => '',
221+
),
222+
'Built-in commands' => array(
223+
'path' => '/commands/',
224+
'title' => 'Built-in commands',
225+
'description' => 'Commands included in every copy of WP-CLI.',
226+
),
227+
),
217228
'Contributing' => array(),
218229
'Misc' => array(),
219230
);
@@ -232,7 +243,7 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
232243
preg_match( '#description:\s(.+)#', $header, $matches );
233244
$description = ! empty( $matches[1] ) ? $matches[1] : '';
234245
$docs[ $category ][ $title ] = array(
235-
'path' => basename( dirname( $file ) ),
246+
'path' => '/docs/' . basename( dirname( $file ) ) . '/',
236247
'title' => $title,
237248
'description' => $description,
238249
);
@@ -246,7 +257,7 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
246257
$out .= '<ul>' . PHP_EOL;
247258
ksort( $cat_docs );
248259
foreach( $cat_docs as $cat_doc ) {
249-
$out .= '<li><a href="/docs/' . $cat_doc['path'] . '/"><strong>' . $cat_doc['title'] . '</strong></a>';
260+
$out .= '<li><a href="' . $cat_doc['path'] . '"><strong>' . $cat_doc['title'] . '</strong></a>';
250261
if ( ! empty( $cat_doc['description'] ) ) {
251262
$out .= ' - ' . $cat_doc['description'];
252263
}

_includes/doc-list.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ <h3>Guides</h3>
99
<h3>References</h3>
1010

1111
<ul>
12+
<li><a href="/commands/"><strong>Built-in commands</strong></a> - Commands included in every copy of WP-CLI.</li>
13+
<li><a href="/config/"><strong>Configuration options defining how a command is executed.</strong></a></li>
1214
<li><a href="/docs/hosting-companies/"><strong>Hosting Companies</strong></a> - List of hosting companies with WP-CLI installed by default.</li>
1315
<li><a href="/docs/tools/"><strong>Integrated Tools</strong></a> - External projects that integrate with WP-CLI in some form.</li>
1416
<li><a href="/docs/internal-api/"><strong>Internal API</strong></a> - Stable utilities considered safe to use in community commands.</li>

0 commit comments

Comments
 (0)