File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -408,6 +408,7 @@ public function gen_hb_manifest() {
408408 'parent ' => null ,
409409 ];
410410 }
411+
411412 // Internal API pages.
412413 foreach ( glob ( WP_CLI_HANDBOOK_PATH . '/internal-api/*.md ' ) as $ file ) {
413414 $ slug = basename ( $ file , '.md ' );
@@ -426,6 +427,26 @@ public function gen_hb_manifest() {
426427 'parent ' => 'internal-api ' ,
427428 ];
428429 }
430+
431+ // Behat steps pages.
432+ foreach ( glob ( WP_CLI_HANDBOOK_PATH . '/behat-steps/*.md ' ) as $ file ) {
433+ $ slug = basename ( $ file , '.md ' );
434+ $ title = '' ;
435+ $ contents = file_get_contents ( $ file );
436+ if ( preg_match ( '/^#\s(.+)/ ' , $ contents , $ matches ) ) {
437+ $ title = $ matches [1 ];
438+ }
439+ $ manifest [ $ slug ] = [
440+ 'title ' => $ title ,
441+ 'slug ' => $ slug ,
442+ 'markdown_source ' => sprintf (
443+ 'https://github.com/wp-cli/handbook/blob/main/behat-steps/%s.md ' ,
444+ $ slug
445+ ),
446+ 'parent ' => 'ibehat-stepsapi ' ,
447+ ];
448+ }
449+
429450 file_put_contents ( WP_CLI_HANDBOOK_PATH . '/bin/handbook-manifest.json ' , json_encode ( $ manifest , JSON_PRETTY_PRINT ) );
430451 WP_CLI ::success ( 'Generated bin/handbook-manifest.json ' );
431452 }
You can’t perform that action at this time.
0 commit comments