aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLoek Le Blansch <loek.le-blansch.pv@renesas.com>2025-10-30 08:11:35 +0100
committerLoek Le Blansch <loek.le-blansch.pv@renesas.com>2025-10-30 08:11:35 +0100
commitb18d0b52a06bd7d36af0768235ac6f7a07cde813 (patch)
tree6f4a25fa7c594b61a01c40c15416b1645e0d752f /doc
parentedc7fa6838f700ab51f4f7ba1820b412eed66888 (diff)
more docs
Diffstat (limited to 'doc')
-rw-r--r--doc/api/index.rst2
-rw-r--r--doc/conf.py2
-rw-r--r--doc/dev/index.rst4
-rw-r--r--doc/dev/processor.rst114
4 files changed, 37 insertions, 85 deletions
diff --git a/doc/api/index.rst b/doc/api/index.rst
index b4678f8..feb1740 100644
--- a/doc/api/index.rst
+++ b/doc/api/index.rst
@@ -1,3 +1,5 @@
+.. _api:
+
API reference
=============
diff --git a/doc/conf.py b/doc/conf.py
index 07823d6..0dc01c8 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -18,7 +18,7 @@ extensions = [
]
templates_path = []
exclude_patterns = []
-html_theme = "alabaster"
+html_theme = "sphinx_rtd_theme"
html_static_path = []
autodoc_mock_imports = [project]
diff --git a/doc/dev/index.rst b/doc/dev/index.rst
index 66bd679..523e6a9 100644
--- a/doc/dev/index.rst
+++ b/doc/dev/index.rst
@@ -109,6 +109,10 @@ The configuration file is a Python file sourced from ``ptconfig.py`` relative to
This file is a regular Python source file and can contain any arbitrary code.
Any global definitions with an identical name to a member variable of the :any:`Config` class will override the global configuration instance's value.
+The main method in which patchtree is configured is by creating subclasses of its internal classes and overriding its methods.
+In order to facilitate this, the type of most classes is read from the :any:`Config` dataclass instead of being instantiated directly.
+Please take a look at the :ref:`api` for more info.
+
For example:
.. code:: none
diff --git a/doc/dev/processor.rst b/doc/dev/processor.rst
index 0a19ab8..018d216 100644
--- a/doc/dev/processor.rst
+++ b/doc/dev/processor.rst
@@ -16,28 +16,14 @@ Note that some processors may take positional arguments, while others may use ke
Identity
********
-The identity processor is used to "touch" files or add arbitrary identifiers to patchset source filenames through its arguments.
+The identity processor is used to "touch" files, change the mode of existing files, or add arbitrary identifiers to patchset source filenames by passing arbitrary arguments.
-.. list-table::
- :stub-columns: 1
-
- * - Class
- - :any:`ProcessIdentity`
- * - Identifier
- - ``id``
-
-Input
- Ignored.
-
-Output
- The *content* of the target file.
-
- .. note::
-
- Changing the patchset input's mode *will* affect the target file mode!
-
-Arguments
- Any arguments passed to this processor are ignored.
+:Class: :any:`ProcessIdentity`
+:Identifier: ``id``
+:Input: Ignored.
+:Output:
+ A file with the *content* of the target file and *mode* of the patchset input.
+:Arguments: Any arguments passed to this processor are ignored.
.. _process_cocci:
@@ -51,22 +37,11 @@ The Coccinelle processor uses Coccinelle to apply patch(es) in the SmPL (Semanti
In order to use this processor, Coccinelle must be installed and ``spatch`` must be available in ``$PATH``.
-.. list-table::
- :stub-columns: 1
-
- * - Class
- - :any:`ProcessCoccinelle`
- * - Identifier
- - ``cocci``
-
-Input
- Coccinelle's SmPL input.
-
-Output
- The contents of the target file after being processed by Coccinelle (not the diff returned by Coccinelle).
-
-Arguments
- Reserved.
+:Class: :any:`ProcessCoccinelle`
+:Identifier: ``cocci``
+:Input: Coccinelle's SmPL input.
+:Output: The contents of the target file after being processed by Coccinelle (not the diff returned by Coccinelle).
+:Arguments: Reserved.
.. _process_jinja:
@@ -74,30 +49,19 @@ Arguments
Jinja template
**************
-The Jinja processor passes the inputs through the Jinja2 templating engine.
+The Jinja processor passes the input through the Jinja2 templating engine.
+
+:Class: :any:`ProcessJinja2`
+:Identifier: ``jinja``
+:Input: Jinja template code.
+:Output: The input after being processed by Jinja.
+:Arguments: Reserved.
.. note::
Template variables are generated through the :any:`get_template_vars <ProcessJinja2.get_template_vars>` method.
This method returns an empty dict by default, and is meant to be implemented by implementing a custom class that derives from ProcessJinja2 and registering it through the :ref:`configuration file <ptconfig>`.
-.. list-table::
- :stub-columns: 1
-
- * - Class
- - :any:`ProcessJinja2`
- * - Identifier
- - ``jinja``
-
-Input
- Jinja template code.
-
-Output
- The input after being processed by Jinja.
-
-Arguments
- Reserved.
-
.. _process_exe:
**********
@@ -106,26 +70,17 @@ Executable
The executable processor runs the input as an executable, passes the target file to its standard input, and returns its standard output.
-.. list-table::
- :stub-columns: 1
-
- * - Class
- - :any:`ProcessExec`
- * - Identifier
- - ``exec``
-
-Input
+:Class: :any:`ProcessExec`
+:Identifier: ``exec``
+:Input:
Executable script.
.. important::
- The executable must contain a shebang line to specify what interpreter to use.
-
-Output
- Any content written to the standard output by the executable.
+ The executable *must* contain a shebang line to specify what interpreter to use.
-Arguments
- Reserved.
+:Output: Any content written to the standard output by the executable.
+:Arguments: Reserved.
.. _process_merge:
@@ -135,21 +90,12 @@ Merge
The merge processor merges the input with the target file, such that changes are combined with the target instead of replacing the target.
-.. list-table::
- :stub-columns: 1
-
- * - Class
- - :any:`ProcessMerge`
- * - Identifier
- - ``merge``
-
-Input
- Content to merge.
-
-Output
- Merged changes.
+:Class: :any:`ProcessMerge`
+:Identifier: ``merge``
+:Input: Content to merge.
+:Output: Merged changes.
+:Arguments: Positional.
-Arguments (positional)
1. Merge strategy:
``ignore``