Skip to content

Commit

Permalink
fix(usage): usage section was missing its descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie-BitFlight committed Oct 23, 2023
1 parent 8dc2738 commit 4d6e063
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 54 deletions.
83 changes: 45 additions & 38 deletions README.md

Large diffs are not rendered by default.

29 changes: 22 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ inputs:
default: README.md
owner:
description: |
The GitHub Action repository owner. i.e: `bitflight-devops`|`your-gh-username`
The GitHub Action repository owner.
example `bitflight-devops` or `your-gh-username`
required: false
repo:
description: |
The GitHub Action repository name. i.e: `github-action-readme-generator`
The GitHub Action repository name.
example - `github-action-readme-generator`
required: false
save:
description: |
Save the provided values in a `.ghadocs.json` file. This will update any existing `.ghadocs.json` file that is in place.
Save the provided values in a `.ghadocs.json` file.
This will update any existing `.ghadocs.json` file that is in place.
required: false
pretty:
description: |
Expand All @@ -55,7 +58,7 @@ inputs:
required: false
version_prefix:
description: |
Prefix the version with this value (if it isn't already prefixed)
Prefix the version with this value, if it isn't already prefixed
required: false
default: v
versioning_default_branch:
Expand All @@ -65,7 +68,9 @@ inputs:
default: main
title_prefix:
description: |
Add a prefix to the README title
Add a prefix to the README title.
The title template looks like this:
# <brand><prefix><title>
required: false
default: "GitHub Action: "
include_github_version_badge:
Expand All @@ -75,15 +80,25 @@ inputs:
default: true
branding_svg_path:
description: |
Create the branding svg image from the details in `action.yml` then update the README.md file to source the branding svg image from this path.
Use `\<!-- start branding --><!-- stop branding -->` in your template to position the image, or use the input `branding_as_title_prefix: true` to prefix the 'title' with the image.
Create the branding svg image from the branding object in `action.yml`
then save it to this path.
Then update the `README.md` file to source the branding image from this path.
You can use a section template like this:
`\<!-- start branding --><!-- stop branding -->`
or use the action input:
`branding_as_title_prefix: true`
to prefix the 'title' section with the image.
The title template looks like this:
# <brand><prefix><title>
required: false
default: ".github/ghadocs/branding.svg"
branding_as_title_prefix:
default: true
type: boolean
description: |
Prefix the title in the `\<!-- start title -->` section with the svg branding image
The title template looks like this:
# <brand><prefix><title>
runs:
using: "node20"
Expand Down
6 changes: 3 additions & 3 deletions dist/bin/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mjs/prettier.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/mjs/prettier.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/mjs/readme-editor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/mjs/readme-editor.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function wrapDescription(
try {
formattedString = await format(value, {
semi: false,
parser: 'yaml',
parser: 'markdown',
proseWrap: 'always',
});
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion src/readme-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class ReadmeEditor {
this.fileContent = addNewlines
? `${beforeContent}\n${content}\n${afterContent}`
: `${beforeContent}${content}${afterContent}`;
} else if (stopIndex < startIndex) {
} else if (stopIndex < startIndex && name !== 'branding') {
throw new Error(`Start token for section '${name}' must appear before end token`);
}
}
Expand Down

0 comments on commit 4d6e063

Please sign in to comment.