Re: [PATCH yocto-autobuilder-helper v7] Add a banner on the old documentation docs.

Quentin Schulz

Hi Amahnui,

We're making progress in the right direction :)

On 4/22/22 16:46, Abongwa Amahnui Bonalais wrote:
Also added a command in the run-docs-build file to run the python script once in the extracted tarball directory.
Signed-off-by: Abongwa Bonalais Amahnui <abongwabonalais@...>
--- | 79 ++++++++++++++++++++++++++++++++++++++++
run-docs-build | 2 +
This is still not a valid path for the yocto-autobuilder-helper git repo. It should say scripts/ and scripts/run-docs-build (do not modify it by hand :) ).

See for yourself:
This is the root of the directory, where your patch would be applied. You can see that no run-docs-build file exists there so your patch will not work.

However, in, the scripts directory, does have a run-docs-build script so your patch would apply nicely there.

Would you mind telling us how you created your patch from a commit so we can help you fix the issue there?

A simple test to do to check if your patch can be applied is to try to apply it yourself.

Provided you have your patch file (the one you sent with git send-email!) named my.patch and located in /path/to/, run:

git clone
git am /path/to/my.patch

If it works, all good!
If it does not, something needs to be fixed.

2 files changed, 81 insertions(+)
create mode 100755
diff --git a/ b/
new file mode 100755
index 0000000..7693b04
--- /dev/null
+++ b/
@@ -0,0 +1,79 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0-only
+#Signed-off-by: Abongwa Bonalais Amahnui <abongwabonalais@...>
+# function to append to the content of a html file below the body tag
+import os
+html_content = '''
+<div id="outdated-warning">This document is outdated, you should select the <a href=";d=DwMDAg&amp;c=_sEr5x9kUWhuk4_nFwjJtA&amp;r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&amp;m=-ULgl-z1-zhWlVwi9is-bYWx7lKkN4sSFIjTA5iLznFlf3FeAUGfaMjacPXNWRLq&amp;s=EM6Y0EHYD3ploYECnvyUDTcYIhz2jGXOgFD_q0_8A7Q&amp;e=">latest release version</a> in this series.</div>
I'm not sure how picky we want to be, but I imagine we want anything that is not dunfell (so anything not from 3.1.x release) to display that it is obsolete and the user should consider upgrading to a newer release.
For dunfell, the message above is fine (because dunfell is still supported, and all other releases in those old docs aren't anymore).

+<div xml:lang="en" class="body" lang="en">
+last_div = '''
+css_replacement_content = '''
+ font-family: Verdana, Sans, sans-serif;
+ /*min-width: 640px;*/
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ color: #333;
+ overflow-x: hidden;
+ }
+ /*added books too*/
+margin: 0 auto;
+min-width: 640px;
+padding: 0 5em 5em 5em;
+/* added the id below to make the banner show and be fixed*/
+text-align: center;
+background-color: rgb(255, 186, 186);
+color: rgb(106, 14, 14);
+padding: 0.5em 0;
+width: 100%;
+position: fixed;
+top: 0;
+def loop_through_html_directories(dir):
+ for dirpath, dirnames, filenames in os.walk(dir):
+ # loop through all files in the directory
+ for filename in filenames:
+ # check if the file is an html file
+ if filename.endswith('.html'):
+ # open the html file in read mode
+ with open(os.path.join(dirpath, filename), 'r', encoding="ISO-8859-1") as f:
+ # read the content of the html file
+ current_content =
+ # open the html file in write mode
+ with open(os.path.join(dirpath, filename), 'w') as f:
+ # write the content of the html file
+ f.write(current_content.replace('<body>', '<body>' + html_content))
+ f.write(current_content.replace('</body>', last_div + '</body>'))
+ if filename.endswith('.css'):
This used to modify only style.css but now it tries to modify all css files. Did you test this version of the script? Are you sure it does not break other css files?


Join to automatically receive all group messages.