Skip to content

Commit 49dde41

Browse files
committed
Added Initial Documentation Code
Signed-off-by: chaitanya1731 <chaitanya.kulkarni@intel.com>
1 parent f5689c9 commit 49dde41

File tree

9 files changed

+270
-0
lines changed

9 files changed

+270
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_build

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
# %: Makefile
20+
# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
22+
# Generate doc site under _build/html with Sphinx.
23+
vhtml: _work/venv/.stamp
24+
. _work/venv/bin/activate && \
25+
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
26+
cp docs/index.html $(BUILDDIR)/html/index.html
27+
28+
html:
29+
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
30+
cp docs/index.html $(BUILDDIR)/html/index.html
31+
32+
clean-html:
33+
rm -rf $(BUILDDIR)/html
34+
35+
# Set up a Python3 environment with the necessary tools for document creation.
36+
_work/venv/.stamp: ./requirements.txt
37+
rm -rf ${@D}
38+
python3 -m venv ${@D}
39+
. ${@D}/bin/activate && pip install wheel && pip install -r $<
40+
touch $@

_static/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.wy-nav-content {
2+
max-width: 90% !important;
3+
}

_templates/versions.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{%- if versions %}
2+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
3+
<span class="rst-current-version" data-toggle="rst-current-version">
4+
<span class="fa fa-book"> Versions</span>
5+
v: {{ version }}
6+
<span class="fa fa-caret-down"></span>
7+
</span>
8+
<div class="rst-other-versions">
9+
{% if versions|length >= 1 %}
10+
<dl>
11+
<dt>{{ _('Versions') }}</dt>
12+
{% for slug, url in versions %}
13+
{% if slug == version %} <strong> {% endif %}
14+
<dd><a href="{{ url }}">{{ slug }}</a></dd>
15+
{% if slug == version %} </strong> {% endif %}
16+
{% endfor %}
17+
</dl>
18+
{% endif %}
19+
</div>
20+
</div>
21+
{%- endif %}

conf.py

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
# import os
16+
# import sys
17+
# sys.path.insert(0, os.path.abspath('.'))
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
project = 'Intel® Technology Enabling for OpenShift*'
22+
copyright = '2024, Intel® Corporation'
23+
author = 'Intel® Corporation'
24+
25+
# The short X.Y version
26+
# version = 'devel'
27+
# The full version, including alpha/beta/rc tags
28+
# release = 'GA'
29+
30+
31+
# ---------------------------------
32+
# Reference for sphinx_md : https://pypi.org/project/sphinx-md/
33+
# ---------------------------------
34+
from os import getenv
35+
36+
baseBranch = "main"
37+
sphinx_md_useGitHubURL = True
38+
commitSHA = getenv('GITHUB_SHA')
39+
githubBaseURL = 'https://github.com/' + (getenv('GITHUB_REPOSITORY') or 'intel/intel-technology-enabling-for-openshift') + '/'
40+
githubFileURL = githubBaseURL + "blob/"
41+
githubDirURL = githubBaseURL + "tree/"
42+
if commitSHA:
43+
githubFileURL = githubFileURL + commitSHA + "/"
44+
githubDirURL = githubDirURL + commitSHA + "/"
45+
else:
46+
githubFileURL = githubFileURL + baseBranch + "/"
47+
githubDirURL = githubDirURL + baseBranch + "/"
48+
sphinx_md_githubFileURL = githubFileURL
49+
sphinx_md_githubDirURL = githubDirURL
50+
51+
# Version displayed in the upper left corner
52+
# This value is set in the github workflow environment
53+
commitREF = getenv('GITHUB_SHA_REF', default = "unknown")
54+
if commitREF.startswith("release-"):
55+
version = commitREF[len("release-"):].strip()
56+
else:
57+
version = "development"
58+
59+
60+
61+
# -- General configuration ---------------------------------------------------
62+
63+
# If your documentation needs a minimal Sphinx version, state it here.
64+
#
65+
# needs_sphinx = '1.0'
66+
67+
# Add any Sphinx extension module names here, as strings. They can be
68+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
69+
# ones.
70+
extensions = ['myst_parser', 'sphinx_md', ]
71+
# myst_enable_extensions = [
72+
# "html_admonition",
73+
# ]
74+
# Add any paths that contain templates here, relative to this directory.
75+
templates_path = ['_templates']
76+
77+
# The suffix(es) of source filenames.
78+
# You can specify multiple suffix as a list of string:
79+
#
80+
source_suffix = ['.rst', '.md']
81+
82+
# List of patterns, relative to source directory, that match files and
83+
# directories to ignore when looking for source files.
84+
# This pattern also affects html_static_path and html_extra_path.
85+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
86+
87+
# -- Options for HTML output -------------------------------------------------
88+
89+
# The theme to use for HTML and HTML Help pages. See the documentation for
90+
# a list of builtin themes.
91+
#
92+
html_theme = 'sphinx_rtd_theme'
93+
html_title = "Intel® Technology Enabling for OpenShift*"
94+
# Theme options are theme-specific and customize the look and feel of a theme
95+
# further. For a list of options available for each theme, see the
96+
# documentation.
97+
#
98+
html_theme_options = {
99+
"display_version": True,
100+
}
101+
102+
html_context = {
103+
'display_github': True,
104+
'github_host': 'github.com',
105+
'github_user': 'intel',
106+
'github_repo': 'intel-technology-enabling-for-openshift',
107+
'github_version': 'main/',
108+
'versions_menu': True,
109+
'version': version,
110+
}
111+
html_css_files = [
112+
'custom.css',
113+
]
114+
115+
# Add any paths that contain custom static files (such as style sheets) here,
116+
# relative to this directory. They are copied after the builtin static files,
117+
# so a file named "default.css" will overwrite the builtin "default.css".
118+
119+
html_static_path = ['_static']
120+
121+
122+
# Custom sidebar templates, must be a dictionary that maps document names
123+
# to template names.
124+
#
125+
# The default sidebars (for documents that don't match any pattern) are
126+
# defined by theme itself. Builtin themes are using these templates by
127+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
128+
# 'searchbox.html']``.
129+
#
130+
# html_sidebars = {}
131+
132+
133+
# -- Options for HTMLHelp output ---------------------------------------------
134+
135+
# Output file base name for HTML help builder.
136+
htmlhelp_basename = 'IntelTechnologyEnablingforOpenShiftdoc'

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<meta http-equiv="refresh" content="0; URL='README.html'" />

index.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.. Intel Technology Enabling for OpenShift documentation master file, created by
2+
sphinx-quickstart on Wed Apr 17 23:49:16 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Intel® Technology Enabling for OpenShift*
7+
===================================================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
README.md
14+
15+
.. toctree::
16+
:maxdepth: 2
17+
:caption: Releases:
18+
19+
docs/releases.md
20+
21+
.. toctree::
22+
:maxdepth: 2
23+
:caption: Supported Platforms:
24+
25+
docs/supported_platforms

make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
docutils<0.18
2+
sphinx
3+
sphinx_rtd_theme
4+
recommonmark
5+
sphinx-markdown-tables
6+
sphinx-md
7+
myst_parser
8+
GitPython

0 commit comments

Comments
 (0)