Docs: Enable RTD on tf-m-tools
Added files required for the tf-m-tools documentation to be displayed on Read the Docs.
Change-Id: Id4a810f4d22b2234a7fe362d93bf623806fadcde
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 0000000..baf1fd1
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+#
+# Copyright (c) 2023, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Version of the configuration file, v1 is no longer supported
+version: 2
+
+# Configuration for the documentation build
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3.11"
+ apt_packages:
+ - plantuml
+
+# Build documentation in the "docs/" directory with Sphinx
+sphinx:
+ configuration: docs/conf.py
+
+# The documentation will also be built in a pdf format
+formats:
+ - pdf
+
+# Configuration of the Python environment
+python:
+ install:
+ - requirements: docs/requirements.txt
diff --git a/docs/_static/css/tfm_custom.css b/docs/_static/css/tfm_custom.css
new file mode 100644
index 0000000..dfc4e55
--- /dev/null
+++ b/docs/_static/css/tfm_custom.css
@@ -0,0 +1,82 @@
+/*-----------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#----------------------------------------------------------------------------*/
+
+/* Override table no-wrap */
+.wy-table-responsive table td, .wy-table-responsive table th {
+ white-space: normal;
+}
+
+/* Limit page width */
+@media only screen and (min-width: 780px) {
+ .wy-nav-content {
+ max-width: 1100px;
+ }
+}
+
+/* Flexbox Tile Grid Settings */
+.grid {
+ list-style-type: none !important;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -ms-flex-wrap: wrap;
+ flex-wrap: wrap;
+ -webkit-box-pack: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ margin: 1rem auto;
+ max-width: calc((250px + 2rem) * 4);
+}
+
+.grid-item {
+ list-style-type: none !important;
+ -webkit-box-flex: 0;
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+ width: 200px;
+ text-align: center;
+ margin: 1rem;
+}
+
+.grid-item a {
+ display: block;
+ width: 190px;
+ height: 190px;
+ padding: 12px;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ -webkit-box-pack: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ border: 1px solid #c6cbce;
+ background-color: #2980B9;
+ color: white;
+}
+
+.grid-item h2 {
+ font-size: 1rem;
+ margin-bottom: 0.5rem;
+}
+
+.grid-item img {
+ max-width: 75%;
+ margin-bottom: 0.5rem;
+}
+
+
+.grid-item a:hover {
+ background-color: #32cd32;
+ color: white;
+}
diff --git a/docs/_static/images/favicon.ico b/docs/_static/images/favicon.ico
new file mode 100644
index 0000000..915353d
--- /dev/null
+++ b/docs/_static/images/favicon.ico
Binary files differ
diff --git a/docs/_static/images/tf_logo_white.png b/docs/_static/images/tf_logo_white.png
new file mode 100644
index 0000000..e7bff71
--- /dev/null
+++ b/docs/_static/images/tf_logo_white.png
Binary files differ
diff --git a/cmsis_pack/README.md b/docs/cmsis_pack.md
similarity index 96%
rename from cmsis_pack/README.md
rename to docs/cmsis_pack.md
index d55c2f4..d56bf86 100644
--- a/cmsis_pack/README.md
+++ b/docs/cmsis_pack.md
@@ -50,3 +50,7 @@
- generated pack is available in the `output` directory
- note: this pack should not be published and used only for testing TF-M
5. Run `./clean.sh` script to delete all intermediate and generated files
+
+--------------
+
+*Copyright (c) 2021, Arm Limited. All rights reserved.*
diff --git a/code-size-analyze-tool/README.rst b/docs/code-size-analyze-tool.rst
similarity index 100%
rename from code-size-analyze-tool/README.rst
rename to docs/code-size-analyze-tool.rst
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..ccbe37a
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,157 @@
+# -*- coding: utf-8 -*-
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+# Configuration file for the Sphinx documentation builder.
+#
+# This file does only contain a selection of the most common options. For a
+# full list see the documentation:
+# http://www.sphinx-doc.org/en/master/config
+
+import os
+import sys
+import re
+from subprocess import check_output
+
+# -- Project information -----------------------------------------------------
+
+project = 'Trusted Firmware-M Tests'
+copyright = '2023, ARM CE-OSS'
+author = 'ARM CE-OSS'
+title = 'User Guide'
+
+# -- Extract current version -------------------------------------------------
+
+try:
+ vrex = re.compile(r'TF-M(?P<GIT_VERSION>v.+?)'
+ r'(-[0-9]+-g)?(?P<GIT_SHA>[a-f0-9]{7,})?$')
+
+ version = check_output("git describe --tags --always",
+ shell = True, encoding = 'UTF-8')
+
+ _v = vrex.match(version)
+ release = _v.group('GIT_VERSION')
+ if _v.group('GIT_SHA'):
+ version = release + "+" + _v.group('GIT_SHA')[:7]
+
+except:
+ version = release = 'Unknown'
+
+# -- General configuration ---------------------------------------------------
+
+extensions = [
+ 'sphinx.ext.imgmath',
+ 'm2r2', #Support markdown files. Needed for external code.
+ 'sphinx.ext.autosectionlabel', #Make sphinx generate a label for each section
+ 'sphinxcontrib.plantuml', #Add support for PlantUML drawings
+ 'sphinxcontrib.rsvgconverter', #Add support for SVG to PDF
+ 'sphinx_tabs.tabs', #Enable tab extension in Sphinx
+]
+
+# Make auto section labels generated be prefixed with file name.
+autosectionlabel_prefix_document=True
+# Add auto section label for level 2 headers only.
+autosectionlabel_maxdepth=2
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+source_suffix = ['.rst', '.md']
+
+# The master toctree document.
+master_doc = 'index'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# 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 = ['_build', 'Thumbs.db', '.DS_Store', 'readme.rst',
+ 'platform/cypress/psoc64/security/keys/readme.rst',
+ 'lib/ext/**']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# -- Options for HTML output -------------------------------------------------
+
+html_theme = 'sphinx_rtd_theme'
+
+html_theme_options = {
+ 'collapse_navigation' : False,
+ 'prev_next_buttons_location' : None, # Hide Prev and Next buttons
+ 'display_version': True, # Show version under logo
+ 'sticky_navigation': True,
+ 'navigation_depth': 3,
+}
+
+# Remove the "View page source" link from the top of docs pages
+html_show_sourcelink = False
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to configuration 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']
+
+# Set the documentation logo relative to configuration directory
+html_logo = '_static/images/tf_logo_white.png'
+
+# Set the documentation favicon
+html_favicon = '_static/images/favicon.ico'
+
+#Disable adding conf.py copyright notice to HTML output
+html_show_copyright = False
+
+# Disable showing Sphinx footer message:
+# "Built with Sphinx using a theme provided by Read the Docs. "
+html_show_sphinx = False
+
+#Add custom css for HTML. Used to allow full page width rendering
+def setup(app):
+ app.add_css_file('css/tfm_custom.css')
+
+# -- Options for HTMLHelp output ---------------------------------------------
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'TF-M doc'
+
+# Enable figures and tables auto numbering
+numfig = True
+numfig_secnum_depth = 0
+numfig_format = {
+ 'figure': 'Figure %s:',
+ 'table': 'Table %s:',
+ 'code-block': 'Listing %s:',
+ 'section': '%s'
+}
+
+# -- Options for LaTeX output ------------------------------------------------
+
+latex_elements = {
+ # 'papersize': 'letterpaper',
+ # 'pointsize': '10pt',
+ # 'preamble': '',
+ # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ (master_doc, 'TF-M.tex', title,
+ author, 'manual'),
+]
+
+language = 'en'
diff --git a/depend-trace-tool/README.rst b/docs/depend-trace-tool/depend-trace-tool.rst
similarity index 100%
rename from depend-trace-tool/README.rst
rename to docs/depend-trace-tool/depend-trace-tool.rst
diff --git a/depend-trace-tool/secure_fw.png b/docs/depend-trace-tool/secure_fw.png
similarity index 100%
rename from depend-trace-tool/secure_fw.png
rename to docs/depend-trace-tool/secure_fw.png
Binary files differ
diff --git a/depend-trace-tool/tfm_sprt.png b/docs/depend-trace-tool/tfm_sprt.png
similarity index 100%
rename from depend-trace-tool/tfm_sprt.png
rename to docs/depend-trace-tool/tfm_sprt.png
Binary files differ
diff --git a/fih_test_tool/Readme.rst b/docs/fih_test_tool.rst
similarity index 100%
rename from fih_test_tool/Readme.rst
rename to docs/fih_test_tool.rst
diff --git a/iat-verifier/README.rst b/docs/iat-verifier.rst
similarity index 100%
rename from iat-verifier/README.rst
rename to docs/iat-verifier.rst
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..874c78a
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,32 @@
+################################
+Trusted Firmware-M Tools
+################################
+
+.. raw:: html
+
+.. toctree::
+ :caption: Overview
+ :maxdepth: 1
+
+ CMSIS TF-M Packs <cmsis_pack>
+ Code Size Analyze Tool <code-size-analyze-tool>
+ FIH Test Tool <fih_test_tool>
+ Initial Atestation Verifier <iat-verifier>
+ IRQ Test Tool <irq_test_tool>
+ Library Dependency Trace Tool <depend-trace-tool/depend-trace-tool>
+ Profiling <profiling>
+ SQUAD Metrics Dashboard <squad-dashboard>
+ Static Checking Framework <static_checks/index>
+ TF-Fuzz <tf_fuzz>
+ TF-M Manual Build <tf-m-manual-build>
+
+.. toctree::
+ :caption: Links
+ :maxdepth: 1
+ :hidden:
+
+ Trusted Firmware-M <https://trustedfirmware-m.readthedocs.io/en/latest/>
+
+--------------
+
+*Copyright (c) 2017-2023, Arm Limited. All rights reserved.*
diff --git a/irq_test_tool/README.rst b/docs/irq_test_tool.rst
similarity index 100%
rename from irq_test_tool/README.rst
rename to docs/irq_test_tool.rst
diff --git a/profiling/readme.rst b/docs/profiling.rst
similarity index 100%
rename from profiling/readme.rst
rename to docs/profiling.rst
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..4678dc5
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,10 @@
+graphviz
+Jinja2>=3.0.2
+latex
+Sphinx==4.2.0
+m2r2
+sphinx-rtd-theme>=1.0.0
+sphinxcontrib-plantuml==0.22
+sphinxcontrib-svg2pdfconverter==1.1.1
+sphinx-tabs==3.2.0
+docutils==0.16
diff --git a/squad-dashboard/SQUAD_Dashboard.rst b/docs/squad-dashboard.rst
similarity index 100%
rename from squad-dashboard/SQUAD_Dashboard.rst
rename to docs/squad-dashboard.rst
diff --git a/static_checks/checkpatch/README.rst b/docs/static_checks/checkpatch.rst
similarity index 100%
rename from static_checks/checkpatch/README.rst
rename to docs/static_checks/checkpatch.rst
diff --git a/static_checks/clang_format/README.rst b/docs/static_checks/clang_format.rst
similarity index 100%
rename from static_checks/clang_format/README.rst
rename to docs/static_checks/clang_format.rst
diff --git a/static_checks/cppcheck/README.rst b/docs/static_checks/cppcheck.rst
similarity index 100%
rename from static_checks/cppcheck/README.rst
rename to docs/static_checks/cppcheck.rst
diff --git a/static_checks/git_hooks/README.rst b/docs/static_checks/git_hooks.rst
similarity index 100%
rename from static_checks/git_hooks/README.rst
rename to docs/static_checks/git_hooks.rst
diff --git a/static_checks/header_check/README.rst b/docs/static_checks/header_check.rst
similarity index 100%
rename from static_checks/header_check/README.rst
rename to docs/static_checks/header_check.rst
diff --git a/static_checks/README.rst b/docs/static_checks/index.rst
similarity index 82%
rename from static_checks/README.rst
rename to docs/static_checks/index.rst
index 2b54da4..7643813 100644
--- a/static_checks/README.rst
+++ b/docs/static_checks/index.rst
@@ -12,10 +12,10 @@
This tool should be used from the root of the TF-M repository. launching
run_all_checks.sh will launch the different checkers used :
-- Cppcheck
-- Copyright header check
-- clang-format
-- Checkpatch
+- :doc:`Cppcheck <cppcheck>`
+- :doc:`Copyright header check <header_check>`
+- :doc:`clang-format <clang_format>`
+- :doc:`Checkpatch <checkpatch>`
Both checkpatch and clang-format are use to check the coding style, but they
both cover different cases so together they provide a better coverage.
@@ -34,15 +34,13 @@
.. toctree::
:caption: Table of Contents
:name: mastertoc
- :maxdepth: 3
- :hidden:
+ :maxdepth: 1
- Home<self>
- cppcheck/readme
- clang_format/README
- checkpatch/README
- header_check/README
- git_hooks/README
+ cppcheck
+ clang_format
+ checkpatch
+ header_check
+ git_hooks
--------------
diff --git a/tf-m-manual-build/README.rst b/docs/tf-m-manual-build.rst
old mode 100755
new mode 100644
similarity index 99%
rename from tf-m-manual-build/README.rst
rename to docs/tf-m-manual-build.rst
index 60352c4..e28dc13
--- a/tf-m-manual-build/README.rst
+++ b/docs/tf-m-manual-build.rst
@@ -58,4 +58,4 @@
--------------
*Copyright (c) 2021, Arm Limited. All rights reserved.*
-*SPDX-License-Identifier: BSD-3-Clause*
\ No newline at end of file
+*SPDX-License-Identifier: BSD-3-Clause*
diff --git a/tf_fuzz/README b/docs/tf_fuzz.md
similarity index 98%
rename from tf_fuzz/README
rename to docs/tf_fuzz.md
index 49fcb40..d54748c 100644
--- a/tf_fuzz/README
+++ b/docs/tf_fuzz.md
@@ -1,3 +1,5 @@
+# TF_Fuzz
+
.../tf_fuzz directory contents:
assets calls demo parser tests regression