aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2025-10-30 19:19:40 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2025-10-30 19:19:40 +0100
commit5e723d53077210bc51272320b76577b44730c55e (patch)
treeca57db0556613f8184b779ddc09f3a576d4a274f
parent923ceed965328188234554b059de7e1f8703cce7 (diff)
more documentation tweaks
-rw-r--r--.editorconfig2
-rw-r--r--doc/conf.py5
-rw-r--r--doc/index.rst20
-rw-r--r--patchtree/diff.py5
-rw-r--r--pyproject.toml2
-rw-r--r--readme.rst2
6 files changed, 29 insertions, 7 deletions
diff --git a/.editorconfig b/.editorconfig
index c4d6fb1..44f19e2 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -3,7 +3,7 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
-max_line_length = 110
+max_line_length = 95
[*.py]
indent_size = 4
diff --git a/doc/conf.py b/doc/conf.py
index 0dc01c8..477a00d 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -12,10 +12,7 @@ import patchtree
project = "patchtree"
release = "???"
-extensions = [
- "sphinx.ext.autodoc",
- "sphinx_automodapi.automodapi",
-]
+extensions = ["sphinx.ext.autodoc"]
templates_path = []
exclude_patterns = []
html_theme = "sphinx_rtd_theme"
diff --git a/doc/index.rst b/doc/index.rst
index 5b13ded..ab8649a 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -1,4 +1,24 @@
+.. raw:: html
+
+ <style>
+ pre {
+ padding: unset !important;
+ font-family: monospace !important;
+ margin: 0 auto !important;
+ width: min-content;
+ }
+
+ .highlight {
+ background: unset;
+ }
+
+ .rst-content div[class^=highlight] {
+ border: none;
+ }
+ </style>
+
.. include:: ../readme.rst
+ :end-line: 18
#############
Documentation
diff --git a/patchtree/diff.py b/patchtree/diff.py
index 5a76487..4d4a998 100644
--- a/patchtree/diff.py
+++ b/patchtree/diff.py
@@ -17,6 +17,9 @@ class File:
"""The file's mode as returned by stat(3)'s ``stat.st_mode``."""
def is_binary(self) -> bool:
+ """
+ :returns: A boolean representing whether this file's content is binary.
+ """
return isinstance(self.content, bytes)
def lines(self) -> list[str]:
@@ -29,7 +32,7 @@ class File:
.. note::
- This function only works for text files. Use :any:`File.is_binary` to check this safely.
+ This function only works for text files. Use :any:`is_binary` to check this safely.
"""
assert not isinstance(self.content, bytes)
return (self.content or "").splitlines()
diff --git a/pyproject.toml b/pyproject.toml
index 2835ae7..713b293 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -24,4 +24,4 @@ Homepage = "https://bitbucket.global.renesas.com/users/loek.le-blansch.pv_renesa
patchtree = "patchtree.cli:main"
[tool.black]
-line-length = 110
+line-length = 95
diff --git a/readme.rst b/readme.rst
index a40c07b..8e4b901 100644
--- a/readme.rst
+++ b/readme.rst
@@ -16,3 +16,5 @@
Patchtree is a tool for generating clean patches for external source trees.
It allows both patch sources to be maintained separately from the sources they apply to, and templating or scripting of the patches themselves in order to adjust to variations in the external source tree.
This makes it a useful for automating the process of backporting bugfixes or adding functionality to existing software releases.
+
+See `<https://patchtree.readthedocs.io>`_ for user, developer and API documentation.