Skip to content

Commit

Permalink
Merge branch 'contributing' of https://github.com/chrisdel101/express…
Browse files Browse the repository at this point in the history
…js.com into contributing
  • Loading branch information
Chris Del committed Nov 17, 2024
2 parents 8a31076 + 44cb937 commit 4283961
Show file tree
Hide file tree
Showing 742 changed files with 527,220 additions and 22 deletions.
Binary file added .DS_Store
Binary file not shown.
41 changes: 36 additions & 5 deletions .github/scripts/get-contributing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,62 @@ DEST="../../en/resources/contributing.md"
# This script replaces the contents of a section with the contents from
# the annotated source address.

# tracks the header level
level=''
# tracks repo & file for curl call
src=''
# tracks file for local file copy
local=''
while IFS= read -r line; do
if [[ -n "$src" ]] && [[ "$line" != '#'* || "$line" == "$level"'#'* ]]; then
continue
# this section removes prev lines after file loads - src/load set to non-empty
if [[ -n "$src" || -n "$local" ]]; then
# if line eq level - level is num of ##s
if [[ "$line" == "$level"'#'* ||
# line not a header)
"$line" != '#'* ]]; then
continue
fi
fi

src=''
local=''
# if line is header - assign level num
if [[ "$line" == '#'* ]]; then
# this is header before SRC/LOCAL anchors
title=${line##*\#}
level="${line:0:$((${#line} - ${#title}))}"
# src on page
elif [[ "$line" == '<!-- SRC:'* ]]; then
src=${line:10}
src=${src% *}
fi
# local on page
elif [[ "$line" == '<!-- LOCAL:'* ]]; then
local=${line:12}
local=${local% *}
local=${local#* }
fi

echo "$line"

if [[ -n "$src" ]]; then

if [[ -n "$local" ]]; then
cat "$local" | \
# remove the top # headers from cp file
sed -En '/^##|^[^#]/,$p' | \
# remove any starting w NOTE: lines
sed -E '/^[NOTE:*]/d' | \
# remove any lines with Not the Express JS Framework string
sed -E '/Not the Express JS Framework/I,$d'
echo
elif [[ -n "$src" ]]; then
echo
path=${src#* }
repo=${src% *}
curl -s "https://raw.githubusercontent.com/${repo}/master/${path}" | \
# if ## or not #
sed -En '/^##|^[^#]/,$p' | \
# add additional # every header
sed 's/^#/&'"${level:1}"'/g' | \
# format gh links when match
sed -E 's/(\[[^]]*\])\(([^):#]*)\)/\1(https:\/\/github.com\/'"$(sed 's/\//\\\//g' <<< "$repo")"'\/blob\/master\/\2)/g'
echo
fi
Expand Down
74 changes: 62 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Contributing to Expressjs.com

### The Offical Documentation of the Express Framework
### The Official Documentation of the Express Framework

**NOTE**: This is not the repo for Express JS. To contribute to the _[Express JS framework](https://github.com/expressjs/express)_ itself, [check this out](#were-the-express-js-frameworks-documetation-team---not-the-express-js-framework).
**NOTE**: This is not the repo for Express JS. To contribute to the _[Express JS framework](https://github.com/expressjs/express)_ itself, [check this out](#were-the-express-js-frameworks-documenntation-team---not-the-express-js-framework).

If you want to contribute to [https://github.com/expressjs/expressjs.com](https://github.com/expressjs/expressjs.com), you're in the right place.


Whether you're a first time first time contributor or you're just looking for a refresher, visit our [Getting Started](#contributors-guide-to-getting-started) guide below to get up and runnning.
Whether you're a first time first time contributor or you're just looking for a refresher, visit our [Getting Started](#contributors-guide-to-getting-started) guide below to get up and running.

#### Want to help but need some ideas? These are some of our most typical issue types:

Expand All @@ -27,7 +27,10 @@ If you see anything on the site that could use a tune-up, think about how to fix


3. **Translation Related**: spelling errors, incorrect/poorly translated words, adding new full site translations.
- _If you want to do a full site translation, or just translate a single page, there's a section specifically related to [translations](#contributing-translations) below_.
> [!IMPORTANT]
> All translation submissions are currently paused. See this [notice](#important-notice-we-have-paused-all-translation-contributions) for more information.
- _If you want to do a full site translation, or just translate a single page, there's a section specifically related to [translations](#contributing-translations) below_.

#### Want to work on a backlog issue?

Expand All @@ -48,15 +51,15 @@ If you want to learn about working on Expressjs.com, this is the right place. Fo

#### Step1: Opening a New Issue
So, you've found a problem that you want to fix, or have a site enhancement you want to make.
1. The first step is to open an [issue](https://github.com/expressjs/expressjs.com/issues/new?assignees=&labels=&projects=&template=3other.md), not a PR.
- Give the issue a good title and be sure to fill in the description section, writing as much detail on your proposal as possible .
- Don't leave anything blank! If you leave the description section blank we will not read it and it will almost certainly be rejected. Fill in the details!
1. The first step is to open an [issue](https://github.com/expressjs/expressjs.com/issues/new?assignees=&labels=&projects=&template=3other.md).
- Give the issue a good title and be sure to fill in the description section, writing as much detail on your proposal as possible.
- Don't leave anything blank! The more details you provide the more feedback we can give.


2. Next, the Express documentation team will respond, either approving or denying your proposal. We read all submissions and try our best to always respond quickly with feedback.
2. Next, the Express documentation team will respond with feedback on your submission. We read all submissions and try our best to always respond quickly with feedback.
- After you've received approval, *only then* should you start work or make any pull requests.
- If you really want to see you work merged into a super popular open source project, *and you do*, please always follow our process and open an issue first.
- __Don't skip straight to a pull request__. It will be likely be rejected and closed. We DO NOT want anyone's time or hard work to go to waste. So please, follow the steps.
- __Please don't skip straight to a pull request unless you are totally sure your work is unique__. This is just because we never want anyone's time or hard work to go to waste on duplicated work.

#### Step2: Get the Application Code Base

Expand Down Expand Up @@ -95,9 +98,56 @@ Now you'll need a way to see your changes, which means you'll need a running ver
- After the build steps are complete, you'll have access to a __Deploy Preview__ tab that will run your changes on the web, rebuilding after each commit is pushed.
- After you are completely done your work and it's ready for review, remove the draft status on your pull request and submit your work. We will review it and respond.

{% include contributing/translations.md %}

## We're the Express JS Framework's Documetation Team - Not the Express JS Framework
## Contributing translations

#### Important Notice: We have paused all translation contributions.
> [!IMPORTANT]
> We are currently working toward a more streamlined translations workflow. As long as this notice is posted, we will _not_ be accepting any translation submissions.
We highly encourage community translations! We no longer have professional translations, and we believe in the power of our community to provide accurate and helpful translations.

The documentation is translated into these languages:
- English (`en`)
- Spanish (`es`)
- French (`fr`)
- Italian (`it`)
- Indonesian (`id`)
- Japanese (`ja`)
- Korean (`ko`)
- Brazilian Portuguese (`pt-br`)
- Russian (`ru`)
- Slovak (`sk`)
- Thai (`th`)
- Turkish (`tr`)
- Ukrainian (`uk`)
- Uzbek (`uz`)
- Simplified Chinese (`zh-cn`)
- Traditional Chinese (`zh-tw`)

### Adding New Full Site Translations

If you find a translation is missing from the list you can create a new one.

To translate expressjs.com into a new language, follow these steps:

1. Clone the [`expressjs.com`](https://github.com/expressjs/expressjs.com) repository.
2. Create a directory for the language of your choice using its [ISO 639-1 code](http://www.loc.gov/standards/iso639-2/php/code_list.php) as its name.
3. Copy `index.md`, `api.md`, `starter/`, `guide/`, `advanced/`, `resources/`, `4x/`, and `3x/`, to the language directory.
4. Remove the link to 2.x docs from the "API Reference" menu.
5. Update the `lang` variable in the copied markdown files.
6. Update the `title` variable in the copied markdown files.
7. Create the header, footer, notice, and announcement file for the language in the `_includes/` directory, in the respective directories, and make necessary edits to the contents.
8. Create the announcement file for the language in the `_includes/` directory.
9. Make sure to append `/{{ page.lang }}` to all the links within the site.
10. Update the `CONTRIBUTING.md` and the `.github/workflows/translation.yml` files with the new language.

### Adding Page and Section Translations

Many site translations are still missing pages. To find which ones we need help with, you can [filter for merged PRs](https://github.com/expressjs/expressjs.com/pulls?q=is%3Apr+is%3Aclosed+label%3Arequires-translation-es) that include the tag for your language, such as `requires-translation-es` for requires Spanish translation.

If you contribute a page or section translation, please reference the original PR. This helps the person merging your translation to remove the tag from the original PR.

## We're the Express JS Framework's Documentation Team - Not the Express JS Framework

If you are looking for the repository for the **Express JS Framework**, you've hopefully noticed by now that you've come to the wrong place. This page is only for issues related to the this website: [http://expressjs.com](http://expressjs.com).

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ The default GitHub Pages syntax highlighting has been disabled in `_config.yml`

## Contributing

Feel free to make changes to the template files or the document files. The supporting docs are located in their respective directories, and the API docs are located under the `_includes` directory.

Please see the [Contributors' Guide](CONTRIBUTING.md) for more information on contributing to the documentation, including information on contributing translations.
Please see the [Contributors' Guide](CONTRIBUTING.md) for more information on contributing to the Express JS documentation, including information on contributing translations.

## Why use Jekyll instead of an Express-based solution?

Expand Down
2 changes: 1 addition & 1 deletion _includes/header/header-id.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<a href="/{{ page.lang }}/resources/contributing.html">Contributing to Express</a>
</li>
<li>
<a href="/{{ page.lang }}/changelog/4x.html">Release Change Log</a>
<a href="/en/changelog/4x.html">Release Change Log</a>
</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion _includes/header/header-th.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<a href="/{{ page.lang }}/resources/contributing.html">มีส่วนร่วมกับ Express</a>
</li>
<li>
<a href="/{{ page.lang }}/changelog/4x.html">บันทึกการเปลี่ยนแปลง</a>
<a href="/en/changelog/4x.html">บันทึกการเปลี่ยนแปลง</a>
</li>
</ul>
</li>
Expand Down
Loading

0 comments on commit 4283961

Please sign in to comment.