Skip to content

Commit

Permalink
Merge branch 'main' into swiftUIwidget
Browse files Browse the repository at this point in the history
  • Loading branch information
yangc95 authored Jul 20, 2023
2 parents 1f7fbe4 + e776c62 commit c4ed9f5
Show file tree
Hide file tree
Showing 370 changed files with 17,204 additions and 2,832 deletions.
38 changes: 20 additions & 18 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# Codecademy Docs: Contribution Guide 👩🏻‍💻👨🏾‍💻👩🏼‍💻
# Docs: Contribution Guide 👩🏻‍💻👨🏾‍💻👩🏼‍💻

Welcome to the [Codecademy Docs](https://www.codecademy.com/resources/docs) GitHub repo!
> **[Contribute to Docs](https://www.codecademy.com/pages/contribute-docs)!** Please see our updated **[Contribution Guide](https://www.codecademy.com/resources/docs/contribution-guide)** that provides a step-by-step video and text guide on how you can make an impact through Docs. 🌠
Welcome to the [Docs](https://www.codecademy.com/resources/docs) GitHub repo!

We are an inclusive and passionate team of technologists and life-long learners around the world building free programming resources for a better tomorrow. For newcomers, contributing to an open-source project for the first time can be intimidating and overwhelming. Perhaps you’re a code newbie or maybe you’ve been tinkering for years but haven’t found that special project yet.

Good news, you are in the right place! Codecademy Docs is the perfect open-contribution project for you to get started. Every part of [Codecademy Docs](https://www.codecademy.com/resources/docs) content (entries, documentation, and translations) is written by amazing creative folks like yourself.
Good news, you are in the right place! Docs is the perfect open-contribution project for you to get started. Every part of [Docs](https://www.codecademy.com/resources/docs) content (entries, documentation, and translations) is written by amazing creative folks like yourself.

Thanks for your interest; we'd love to have you contribute. 💖

## How do I contribute?

There are many ways to contribute to Codecademy Docs:
There are many ways to contribute to Docs:

- Submit a Pull Request to edit an existing entry.
- Submit a Pull Request to create a new entry.
- Submit a bug in [GitHub Issues](https://github.com/Codecademy/docs/issues).
- Give feedback in the [Typeform Survey](https://codecademyready.typeform.com/to/hzVIWDgz).
- Join the [#CodecademyDocs](https://twitter.com/search?q=%23CodecademyDocs&src=typed_query&f=live) discussion on Twitter.

If you're new to Codecademy Docs and contributing for the first time, it is recommended that you visit the [Issues](https://github.com/Codecademy/docs/issues) section and ask to be assigned to an [open issue](https://github.com/Codecademy/docs/blob/main/.github/CONTRIBUTING.md#how-do-i-claim-an-issue) that interests you. Otherwise, feel free to submit a [PR](https://www.codecademy.com/resources/docs/git/pull-requests) by creating a new [branch](https://www.codecademy.com/resources/docs/git/branch) in your fork to create a new entry or edit an existing one.
If you're new to Docs and contributing for the first time, it is recommended that you visit the [Issues](https://github.com/Codecademy/docs/issues) section and ask to be assigned to an [open issue](https://github.com/Codecademy/docs/blob/main/.github/CONTRIBUTING.md#how-do-i-claim-an-issue) that interests you. Otherwise, feel free to submit a [PR](https://www.codecademy.com/resources/docs/git/pull-requests) by creating a new [branch](https://www.codecademy.com/resources/docs/git/branch) in your fork to create a new entry or edit an existing one.

## How do I claim an Issue?

Expand All @@ -32,11 +34,11 @@ Becoming an assignee to an issue follows this workflow:

Contributing follows this workflow:

1. Fork [this project repository](https://github.com/codecademy/docs).
2. Clone the forked repository to your computer.
1. Fork [this project repository](https://github.com/codecademy/docs): ![A red stencil outlining the "Fork" link for the Codecademy Docs repo](https://raw.githubusercontent.com/Codecademy/docs/main/media/indicate_fork_link.png)
2. Clone the forked repository to your computer. One option is using the HTTPS URL: `git clone https://github.com/github_username/docs.git`
3. Create and switch into a new branch.
4. Edit or create an entry and commit the changes.
5. Make a PR to merge your fork with this repo.
5. Make a PR to merge your fork with this repo: ![Red arrow on the Codecademy Docs repo pointing at a pop-up link for creating a new pull request](https://raw.githubusercontent.com/Codecademy/docs/main/media/create_pull_request_link.png)

If you haven't gone through this workflow before, you can check out [this GitHub tutorial](https://github.com/firstcontributions/first-contributions#readme) (highly recommend) or [this YouTube video](https://www.youtube.com/watch?v=rgbCcBNZcdQ) to learn about how to make a PR from a fork using Git.

Expand All @@ -58,7 +60,7 @@ There are a few tools you'll need to install in order to run our test suites loc

With everything installed, in the repository root (whatever directory contains the `package.json` file) you can run

**Note**: If you use `npm` instead of `yarn`, it is fine to do so with the commands described below.
> **Note**: If you use `npm` instead of `yarn`, it is fine to do so with the commands described below.
- `yarn format:verify` and `yarn lint:md` to validate markdown file contents
- `yarn test` to validate `content/` directory structure
Expand Down Expand Up @@ -90,15 +92,15 @@ Please read through the following in the [/documentation](https://github.com/Cod

The following are templates for creating your new entries:

| Template | GitHub Example | Docs Example |
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [Entry Template](https://github.com/Codecademy/docs/blob/main/documentation/entry-template.md) | [lists.md](https://github.com/Codecademy/docs/blob/main/content/python/concepts/lists/lists.md) ([Raw](https://raw.githubusercontent.com/Codecademy/docs/main/content/python/concepts/lists/lists.md)) | [Lists](https://www.codecademy.com/resources/docs/python/lists) |
| [Term Entry Template](https://github.com/Codecademy/docs/blob/main/documentation/term-entry-template.md) | [append.md](https://github.com/Codecademy/docs/blob/main/content/python/concepts/lists/terms/append/append.md) ([Raw](https://raw.githubusercontent.com/Codecademy/docs/main/content/python/concepts/lists/terms/append/append.md)) | [Append](https://www.codecademy.com/resources/docs/python/lists/append) |
| [Topic Info Template](https://github.com/Codecademy/docs/blob/main/documentation/topic-info-template.md) | [sql.md](https://github.com/Codecademy/docs/blob/main/content/sql/sql.md) ([Raw](https://raw.githubusercontent.com/Codecademy/docs/main/content/sql/sql.md)) | [SQL](https://www.codecademy.com/resources/docs/sql) |
| Template | GitHub Example | Docs Example |
| -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [Concept Entry Template](https://github.com/Codecademy/docs/blob/main/documentation/concept-entry-template.md) | [lists.md](https://github.com/Codecademy/docs/blob/main/content/python/concepts/lists/lists.md) ([Raw](https://raw.githubusercontent.com/Codecademy/docs/main/content/python/concepts/lists/lists.md)) | [Lists](https://www.codecademy.com/resources/docs/python/lists) |
| [Term Entry Template](https://github.com/Codecademy/docs/blob/main/documentation/term-entry-template.md) | [append.md](https://github.com/Codecademy/docs/blob/main/content/python/concepts/lists/terms/append/append.md) ([Raw](https://raw.githubusercontent.com/Codecademy/docs/main/content/python/concepts/lists/terms/append/append.md)) | [Append](https://www.codecademy.com/resources/docs/python/lists/append) |
| [Topic Entry Template](https://github.com/Codecademy/docs/blob/main/documentation/topic-entry-template.md) | [sql.md](https://github.com/Codecademy/docs/blob/main/content/sql/sql.md) ([Raw](https://raw.githubusercontent.com/Codecademy/docs/main/content/sql/sql.md)) | [SQL](https://www.codecademy.com/resources/docs/sql) |

### Codecademy Username

As a Codecademy Docs contributor, you have the opportunity to have your Codecademy username displayed on the side of the entry!
As a Docs contributor, you have the opportunity to have your Codecademy username displayed on the side of the entry!

If you wish to have your Codecademy profile listed in the entry, before making the PR, make sure that your Codecademy user profile and your GitHub are linked, and that your Codecademy profile is set to public. You can stay anonymous by not linking them.

Expand All @@ -115,7 +117,7 @@ To link your Codecademy user profile to GitHub:
- Before making a PR, make sure you pushed your changes from a branch other than `main`.
- Name the new branch after the changes being pushed to the PR.
- Keep your PRs byte-sized. No more than 3 new entries per PR!
- All contributors must sign the [Contributor License Agreement (CLA)](<[url](https://cla-assistant.io/Codecademy/docs)>).
- All contributors must sign the [Contributor License Agreement (CLA)](<[url](https://cla-assistant.io/Codecademy/docs)>) when contributing for the first time.
- All required [status checks](https://docs.github.com/en/github/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) are expected to pass in each PR.
- PRs will be marked as **invalid** if there is no consistent activity within a **2-week period** on the contributor's part and content does not meet or pass standard formatting, quality, and plagiarism checks.
- We require at least two round of reviews from the [content team members](https://github.com/codecademy/docs#-content-team). Make sure to make the changes after each round.
Expand All @@ -136,7 +138,7 @@ We will not accept entries that were exclusively generated through an AI tool. W

- AI-generated content is often confidently incorrect, leading to the spread of inaccurate or misleading information.
- We provide authorship credit for submissions, and to submit AI-generated work under one's own name would be a violation of our plagiarism policy.
- Codecademy Docs is an educational space for people to learn how to write effective technical documentation. Using generative AI, at this point, negatively impacts that desired learning goal.
- Docs is an educational space for people to learn how to write effective technical documentation. Using generative AI, at this point, negatively impacts that desired learning goal.

## How do we update a PR branch?

Expand All @@ -157,7 +159,7 @@ git push

## Additional Resources

- [How to Contribute to Codecademy Docs](https://dev.to/codecademy/how-to-contribute-to-codecademy-docs-1a77) article
- [How to Contribute to Docs](https://dev.to/codecademy/how-to-contribute-to-codecademy-docs-1a77) article

Remember, if you ever have any questions at all, we're always here to help in the [Codecademy Forums](https://discuss.codecademy.com/c/community/community-docs/2205) and [Codecademy Discord](https://discord.com/invite/codecademy).

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/post-merge-messages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Post-Merge Messages
on:
pull_request_target:
types: [closed]
issues:
types: [closed]
jobs:
run:
if: >-
github.event.pull_request.user.login != 'Dusch4593' &&
github.event.pull_request.user.login != 'yangc95' &&
github.event.pull_request.user.login != 'KTom101' &&
github.event.pull_request.user.login != 'SSwiniarski' &&
github.event.pull_request.user.login != 'HishamT' &&
github.event.pull_request.user.login != 'caupolicandiaz' &&
github.event.pull_request.user.login != 'lucwhite'
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pullRequestMerged: |
👋 @{{ author }}
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out [this four question survey](https://codecademyready.typeform.com/to/O3hzYoBB) to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!
issuesClosed: |
🌸 Thanks for closing this Issue!
Please head over to the [Docs Forum](https://discuss.codecademy.com/c/community/community-docs/2205) if you have any questions about Docs, or reply to the thread on [Possible Content Discussion](https://discuss.codecademy.com/t/find-a-starting-point-possible-content-discussion/745868) to share ideas and collaborate with other contributors, maintainers, or super users to determine good future issues that will help expand Docs!
24 changes: 0 additions & 24 deletions .github/workflows/post-merge-survey.yml

This file was deleted.

1 change: 1 addition & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ ol-prefix:
style: "ordered"
code-fence-style:
style: "backtick"
emphasis-style: false
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!-- markdownlint-disable MD041 MD002 -->
<div align="center">
<h1>📕 Codecademy Docs</h1>
<h1>📕 Docs</h1>
<strong>Documentation for popular programming languages and frameworks.</strong><br>
<strong>Built by the community. Maintained by Codecademy.</strong>
</div>
<br>

## What is Docs?

[Codecademy Docs](https://www.codecademy.com/resources/docs) is a free, easily accessible reference for coding terms and concepts, available to developers all over the world. If you forget what JavaScript hoisting is, we want you to be able to look up "JS hoisting" on any search engine, click a Codecademy Doc entry, and have an answer in seconds.
[Docs](https://www.codecademy.com/resources/docs) is a free, easily accessible reference for coding terms and concepts, available to developers all over the world. If you forget what JavaScript hoisting is, we want you to be able to look up "JS hoisting" on any search engine, click a Doc entry, and have an answer in seconds.

## What stage of development are we in right now?

Expand All @@ -23,7 +23,7 @@ Docs is live with over 1000 high-quality entries. Now that the MVP is out, our g
- [@sswiniarski](https://github.com/sswiniarski), Content Contributor
- [@yangc95](https://github.com/yangc95), Content Contributor

We are currently building a team of community volunteers and educators to maintain Codecademy Docs. Let us know if you are interested.
We are currently building a team of community volunteers and educators to maintain Docs. Let us know if you are interested.

### 🏗 Engineering Team

Expand All @@ -35,17 +35,17 @@ We are currently building a team of community volunteers and educators to mainta

## How do I contribute?

There are many ways to contribute to Codecademy Docs:
There are many ways to contribute to Docs:

- Submit a Pull Request to edit an existing entry.
- Submit a Pull Request to create a new entry.
- Submit a typo/bug in [GitHub Issues](https://github.com/Codecademy/docs/issues).
- Share your thoughts in this [Codecademy Docs feedback form](https://codecademyready.typeform.com/to/hzVIWDgz) to tell us how we can improve Docs!
- Join the [#CodecademyDocs](https://twitter.com/search?q=%23CodecademyDocs&src=typed_query&f=live) discussion on Twitter.
- Reply to the thread on [Possible Content Discussion](https://discuss.codecademy.com/t/find-a-starting-point-possible-content-discussion/745868) to share ideas and collaborate with other contributors, maintainers, or super users to determine good future issues.
- Share your thoughts in this [Docs feedback form](https://codecademyready.typeform.com/to/hzVIWDgz) to tell us how we can improve Docs!

Whether you are a code newbie or a seasoned hacker, there's something for you!

Please read through the [Contribution Guide](https://github.com/Codecademy/docs/blob/main/.github/CONTRIBUTING.md) ✨. There you'll find a write-up of our content standards and style guide, as well as templates for creating your entries.
Please read through the [Contribution Guide](https://www.codecademy.com/resources/docs/contribution-guide) ✨. There you'll find a write-up of our content standards and style guide, as well as templates for creating your entries.

## Additional Notes

Expand Down
2 changes: 1 addition & 1 deletion bin/concept-of-the-week.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
content/python/concepts/conditionals/conditionals.md
content/css/concepts/display/display.md
19 changes: 16 additions & 3 deletions content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,22 @@ describe.each(glob.sync('content/**/*.md'))('%s', (file) => {
Tags?: string[];
};

const { attributes }: FrontMatterResult<FrontMatterAttributes> = frontmatter(
fs.readFileSync(file, 'utf8')
);
const fileContent = fs.readFileSync(file, 'utf8');

if (!frontmatter.test(fileContent)) {
throw new Error(
`error: ${file} does not contain properly formatted frontmatter.`
);
}

if (!fileContent.startsWith('---')) {
throw new Error(
`error: ${file} does not contain properly formatted frontmatter. Check for leading invisible characters.`
);
}

const { attributes }: FrontMatterResult<FrontMatterAttributes> =
frontmatter(fileContent);

it('has only valid metadata keys', () => {
const validKeys: Record<string, string> = {
Expand Down
Loading

0 comments on commit c4ed9f5

Please sign in to comment.