Skip to content

Commit

Permalink
feat(docs): add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunSHamilton committed Dec 9, 2023
1 parent d292b50 commit d90c6c6
Show file tree
Hide file tree
Showing 44 changed files with 3,861 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
coverage
/dist/
/dist/
docs/tools/
/theme/
55 changes: 55 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy mdBook site to Pages

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
mdbook_url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
admonish_url="https://github.com/tommilligan/mdbook-admonish/releases/download/v1.14.0/mdbook-admonish-v1.14.0-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $mdbook_url | tar -xz --directory=./mdbook
curl -sSL $admonish_url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: |
mdbook build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: "book"

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@ dist
.pnp.*

# build folder
/dist
/dist

# mdbook (docs)
book
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
setup:
```js
import * as helpers from '@freeCodeCamp/curriculum-helpers'
# Curriculum Helpers

new helpers.CSSHelp(document).getCSSRules();

helpers.removeHtmlComments('<!-- HTML COMMENT --> <h1> Hello world </h1>');
```
https://opensource.freecodecamp.org/curriculum-helpers/

BSD-3-Clause © [freeCodeCamp.org](https://freecodecamp.org)


[npm-image]: https://badge.fury.io/js/curriculum-helpers.svg
[npm-url]: https://npmjs.org/package/curriculum-helpers
[travis-image]: https://travis-ci.com/freeCodeCamp/curriculum-helpers.svg?branch=master
Expand Down
21 changes: 21 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[book]
authors = ["Shaun Hamilton"]
language = "en"
multilingual = false
src = "docs"

[output.html.playground]
editable = true

[preprocessor]

[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "3.0.1" # do not edit: managed by `mdbook-admonish install`

[output.html]
default-theme = "ayu"
git-repository-url = "https://github.com/freeCodeCamp/curriculum-helpers"
git-repository-icon = "fa-github"
site-url = "https://opensource.freecodecamp.org/curriculum-helpers/"
additional-css = ["./theme/css/mdbook-admonish.css"]
16 changes: 16 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing

## Library API

## Documentation

### Tooling

- [mdbook](https://rust-lang.github.io/mdBook/)
- [mdbook-admonish](https://github.com/tommilligan/mdbook-admonish)

### Development

```bash
mdbook serve
```
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Introduction

Tests are split into language and environment. That is, the language being tested, and the environment running the test code.
14 changes: 14 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Summary

[Introduction](README.md)

- [Curriculum Helpers](./curriculum-helpers.md)
- [CSS](./css.md)
- [HTML]()
- [Python](./python.md)
- [Common Tools](./common-tools.md)
- [Testing in General](./testing-in-general.md)
- [JavaScript]()
- [Nodejs]()
- [Rust](./rust.md)
- [Contributing](./CONTRIBUTING.md)
9 changes: 9 additions & 0 deletions docs/common-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Common Tools

- [Regex101](https://regex101.com/)
- [Babeliser](https://github.com/ShaunSHamilton/babeliser)
- [curriculum-helpers/CSSHelp](https://github.com/freeCodeCamp/curriculum-helpers/blob/a15c8a495892b05bf1071b0354deb737e1541a06/lib/index.ts#L127-L277)
- [curriculum-helpers/python](https://github.com/freeCodeCamp/curriculum-helpers/blob/a15c8a495892b05bf1071b0354deb737e1541a06/lib/index.ts#L100-L125)
- [Pyodide](https://pyodide.org/en/stable/)

Some of the examples assume global access to the above tools. Usage of these helpers is denoted by code referencing `__helpers` or `__pyodide`.
Loading

0 comments on commit d90c6c6

Please sign in to comment.