show next and previous pages docs

pull/978/head
Kye Gomez 4 days ago
parent a4f0f54481
commit d9571d22c7

@ -1,25 +0,0 @@
name: autofix.ci
on:
pull_request:
push:
branches: ["main"]
permissions:
contents: read
jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest
- run: yamlfmt .
- uses: actions/setup-python@v5
- run: pip install ruff
- run: ruff format .
- run: ruff check --fix .
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

@ -1,43 +0,0 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# This workflow file requires a free account on Bearer.com to manage findings, notifications and more.
# See https://docs.bearer.com/guides/bearer-cloud/
name: Bearer
on:
push:
branches: ["master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
schedule:
- cron: '24 22 * * 6'
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
jobs:
bearer:
runs-on: ubuntu-latest
steps:
# Checkout project source
- uses: actions/checkout@v4
# Scan code using Bearer CLI
- name: Run Report
id: report
uses: bearer/bearer-action@828eeb928ce2f4a7ca5ed57fb8b59508cb8c79bc
with:
api-key: ${{ secrets.BEARER_TOKEN }}
format: sarif
output: results.sarif
exit-code: 0
# Upload SARIF file generated in previous step
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

@ -1,89 +0,0 @@
# .github/workflows/comprehensive_tests.yml
name: Swarms Comprehensive Tests
# This workflow triggers on pushes and pull requests to the master branch.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# You can test against multiple Python versions here if needed.
python-version: ["3.10"]
steps:
# Step 1: Check out the code.
# For pull requests, this action automatically checks out the code
# from the PR's branch, not the master branch. This is the key
# to testing the proposed changes.
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up the specified Python version.
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Step 3: Install Poetry for dependency management.
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
# Step 4: Cache dependencies to speed up subsequent runs.
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
# Step 5: Install dependencies and the project package itself.
# This is the crucial step. 'poetry install' will install all dependencies
# and also install the 'swarms' package from the checked-out PR code
# in editable mode within the virtual environment.
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --with dev --all-extras
# Step 6: Create dummy image files required for multi-modal tests.
# This ensures your tests are self-contained.
- name: Create dummy image files for testing
run: |
mkdir -p tests/test_data
touch tests/test_data/image1.jpg
touch tests/test_data/image2.png
echo "dummy image data" > tests/test_data/image1.jpg
echo "dummy image data" > tests/test_data/image2.png
# Step 7: Run the comprehensive test suite.
# 'poetry run' executes the command within the virtual environment,
# ensuring that when 'tests/comprehensive_test.py' imports 'swarms',
# it's importing the code from the pull request.
- name: Run Comprehensive Test Suite
env:
# Securely pass API keys and other secrets to the test environment.
# These must be configured in your repository's secrets.
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_REPO_OWNER: "kyegomez"
# GITHUB_REPO_NAME: "swarms"
run: |
poetry run python tests/comprehensive_test.py
# Step 8: Upload the generated test report as an artifact.
# This happens even if the previous steps fail, allowing you to debug.
- name: Upload Test Report
if: always()
uses: actions/upload-artifact@v4
with:
name: test-report-${{ matrix.python-version }}
path: test_runs/

@ -1,60 +0,0 @@
name: Tests
on:
push:
schedule:
- cron: "0 0 * * *"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v4
name: Define a cache for the virtual environment
file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Install OpenCV
run: sudo apt-get install python3-opencv
- name: Enter the virtual environment
run: source $VENV
- name: Run the tests
run: poetry run pytest --verbose
run-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v4
name: Define a cache for the virtual environment
file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Install OpenCV
run: sudo apt-get install python3-opencv
- name: Enter the virtual environment
run: source $VENV
- name: Make Script Executable and Run
run: |-
chmod +x ./scripts/run_examples.sh
./scripts/run_examples.sh

@ -152,6 +152,8 @@ theme:
- navigation.sections - navigation.sections
# - navigation.expand # - navigation.expand
- navigation.top - navigation.top
- navigation.footer
- navigation.path
- announce.dismiss - announce.dismiss
font: font:
text: "Fira Sans" # Clean and readable text text: "Fira Sans" # Clean and readable text

@ -8,6 +8,41 @@
</div> </div>
{% endblock %} {% endblock %}
{% block content %}
{{ super() }}
<!-- Enhanced Page Navigation -->
<div class="md-content__navigation">
<div class="md-content__inner md-grid">
{% if page.previous_page or page.next_page %}
<nav class="md-nav md-nav--secondary" aria-label="Page navigation">
<div class="md-nav__title">
<span class="md-nav__icon">📖</span>
Continue Reading
</div>
<div class="md-nav__list">
{% if page.previous_page %}
<a href="{{ page.previous_page.url | url }}" class="md-nav__item md-nav__item--previous">
<div class="md-nav__link-wrapper">
<span class="md-nav__direction">← Previous</span>
<span class="md-nav__title">{{ page.previous_page.title }}</span>
</div>
</a>
{% endif %}
{% if page.next_page %}
<a href="{{ page.next_page.url | url }}" class="md-nav__item md-nav__item--next">
<div class="md-nav__link-wrapper">
<span class="md-nav__direction">Next →</span>
<span class="md-nav__title">{{ page.next_page.title }}</span>
</div>
</a>
{% endif %}
</div>
</nav>
{% endif %}
</div>
</div>
{% endblock %}
{% block footer %} {% block footer %}
<footer class="md-footer"> <footer class="md-footer">
<!-- Custom Footer Links Section --> <!-- Custom Footer Links Section -->
@ -57,6 +92,252 @@
{% block styles %} {% block styles %}
{{ super() }} {{ super() }}
<style> <style>
/* Enhanced Navigation Styling */
.md-footer__link {
padding: 1rem 1.5rem;
border-radius: 0.5rem;
transition: all 0.3s ease;
border: 1px solid transparent;
display: flex;
align-items: center;
gap: 0.5rem;
min-height: 3rem;
}
.md-footer__link:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.md-footer__title {
font-weight: 600;
font-size: 0.9rem;
}
.md-footer__direction {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.05em;
opacity: 0.8;
}
/* Light Mode Navigation */
[data-md-color-scheme="default"] .md-footer__link {
background: #f8f9fa;
border-color: #e9ecef;
}
[data-md-color-scheme="default"] .md-footer__link:hover {
background: #e9ecef;
border-color: #DC143C;
}
[data-md-color-scheme="default"] .md-footer__direction {
color: #DC143C;
}
/* Dark Mode Navigation */
[data-md-color-scheme="slate"] .md-footer__link {
background: #1F2129;
border-color: #404040;
}
[data-md-color-scheme="slate"] .md-footer__link:hover {
background: #2a2d35;
border-color: #DC143C;
}
[data-md-color-scheme="slate"] .md-footer__direction {
color: #DC143C;
}
/* Navigation Icons */
.md-footer__link .md-icon {
font-size: 1.2rem;
}
/* Path Navigation (Breadcrumbs) Enhancement */
.md-path {
margin-bottom: 1rem;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
font-size: 0.8rem;
}
[data-md-color-scheme="default"] .md-path {
background: #f8f9fa;
border: 1px solid #e9ecef;
}
[data-md-color-scheme="slate"] .md-path {
background: #1F2129;
border: 1px solid #404040;
}
.md-path__list {
display: flex;
align-items: center;
gap: 0.5rem;
margin: 0;
padding: 0;
list-style: none;
}
.md-path__item {
display: flex;
align-items: center;
}
.md-path__item:not(:last-child)::after {
content: "→";
margin-left: 0.5rem;
opacity: 0.6;
}
.md-path__link {
color: #DC143C;
text-decoration: none;
font-weight: 500;
}
.md-path__link:hover {
text-decoration: underline;
}
/* Enhanced Page Navigation Section */
.md-content__navigation {
margin: 3rem 0 2rem;
padding: 2rem 0;
border-top: 1px solid var(--md-default-fg-color--lightest);
}
.md-content__navigation .md-nav__title {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 1.5rem;
color: #DC143C;
border-bottom: 2px solid #DC143C;
padding-bottom: 0.5rem;
}
.md-content__navigation .md-nav__icon {
font-size: 1.2rem;
}
.md-content__navigation .md-nav__list {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
margin: 0;
padding: 0;
list-style: none;
}
.md-content__navigation .md-nav__item {
display: block;
margin: 0;
}
.md-content__navigation .md-nav__item--previous {
grid-column: 1;
}
.md-content__navigation .md-nav__item--next {
grid-column: 2;
text-align: right;
}
.md-content__navigation .md-nav__link-wrapper {
display: block;
padding: 1.5rem;
border-radius: 0.75rem;
text-decoration: none;
transition: all 0.3s ease;
border: 2px solid transparent;
height: 100%;
}
.md-content__navigation .md-nav__item:hover .md-nav__link-wrapper {
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(220, 20, 60, 0.2);
border-color: #DC143C;
}
.md-content__navigation .md-nav__direction {
display: block;
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.1em;
font-weight: 600;
color: #DC143C;
margin-bottom: 0.5rem;
}
.md-content__navigation .md-nav__title {
display: block;
font-size: 1rem;
font-weight: 500;
line-height: 1.4;
margin: 0;
border: none;
padding: 0;
}
/* Light Mode Enhanced Navigation */
[data-md-color-scheme="default"] .md-content__navigation {
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}
[data-md-color-scheme="default"] .md-content__navigation .md-nav__link-wrapper {
background: #ffffff;
border-color: #e9ecef;
color: #495057;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
[data-md-color-scheme="default"] .md-content__navigation .md-nav__item:hover .md-nav__link-wrapper {
background: #ffffff;
color: #212529;
}
/* Dark Mode Enhanced Navigation */
[data-md-color-scheme="slate"] .md-content__navigation {
background: linear-gradient(135deg, #1F2129 0%, #262932 100%);
}
[data-md-color-scheme="slate"] .md-content__navigation .md-nav__link-wrapper {
background: #1F2129;
border-color: #404040;
color: #d1d5db;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
[data-md-color-scheme="slate"] .md-content__navigation .md-nav__item:hover .md-nav__link-wrapper {
background: #2a2d35;
color: #ffffff;
}
/* Responsive Design for Navigation */
@media screen and (max-width: 59.9375em) {
.md-content__navigation .md-nav__list {
grid-template-columns: 1fr;
gap: 1rem;
}
.md-content__navigation .md-nav__item--previous,
.md-content__navigation .md-nav__item--next {
grid-column: 1;
text-align: left;
}
.md-content__navigation {
margin: 2rem 0 1rem;
padding: 1.5rem 0;
}
}
/* Custom Footer Styling - Base */ /* Custom Footer Styling - Base */
.md-footer-custom { .md-footer-custom {
padding: 2.4rem 0 1.2rem; padding: 2.4rem 0 1.2rem;

Loading…
Cancel
Save