Skip to content

Commit

Permalink
fix: increase header level for readme items (#1402)
Browse files Browse the repository at this point in the history
If there's no package name we need a h1 otherwise some ToC generators
generate weird output.

Bump all existing headers by one level.
  • Loading branch information
achingbrain authored Oct 30, 2023
1 parent 3dd3510 commit e9d9a86
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/check-project/readme/api-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const APIDOCS = (pkg, parentManifest) => {
const ghPages = parseGhPagesUrl(pkg, parentManifest)

return `
## API Docs
# API Docs
* [${ghPages}](${ghPages})
`
Expand Down
2 changes: 1 addition & 1 deletion src/check-project/readme/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const INSTALL = (pkg) => {
}

const nodeInstall = `
## Install
# Install
\`\`\`console
$ npm i ${pkg.name}
Expand Down
8 changes: 4 additions & 4 deletions src/check-project/readme/license.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
*/
const licenses = {
ipfs: (repoOwner, repoName, defaultBranch) => `
## License
# License
Licensed under either of
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
## Contribute
# Contribute
Contributions welcome! Please check out [the issues](https://github.com/${repoOwner}/${repoName}/issues).
Expand All @@ -23,14 +23,14 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
`,
default: (repoOwner, repoName, defaultBranch) => `
## License
# License
Licensed under either of
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
## Contribution
# Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
`
Expand Down
2 changes: 1 addition & 1 deletion src/check-project/readme/structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const STRUCTURE = (monorepoDir, projectDirs) => {
}

return `
## Packages
# Packages
${Object.entries(packages).map(([key, value]) => {
return `* [\`${key}\`](.${key}) ${value}`
Expand Down
4 changes: 2 additions & 2 deletions src/docs/readme-updater-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function load (app) {
*/
function updateModule (comment, manifestPath, readmePath, app) {
const about = `
## About
# About
${
comment.summary
Expand All @@ -85,7 +85,7 @@ ${
.map(item => {
if (item.tag === '@example') {
return `
### Example
## Example
${
item.content
Expand Down

0 comments on commit e9d9a86

Please sign in to comment.