Skip to content

Commit

Permalink
🔧 add documentation website
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahhj93 committed Feb 15, 2024
1 parent f6a6c6c commit 3866061
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
20 changes: 20 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# bin_tree - Binary Tree documentation

## Local Compilation

To test your changes on your computer before submission:

1. Install Python
- On Windows, check the option to add Python to the PATH during installation.

2. Clone the repository and open a terminal in the cloned folder.

3. Install the necessary tools with:
```bash
pip3 install -r requirements.txt
```

4. Start a server that automatically compiles the changes:
```bash
mkdocs serve
```
102 changes: 102 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Binary Tree Operations

This module provides operations for manipulating binary trees.

## Type Definition

```ocaml
type 'a bin_tree = Nil | Node of 'a * 'a bin_tree * 'a bin_tree
```

Represents a binary tree where each node contains a value of type `'a` and has two child nodes.

## Functions

### `height`

```ocaml
val height : 'a bin_tree -> int
```

Returns the height of the given binary tree.

### `nb_leaf`

```ocaml
val nb_leaf : 'a bin_tree -> int
```

Returns the number of leaves in the given binary tree.

### `nb_internal_nodes`

```ocaml
val nb_internal_nodes : 'a bin_tree -> int
```

Returns the number of internal nodes in the given binary tree.

### `internal_nodes`

```ocaml
val internal_nodes : 'a bin_tree -> 'a list
```

Returns a list of internal nodes in the given binary tree.

### `search_node`

```ocaml
val search_node : 'a bin_tree -> 'a -> bool
```

Checks if the given value exists in the binary tree.

### `is_symmetric`

```ocaml
val is_symmetric : 'a bin_tree -> bool
```

Checks if the binary tree is symmetric.

### `is_strict`

```ocaml
val is_strict : 'a bin_tree -> bool
```

Checks if the binary tree is strict.

### `is_right_comb`

```ocaml
val is_right_comb : 'a bin_tree -> bool
```

Checks if the binary tree is a right comb.

### `is_left_comb`

```ocaml
val is_left_comb : 'a bin_tree -> bool
```

Checks if the binary tree is a left comb.

### `is_comb`

```ocaml
val is_comb : 'a bin_tree -> bool
```

Checks if the binary tree is a comb.

### `is_perfect`

```ocaml
val is_perfect : 'a bin_tree -> bool
```

Checks if the binary tree is perfect.
```
28 changes: 28 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
site_name: Documentation bin_tree
repo_url: https://github.com/Ahhj93/bin_tree-docs
repo_name: Ahhj93/bin_tree-docs

theme:
name: material
palette:
- media: "(prefers-color-scheme)"
toggle:
icon: material/link
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/toggle-switch
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: indigo
toggle:
icon: material/toggle-switch-off
name: Switch to system preference
font:
text: Roboto
code: Roboto Mono

0 comments on commit 3866061

Please sign in to comment.