Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Allow for readme.md file to have a title different than readme.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Dec 4, 2018
1 parent c21a863 commit 24d4fde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion class-wordpress-readme-parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function ( $tag ) {

// Render metadata
$markdown = "<!-- DO NOT EDIT THIS FILE; it is auto-generated from readme.txt -->\n";
$markdown .= sprintf( "# %s\n", $this->title );
$markdown .= sprintf( "# %s\n", empty( $params['title'] ) ? $this->title : $params['title'] );
$markdown .= "\n";
if ( file_exists( $params['assets_dir'] . '/banner-1544x500.png' ) ) {
$markdown .= "![Banner]({$params['assets_dir']}/banner-1544x500.png)";
Expand Down
3 changes: 3 additions & 0 deletions generate-markdown-readme
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ try {
}
}

if ( isset( $env_vars['README_MD_TITLE'] ) ) {
$md_args['title'] = $env_vars['README_MD_TITLE'];
}
if ( isset( $env_vars['COVERALLS_BADGE'] ) ) {
$coveralls_badge = $env_vars['COVERALLS_BADGE'];
}
Expand Down

0 comments on commit 24d4fde

Please sign in to comment.