diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98684de6ab386c40fc17dbd6e94b477468168b30..c1165009f06708b63103d772bb43daf4b5018e1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,34 @@ +image: python:3.11 + +stages: + - build + - deploy + +variables: + DOCS_DIR: docs + BUILD_DIR: public + PAGES_BRANCH: "basic_setup" + +before_script: + - python -m pip install --upgrade pip + - pip install -r requirements.txt + +build_docs: + stage: build + script: + - sphinx-build -b html $DOCS_DIR/source $BUILD_DIR + artifacts: + paths: + - $BUILD_DIR + only: + - $PAGES_BRANCH + pages: - image: docker.km3net.de/base/texlive:2023 - script: - - make - - mkdir public - - cp km3net-dataformat-specifications.pdf public/ - artifacts: - paths: - - public + stage: deploy + script: + - mv $BUILD_DIR public + artifacts: + paths: + - public + only: + - $PAGES_BRANCH diff --git a/docs/GitRev.tex b/docs/GitRev.tex deleted file mode 100644 index bacbcb3749fcaddf2b5071a7930c0ed24b26aa6f..0000000000000000000000000000000000000000 --- a/docs/GitRev.tex +++ /dev/null @@ -1 +0,0 @@ -\begin{center} Git release: , date . \end{center} diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d0c3cbf1020d5c292abdedf27627c6abe25e2293 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/index.json b/docs/index.json deleted file mode 100644 index 15c3e0e9787bb258efb7a66eb5c89c32f704eef5..0000000000000000000000000000000000000000 --- a/docs/index.json +++ /dev/null @@ -1,5 +0,0 @@ -- glossary -- build from folders - - intro.json - - specs document - \ No newline at end of file diff --git a/docs/km3net-dataformat-specifications.tex b/docs/km3net-dataformat-specifications.tex deleted file mode 100644 index e2e90ee650bc5982a5697f9d268af7e35f2d78d5..0000000000000000000000000000000000000000 --- a/docs/km3net-dataformat-specifications.tex +++ /dev/null @@ -1,18 +0,0 @@ -\documentclass[a4paper, 11pt]{article} -\usepackage{graphicx} -\usepackage{color} -\usepackage{hyperref} - -\begin{document} -\title{KM3NeT Dataformat Specifications} -\author{Tamas Gal and Mieke Bouwhuis} -\date{\today} -\maketitle - -\tableofcontents - -\section{Detector Description (DETX, DATX)...} - -The corresponding Google drive document: https://drive.google.com/open?id=0B6l8SNtndcwaUTZPOWZOXzd6R3M - -\end{document} diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000000000000000000000000000000000000..747ffb7b3033659bdd2d1e6eae41ecb00358a45e --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..a1d7e8cc6d4c42556a2ba23c41d1e63c2a2fd760 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,57 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'KM3NeT Dataformat Specifications' +copyright = '2024, The KM3NeT Collaboration' +author = 'The KM3NeT Collaboration' + +# The full version, including alpha/beta/rc tags +release = '0.1' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx-jsonschema' +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..c81337d1afe90669c532e01d3a780b6f6a676f07 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,20 @@ +.. KM3NeT Dataformat Specifications documentation master file, created by + sphinx-quickstart on Tue Aug 20 09:58:21 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to KM3NeT Dataformat Specifications's documentation! +============================================================ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/specs/glossary.json b/docs/specs/glossary.json deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/docs/specs/template_index.json b/docs/specs/template_index.json deleted file mode 100644 index 83b66fa4b6172a8de279eb4a5b104799f4fef364..0000000000000000000000000000000000000000 --- a/docs/specs/template_index.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "description": "An introduction to the format", - "references": - { - "key": - { - "title": "x", - "reference": "URL" - } - } -} \ No newline at end of file diff --git a/docs/specs/template_specs.json b/docs/specs/template_specs.json deleted file mode 100644 index 0d302509529ccbeb6ba5195adcef2ea5bf1fb17d..0000000000000000000000000000000000000000 --- a/docs/specs/template_specs.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "title": "Extended name", - "description": "An introduction to the format", - "version": "", - "filename_convention": - { - "namestring": "", - "placeholder": {"abbrev": "description"} - }, - "related_software": "", - "filetype": "", - "fields": - { - "name": "", - "description": "", - "ismandatory": "", - "datatype": "", - "contraints": "" - }, - "headers": {}, - "metadata": {}, - "example": {}, - "validator": {}, - "references": - { - "key": - { - "title": "x", - "reference": "URL" - } - } -} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..c6b464c3f749e95239ab44e8b892d76b8aae5fd4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +sphinx +sphinx-jsonschema diff --git a/specs/README.md b/specs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..37bcda83f5b324895739cb0b556275c7ea020adc --- /dev/null +++ b/specs/README.md @@ -0,0 +1,3 @@ +# Data format specifications + +How to add ... diff --git a/specs/templates/dataformat_standard.js b/specs/templates/dataformat_standard.js new file mode 100644 index 0000000000000000000000000000000000000000..0950d9dba346ef81d8d36f1a2ed9297ef485416b --- /dev/null +++ b/specs/templates/dataformat_standard.js @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Example Data Format", + "description": "This schema defines the format for the example data used in our physics experiment.", + "type": "object", + "properties": { + "experiment_id": { + "type": "string", + "description": "Unique identifier for the experiment.", + "examples": ["EXP12345"] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the data was collected.", + "examples": ["2024-08-19T14:31:00Z"] + }, + "sensor_data": { + "type": "array", + "description": "Array of sensor readings collected during the experiment.", + "items": { + "type": "object", + "properties": { + "sensor_id": { + "type": "string", + "description": "Unique identifier for the sensor.", + "examples": ["SENSOR001"] + }, + "value": { + "type": "number", + "description": "The reading value from the sensor.", + "examples": [23.5] + }, + "unit": { + "type": "string", + "description": "The unit of the sensor reading.", + "enum": ["Celsius", "Kelvin", "Fahrenheit"], + "examples": ["Celsius"] + } + }, + "required": ["sensor_id", "value", "unit"] + } + }, + "metadata": { + "type": "object", + "description": "Additional metadata about the experiment.", + "properties": { + "location": { + "type": "string", + "description": "Location where the experiment was conducted.", + "examples": ["Lab A"] + }, + "operator": { + "type": "string", + "description": "Name or ID of the person who conducted the experiment.", + "examples": ["John Doe"] + } + }, + "required": ["location"] + } + }, + "required": ["experiment_id", "timestamp", "sensor_data"], + "additionalProperties": false +}