prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add "edit this page" link on docs?
  It would link to the GitHub editor page.
  
  
  </issue>
  <code>
  [start of ocfweb/docs/doc.py]
  1 from collections import namedtuple
  2 
  3 
  4 class Document(namedtuple('Document', ['name', 'title', 'render'])):
  5 
  6     @property
  7     def category(self):
  8         """Return full category path of the document.
  9 
  10         For example, "/" or "/staff/backend/".
  11         """
  12         return self.name.rsplit('/', 1)[0] + '/'
  13 
  14     @property
  15     def category_for_sidebar(self):
  16         """Return the category to show similar pages for in the sidebar.
  17 
  18         If this page isn't at the root category, we just return this page's
  19         category.
  20 
  21         If this page is at the root category, we return the category rooted at
  22         this page (which may or may not have any pages in it).
  23         """
  24         if self.category == '/':
  25             return self.name + '/'
  26         else:
  27             return self.category
  28
  [end of ocfweb/docs/doc.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/ocfweb/docs/doc.py b/ocfweb/docs/doc.py
  --- a/ocfweb/docs/doc.py
  +++ b/ocfweb/docs/doc.py
  @@ -25,3 +25,12 @@
               return self.name + '/'
           else:
               return self.category
  +
  +    @property
  +    def edit_url(self):
  +        """Return a GitHub edit URL for this page."""
  +        return (
  +            'https://github.com/ocf/ocfweb/edit/master/ocfweb/docs/docs' +
  +            self.name +
  +            '.md'
  +        )
  
verification_info: {"golden_diff": "diff --git a/ocfweb/docs/doc.py b/ocfweb/docs/doc.py\n--- a/ocfweb/docs/doc.py\n+++ b/ocfweb/docs/doc.py\n@@ -25,3 +25,12 @@\n             return self.name + '/'\n         else:\n             return self.category\n+\n+    @property\n+    def edit_url(self):\n+        \"\"\"Return a GitHub edit URL for this page.\"\"\"\n+        return (\n+            'https://github.com/ocf/ocfweb/edit/master/ocfweb/docs/docs' +\n+            self.name +\n+            '.md'\n+        )\n", "issue": "Add \"edit this page\" link on docs?\nIt would link to the GitHub editor page.\n\n", "before_files": [{"content": "from collections import namedtuple\n\n\nclass Document(namedtuple('Document', ['name', 'title', 'render'])):\n\n    @property\n    def category(self):\n        \"\"\"Return full category path of the document.\n\n        For example, \"/\" or \"/staff/backend/\".\n        \"\"\"\n        return self.name.rsplit('/', 1)[0] + '/'\n\n    @property\n    def category_for_sidebar(self):\n        \"\"\"Return the category to show similar pages for in the sidebar.\n\n        If this page isn't at the root category, we just return this page's\n        category.\n\n        If this page is at the root category, we return the category rooted at\n        this page (which may or may not have any pages in it).\n        \"\"\"\n        if self.category == '/':\n            return self.name + '/'\n        else:\n            return self.category\n", "path": "ocfweb/docs/doc.py"}]}