]> git.madduck.net Git - etc/vim.git/blobdiff - docs/conf.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix dealing with generated files in docs
[etc/vim.git] / docs / conf.py
index 9e6a9bcaa620a95b2a4666d7080b7f70cfba97e1..8dd77b41d6149f4afa39b56390af1ada12052c8d 100644 (file)
@@ -184,11 +184,9 @@ def process_sections(
             contents = fix_headers(contents)
 
         with open(target_path, "w", encoding="utf-8") as f:
-            if section.src.suffix == ".md":
-                f.write(
-                    "[//]: # (NOTE: THIS FILE WAS AUTOGENERATED FROM"
-                    f" {section.src})\n\n"
-                )
+            if section.src.suffix == ".md" and section.src != target_path:
+                rel = section.src.resolve().relative_to(CURRENT_DIR.parent)
+                f.write(f'[//]: # "NOTE: THIS FILE WAS AUTOGENERATED FROM {rel}"\n\n')
             f.write(contents)
         processed_sections.add(section.name)
         modified_files.add(target_path)