Resolve documentation build errors

Eliminated all the warnings and errors in the documentations.

Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Change-Id: I355b0db832e62d7eb4f0968c309e547ae7a51dc3
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..f355e8c
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,132 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+#TODO: add exception for files coming from other repos!
+#Language:        Cpp
+AccessModifierOffset: -8
+AlignAfterOpenBracket: Align
+AlignConsecutiveMacros: true
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: true
+AlignEscapedNewlines: Left
+AlignOperands:   true
+AlignTrailingComments: false
+AllowAllArgumentsOnNextLine: false
+AllowAllConstructorInitializersOnNextLine: false
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterCaseLabel:  false
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   true
+  AfterNamespace:  true
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  AfterExternBlock: false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeComma
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: false
+ColumnLimit:     100
+CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 8
+ContinuationIndentWidth: 8
+Cpp11BracedListStyle: false
+DeriveLineEnding: false
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: false
+IncludeBlocks:   Regroup
+IncludeCategories:
+  - Regex:           '^<.+>$'
+    Priority:        1
+  - Regex:           '^".+"$'
+    Priority:        2
+  - Regex:           '.*'
+    Priority:        0
+IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentCaseLabels: false
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentWidth:     8
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 8
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 10
+PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakComment: 10
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakString: 10
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 100
+PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Right
+ReflowComments:  false
+ReferenceAlignment: Middle
+SortIncludes:    true
+SortUsingDeclarations: false
+SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: false
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceBeforeSquareBrackets: false
+Standard:        Cpp03
+TabWidth:        8
+UseCRLF:         false
+UseTab:          Always
+
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 0000000..a33d90c
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,23 @@
+# .readthedocs.yaml
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Set the version of tools you might need
+build:
+  os: ubuntu-20.04
+  tools:
+    python: "3.8"
+  apt_packages:
+    - plantuml
+
+# Build documentation in the docs/ directory with Sphinx
+sphinx:
+   configuration: docs/conf.py
+
+# Optionally declare the Python requirements required to build your docs
+python:
+   install:
+   - requirements: docs/requirements.txt
\ No newline at end of file
diff --git a/docs/conf.py b/docs/conf.py
index feeca38..3bdd93e 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -91,7 +91,7 @@
 
 #Add custom css for HTML. Used to allow full page width rendering
 def setup(app):
-    app.add_stylesheet('css/custom.css')
+    app.add_css_file('css/custom.css')
 
 
 # -- Options for autosectionlabel --------------------------------------------
diff --git a/docs/environments/secure-partitions/spm/optee/userspace-programs-on-fvp.rst b/docs/environments/secure-partitions/spm/optee/userspace-programs-on-fvp.rst
index e364839..56df3a3 100644
--- a/docs/environments/secure-partitions/spm/optee/userspace-programs-on-fvp.rst
+++ b/docs/environments/secure-partitions/spm/optee/userspace-programs-on-fvp.rst
@@ -29,7 +29,7 @@
 the makefiles in the ``op-tee/build`` repository.
 
 To build all such binaries build the ``ffa-test-all`` target. For available targets please refer to
-fvp-psa-sp.mk_. As an example to build the ``ts-service-test`` application execute the following
+`fvp-psa-sp.mk`. As an example to build the ``ts-service-test`` application execute the following
 commands from the root of the workspace::
 
     make -C build ffa-ts-service-test
@@ -143,7 +143,7 @@
 
 --------------
 
-.. _fvp-psa-sp.mk :https://github.com/OP-TEE/build/blob/master/fvp-psa-sp.mk
+.. _fvp-psa-sp.mk: https://github.com/OP-TEE/build/blob/master/fvp-psa-sp.mk
 
 *Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.*
 
diff --git a/docs/project/coding-guidelines.rst b/docs/project/coding-guidelines.rst
index 5b5607a..4251393 100644
--- a/docs/project/coding-guidelines.rst
+++ b/docs/project/coding-guidelines.rst
@@ -38,8 +38,8 @@
     * SPDX-License-Identifier: BSD-3-Clause
     */
 
-Boring stuff is not for smart people and the project uses the `Uncrustify`_ code beautifier to easy formatting the
-source. (See :download:`../../.uncrustify.cfg`)
+Boring stuff is not for smart people and the project uses the `Clang-Format`_ code beautifier to easy formatting the
+source. (See :download:`../../.clang-format`)
 
 CMake Rules
 -----------
@@ -80,7 +80,7 @@
 .. _`snake_case`: https://en.wikipedia.org/wiki/Snake_case
 .. _`CMake Documentation`: https://github.com/Kitware/CMake/blob/master/Help/dev/documentation.rst
 .. _`EditorConfig`: https://editorconfig.org/
-.. _`Uncrustify`: https://github.com/uncrustify/uncrustify
+.. _`Clang-Format`: https://clang.llvm.org/docs/ClangFormat.html
 
 *Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.*