Contributions to open-source are more than just code. You can contribute by creating an issue, participating in discussions on GitHub, creating a tutorial for how to use the library, or creating an program using the library on CodeHS. If you'd like to submit your example to be hosted on the library's site (at codehs.github.io/chs-js-lib/examples), see the instructions here.
If you find a bug or have an idea for a feature improvement, you can create a new "issue" here. Follow the template's instructions to fill out helpful details for your bug report or request.
site/
contains the files used for generating the static site at https://codehs.github.io/chs-js-libsrc/
contains the source code for the libraryconsole/
contains the Console implementation, for text input and outputdatastructures/
contains the implementation of data structuresgraphics/
contains the implementation of graphical elementssound/
contains the implementation of the Audio and Sound classes
test/
contains the tests for the project
There are several auto-generated folders that contain only build artifacts: _site
, coverage
, and node_modules
shouldn't be changed.
We want to showcase the great programs our community has created with the library. To make a pull request to publish your example, follow these instructions:
-
Create a GitHub account, if you don't already have one
-
Fork this repository to your own GitHub account (how to fork a repo)
-
Create a new branch for your example (how to create a branch)
-
Create a new folder in the
site/examples/community/
folder with the name of your example. For this example, I'll useprojectname
, but it can be any name with no punctuation. You can also copy theexampleproject
folder. -
Within that folder, create two files:
projectname.md
andprojectname.js
. Yourprojectname.md
file should contain the following:--- title: Title for your page layout: example code: projectname.js ---
You may change the
title
to whatever you'd like, butlayout
must beexample
andcode
must beprojectname.js
Your
projectname.js
file is where you'll put your JavaScript code. -
Add a link to
site/examples/community/index.html
following the format<li> <a href="yourprojectname">Name Of Your Project</a> </li>
-
Commit your changes and make a pull request to add your example.
Additionally, you can use a text editor directly in GitHub to make a Pull Request without installing anything! Here's how!
To develop the project locally, follow the instructions here or watch this video!
-
Install node.js on your computer.
-
Create a GitHub account, if you don't already have one.
-
Fork this repository to your own GitHub account (how to fork a repo).
-
Clone the repository to your computer:
git clone https://github.com/YOUR_USERNAME/chs-js-lib.git
-
Navigate to the project folder and install dependencies:
cd chs-js-lib npm install
This should install everything you need to run the project.
-
Build the project from source:
npm run dev
This will build the project and start a process that will re-build any time a change is detected.
-
To optionally run the site, first install
http-server
withnpm
, then build the site and start the server.npm install -g http-server npm run site http-server -c-1 -p 8888 --cors
Then you can navigate to
localhost:8888/_site
in your browser to view the generated site. -
If you make any changes, add and commit them:
git add . git commit -m "<commit message>"
-
Push your changes to your fork on GitHub:
git push
-
Open a Pull Request! (how to open a pull request).
To recognize the many ways the community can contribute to this project, we follow the all-contributors specification. Comment on a Pull Request or Issue with a message of the format
@all-contributors please add @<username> for <contributions>
and a Pull Request will be created to add that contribution to the project.