File size: 1,805 Bytes
c489b2f
 
6dab7ba
c489b2f
6dab7ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c2b236f
6dab7ba
 
 
 
c489b2f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Useful Tips on How to Build the Documentation

## Steps

1. Install `sphinx` and `sphinx_rtd_theme`:
   ```bash
   pip install sphinx sphinx_rtd_theme
   ```
2. Create a `docs` directory in the root of the project:
   ```bash
    mkdir docs
    ```
3. Create the documentation structure:
    ```bash
    cd docs
    sphinx-quickstart
    ```
    - Answer the questions as follows:
      - Separate source and build directories (y/n) [n]: n
      - Project name: PROTAC-Degradation-Predictor
      - Author name(s): Your Name
      - Project version: v1.0.1
    ```
4. Edit the `conf.py` file:
    - Add the following lines:
      ```python
      import os
      import sys
      sys.path.insert(0, os.path.abspath('..'))
      ```
    - Add the following line to the `extensions` list:
      ```python
      'sphinx.ext.autodoc',
      ```
    - Check the current `conf.py` file in this repository for more details.
5. Create modules rst files: `sphinx-apidoc -o docs/source/ ./protac_degradation_predictor`
6. To include modules in the documentation, in `index.rst`, add the following line: `source/modules`
7. Setup the gh-pages branch:
    ```bash
    git checkout --orphan gh-pages
    git reset --hard
    git commit --allow-empty -m "Init"
    git push origin gh-pages
    git checkout main
    ```
8. Generate the specific workflow Action file:
    - See file `.github/workflows/gh-pages.yml` in this repository.
9. The start page is in the file `index.rst`.

## Miscellaneous

- Useful [guide](https://olgarithms.github.io/sphinx-tutorial/docs/7-hosting-on-github-pages.html)
- Automatically create modules rst files: `sphinx-apidoc -o source/ ../protac_degradation_predictor`
  - Then, in `index.rst`, add the following line: `source/modules`
- Build the documentation: `make clean ; make html`