Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and deploy docs

on:
push:
branches: [ main ]
pull_request:

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

jobs:
docs:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt

- name: Generate API docs
run: |
sphinx-apidoc -f -o docs/source/api src/longitudinal_ecg_analysis

- name: Build Sphinx docs
run: |
sphinx-build -W -b html docs/source docs/build/html

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: actions/deploy-pages@v4

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
venv/
__pycache__/
*.py[cod]
*.py[cod]
docs/build/
2 changes: 1 addition & 1 deletion docs/build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ Further details of this example are provided in the :ref:`Running demo analysis
examples
variables
maintenance
API Documentation <modules>
API Documentation <api/modules>

2 changes: 1 addition & 1 deletion docs/build/html/_sources/maintenance.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The documentation is a mixture of manually written pages, and auto-generated API
* Update the auto-generated API documentation using::

cd longitudinal-ecg-analysis/
sphinx-apidoc -f -o docs/source ./src/longitudinal_ecg_analysis
sphinx-apidoc -f -o docs/source/api ./src/longitudinal_ecg_analysis
cd docs
make html
cd ..
Expand Down
8 changes: 0 additions & 8 deletions docs/build/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -741,14 +741,6 @@ abbr, acronym {
cursor: help;
}

.translated {
background-color: rgba(207, 255, 207, 0.2)
}

.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}

/* -- code displays --------------------------------------------------------- */

pre {
Expand Down
13 changes: 8 additions & 5 deletions docs/build/html/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,11 @@ const Search = {
// perform the search on the required terms
searchTerms.forEach((word) => {
const files = [];
// find documents, if any, containing the query word in their text/title term indices
// use Object.hasOwnProperty to avoid mismatching against prototype properties
const arr = [
{ files: terms[word], score: Scorer.term },
{ files: titleTerms[word], score: Scorer.title },
{ files: terms.hasOwnProperty(word) ? terms[word] : undefined, score: Scorer.term },
{ files: titleTerms.hasOwnProperty(word) ? titleTerms[word] : undefined, score: Scorer.title },
];
// add support for partial matches
if (word.length > 2) {
Expand Down Expand Up @@ -547,8 +549,9 @@ const Search = {

// set score for the word in each file
recordFiles.forEach((file) => {
if (!scoreMap.has(file)) scoreMap.set(file, {});
scoreMap.get(file)[word] = record.score;
if (!scoreMap.has(file)) scoreMap.set(file, new Map());
const fileScores = scoreMap.get(file);
fileScores.set(word, record.score);
});
});

Expand Down Expand Up @@ -587,7 +590,7 @@ const Search = {
break;

// select one (max) score for the file.
const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w]));
const score = Math.max(...wordList.map((w) => scoreMap.get(file).get(w)));
// add result to the result list
results.push([
docNames[file],
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/datasets.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="variables.html">Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="maintenance.html">Maintenance</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">API Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">API Documentation</a></li>
</ul>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="variables.html">Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="maintenance.html">Maintenance</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">API Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/modules.html">API Documentation</a></li>
</ul>

</div>
Expand Down
Loading