Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
- name: Copy CONTRIBUTING.md into docs
run: |
sed -i -e 's|./docs/||g' hyper/CONTRIBUTING.md
cp -a hyper/CONTRIBUTING.md hyper/docs
cp -a hyper/CONTRIBUTING.md hyper/docs/CONTRIBUTING.md

# Insert frontmatter borders, replace markdown header with
# frontmatter title and insert layout: guide
- name: Convert doc titles to frontmatter
Expand All @@ -49,23 +49,34 @@ jobs:
sed -i -e '4i permalink: /contrib/' hyper/docs/README.md
mv hyper/docs/README.md hyper/docs/index.md

# Lowercase the internal links so they will correctly point to
# the lowercased filenames.

# Lowercase the internal links and replace underscores with
# hyphens, so they will point to the correct file.
- name: Lowercase internal links
run: |
for filename in hyper/docs/*.md; do
# cut `.md` from the filename before search and replace
filename=${filename::-3};

for file in hyper/docs/*.md; do
# filename without parent path
filename=${filename##*/}

# don't lowercase MSRV
if [[ "${filename##*/}" == 'MSRV' ]]; then
if [[ "${filename}" == 'MSRV' ]]; then
continue
fi

# match instances of only the filename, not including
# the parent path, and convert them to lowercase
sed -i -e "s|${filename##*/}|\L\0|g" $file;
# lowercase filenames
sed -i -e "s|${filename}|${filename,,}|g" $file;

# match on the lowercased filename from here on
lowercased=${filename,,}

hyphenated=${lowercased//_/-}

# replace underscores in internal links with hyphens
sed -i -e "s|${lowercased}|${hyphenated}|g" $file;
done
done

Expand All @@ -75,7 +86,7 @@ jobs:
mv -vn "$f" "$(echo "$f" | tr '[:upper:]' '[:lower:]' | tr '_' '-')";
done

- name: Copy docs to contrib
- name: Copy the hyper docs to contrib
run: |
mkdir -p _contrib
cp -a hyper/docs/. _contrib/
Expand Down
4 changes: 2 additions & 2 deletions _contrib/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li
[easy tag]: https://github.com/hyperium/hyper/issues?q=label%3AE-easy+is%3Aopen


## [Pull Requests](pull_requests.md)
## [Pull Requests](pull-requests.md)

- [Submitting a Pull Request](pull_requests.md#submitting-a-pull-request)
- [Submitting a Pull Request](pull-requests.md#submitting-a-pull-request)
- [Commit Guidelines](commits.md)
2 changes: 1 addition & 1 deletion _contrib/governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ Maintainers are the project admins. Besides being a collaborator, they take care
of house-keeping duties, help lead the direction, and have the final authority when
required.

[coc]: ./code_of_conduct.md
[coc]: ./code-of-conduct.md
[contrib]: ../contributing.md
[triage-guide]: ./issues.md#triaging
4 changes: 2 additions & 2 deletions _contrib/issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ The severity marks how _severe_ the issue is. Note this isn't "importance" or "p
- **S-refactor**: improve internal code to help readability and maintenance.

[issues]: https://github.com/hyperium/hyper/issues
[COC]: ./code_of_conduct.md
[PRs]: ./pull_requests.md
[COC]: ./code-of-conduct.md
[PRs]: ./pull-requests.md
[MRE]: https://en.wikipedia.org/wiki/Minimal_reproducible_example
2 changes: 1 addition & 1 deletion _contrib/tenets.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ community building and using it. All contributions are in the open. We don't
maintain private versions, and don't include features that aren't useful to
others.

[We prioritize kindness](./code_of_conduct.md), compassion and empathy towards all
[We prioritize kindness](./code-of-conduct.md), compassion and empathy towards all
contributors. Technical skill is not a substitute for human decency.

### Examples
Expand Down