Skip to content

Commit

Permalink
Merge pull request #389 from clEsperanto/update-doc
Browse files Browse the repository at this point in the history
Update-doc
  • Loading branch information
StRigaud authored Nov 5, 2024
2 parents 17442ed + 8183c60 commit 1676af8
Show file tree
Hide file tree
Showing 19 changed files with 208 additions and 284 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
branches:
- master
release:
types: [created, published]


# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand All @@ -19,7 +23,6 @@ concurrency:
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:

environment:
Expand All @@ -30,25 +33,31 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.11
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref_name }}

- name: Set environment variables
run: |
echo "RELEASE_TAG_NAME=${{ github.event.release.tag_name || github.ref_name }}" >> $GITHUB_ENV
- name: Get specific version of CMake, Ninja
uses: lukka/[email protected]

- name: Install doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen
sudo apt update && sudo apt install -y doxygen
shell: bash -l {0}

- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.12
cache: 'pip'

- name: Install build sphinx
run: |
python -m pip install --upgrade pip
python -m pip install ninja breathe==4.35.0 sphinx==7.2.6 sphinx_rtd_theme==2.0.0
python -m pip install ninja breathe==4.35.0 sphinx==7.2.6 sphinx_rtd_theme==2.0.0 sphinxemoji
shell: bash -l {0}

- name: generat build folder
Expand All @@ -63,7 +72,6 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './docs/build'

- name: Deploy to GitHub Pages
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)

project(CLIc VERSION 0.14.1)
project(CLIc VERSION 0.14.2)

set(kernel_version_tag "3.0.2" CACHE STRING "clEsperanto kernel version tag")
set(eigen_lib_version_tag "3.4.0" CACHE STRING "Eigen library version tag")
Expand Down
7 changes: 0 additions & 7 deletions docs/source/_static/debug.js

This file was deleted.

55 changes: 0 additions & 55 deletions docs/source/_templates/layout.html

This file was deleted.

4 changes: 2 additions & 2 deletions docs/source/array.rst → docs/source/api/array.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Array
=====
Array Class
===========

The ``Array`` class is the primary data structure class of the library.
It stores the pointer to the memory space in the ``Device``, along with the necessary information to access and manipulate it.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/source/device.rst → docs/source/api/device.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Device
======
Device Class
============

A ``Device`` is a processing unit that can execute OpenCL kernels.
It is mainly a GPU, but it can also be a CPU or a simulation of a device (e.g. `pocl`, `oclgrind`).
Expand Down
4 changes: 2 additions & 2 deletions docs/source/tiers.rst → docs/source/api/tiers.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Tiers
=====
Operation tier list
===================

The tiers hold the different operations that are available in CLIc.
These operations are grouped by their complexity, following the rules that a function in tier N implement a function from tier N-1.
Expand Down
79 changes: 0 additions & 79 deletions docs/source/compilation.rst

This file was deleted.

79 changes: 17 additions & 62 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,32 @@
import os
import sys
import re
import subprocess

from sphinx.locale import _

sys.path.insert(0, os.path.abspath("../../"))

# Open the CMakeCache.txt file and search for the project version
with open('../../CMakeLists.txt', 'r') as f:
for line in f:
if 'project' in line:
start = line.find('VERSION') + 8
end = line.find(')', start)
release = line[start:end].strip()
break
# Get the TAG_NAME environment variable
tag_name = os.getenv('RELEASE_TAG_NAME')
if tag_name:
release = tag_name
else:
# Get the current Git branch name
try:
branch_name = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip().decode('utf-8')
release = branch_name
except subprocess.CalledProcessError:
release = 'unknown'


# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = u'CLIc'
slug = re.sub(r'\W+', '-', project.lower())
author = u'Stephane Rigaud'
copyright = f'2024, {author}'
copyright = f'2020-%Y, {author}'
language = 'en'
version = release

Expand All @@ -41,7 +46,8 @@
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
]
'sphinxemoji.sphinxemoji',
]
breathe_projects = {'CLIc': os.environ.get('CLIC_DOCS', './xml')}
breathe_default_project = 'CLIc'

Expand Down Expand Up @@ -74,60 +80,9 @@
'display_version': True,
'collapse_navigation': False,
}
html_context = {}

if not 'READTHEDOCS' in os.environ:
html_static_path = ['_static/']
html_js_files = ['debug.js']

# Add fake versions for local QA of the menu
html_context['test_versions'] = list(map(
lambda x: str(x / 10),
range(1, 100)
))

# html_logo = "demo/static/logo-wordmark-light.svg"
html_logo = "./images/logo_d_small.png"
html_show_sourcelink = True
# html_favicon = "demo/static/favicon.ico"
htmlhelp_basename = slug

latex_documents = [
('index', '{0}.tex'.format(slug), project, author, 'manual'),
]

man_pages = [
('index', slug, project, [author], 1)
]

texinfo_documents = [
('index', slug, project, author, slug, project, 'Miscellaneous'),
]

html_static_path = ['_static']

# Extensions to theme docs
def setup(app):
from sphinx.domains.python import PyField
from sphinx.util.docfields import Field

app.add_object_type(
'confval',
'confval',
objname='configuration value',
indextemplate='pair: %s; configuration value',
doc_field_types=[
PyField(
'type',
label=_('Type'),
has_arg=False,
names=('type',),
bodyrolename='class'
),
Field(
'default',
label=_('Default'),
has_arg=False,
names=('default',),
),
]
)
Loading

0 comments on commit 1676af8

Please sign in to comment.