prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Provide Markdown help with links to local documentation pages
  ### NetBox version
  
  v3.2.4
  
  ### Feature type
  
  New functionality
  
  ### Proposed functionality
  
  Currently netbox supports a documentation package as part of the main release due to https://github.com/netbox-community/netbox/issues/6328
  
  I propose to change the Markdown assistance available in some text areas ( for example in comments fields) that is currently going to "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" to another URL as part of the offline documentation package 
  ![image](https://user-images.githubusercontent.com/44149262/173758856-79739e48-1eb3-4173-9b09-9908fa1c92df.png)
  
  I propose that a new section in the documentation package is created, based in the github url above, and use the corresponding link within this assistance fields. 
  
  The final url could be something like, if this section is placed under references. 
  https://netboxfqdn/static/docs/reference/markdown/
  
  ### Use case
  
  
  
  The following use cases are applicable:
  
      Provide the correct documentation that is always related to the specific version being used, instead of the online version that refers the latest version.
      Provide access to the documentation to system installed in a isolated management environment that do not have internet access.
  
  
  ### Database changes
  
  none
  
  ### External dependencies
  
  none
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `netbox/utilities/forms/fields/fields.py`
  Content:
  ```
  1 import json
  2 
  3 from django import forms
  4 from django.db.models import Count
  5 from django.forms.fields import JSONField as _JSONField, InvalidJSONInput
  6 from netaddr import AddrFormatError, EUI
  7 
  8 from utilities.forms import widgets
  9 from utilities.validators import EnhancedURLValidator
  10 
  11 __all__ = (
  12     'ChoiceField',
  13     'ColorField',
  14     'CommentField',
  15     'JSONField',
  16     'LaxURLField',
  17     'MACAddressField',
  18     'MultipleChoiceField',
  19     'SlugField',
  20     'TagFilterField',
  21 )
  22 
  23 
  24 class CommentField(forms.CharField):
  25     """
  26     A textarea with support for Markdown rendering. Exists mostly just to add a standard `help_text`.
  27     """
  28     widget = forms.Textarea
  29     # TODO: Port Markdown cheat sheet to internal documentation
  30     help_text = """
  31         <i class="mdi mdi-information-outline"></i>
  32         <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank" tabindex="-1">
  33         Markdown</a> syntax is supported
  34     """
  35 
  36     def __init__(self, *, label='', help_text=help_text, required=False, **kwargs):
  37         super().__init__(label=label, help_text=help_text, required=required, **kwargs)
  38 
  39 
  40 class SlugField(forms.SlugField):
  41     """
  42     Extend Django's built-in SlugField to automatically populate from a field called `name` unless otherwise specified.
  43 
  44     Parameters:
  45         slug_source: Name of the form field from which the slug value will be derived
  46     """
  47     widget = widgets.SlugWidget
  48     help_text = "URL-friendly unique shorthand"
  49 
  50     def __init__(self, *, slug_source='name', help_text=help_text, **kwargs):
  51         super().__init__(help_text=help_text, **kwargs)
  52 
  53         self.widget.attrs['slug-source'] = slug_source
  54 
  55 
  56 class ColorField(forms.CharField):
  57     """
  58     A field which represents a color value in hexadecimal `RRGGBB` format. Utilizes NetBox's `ColorSelect` widget to
  59     render choices.
  60     """
  61     widget = widgets.ColorSelect
  62 
  63 
  64 class TagFilterField(forms.MultipleChoiceField):
  65     """
  66     A filter field for the tags of a model. Only the tags used by a model are displayed.
  67 
  68     :param model: The model of the filter
  69     """
  70     widget = widgets.StaticSelectMultiple
  71 
  72     def __init__(self, model, *args, **kwargs):
  73         def get_choices():
  74             tags = model.tags.annotate(
  75                 count=Count('extras_taggeditem_items')
  76             ).order_by('name')
  77             return [
  78                 (str(tag.slug), '{} ({})'.format(tag.name, tag.count)) for tag in tags
  79             ]
  80 
  81         # Choices are fetched each time the form is initialized
  82         super().__init__(label='Tags', choices=get_choices, required=False, *args, **kwargs)
  83 
  84 
  85 class LaxURLField(forms.URLField):
  86     """
  87     Modifies Django's built-in URLField to remove the requirement for fully-qualified domain names
  88     (e.g. http://myserver/ is valid)
  89     """
  90     default_validators = [EnhancedURLValidator()]
  91 
  92 
  93 class JSONField(_JSONField):
  94     """
  95     Custom wrapper around Django's built-in JSONField to avoid presenting "null" as the default text.
  96     """
  97     def __init__(self, *args, **kwargs):
  98         super().__init__(*args, **kwargs)
  99         if not self.help_text:
  100             self.help_text = 'Enter context data in <a href="https://json.org/">JSON</a> format.'
  101             self.widget.attrs['placeholder'] = ''
  102 
  103     def prepare_value(self, value):
  104         if isinstance(value, InvalidJSONInput):
  105             return value
  106         if value is None:
  107             return ''
  108         return json.dumps(value, sort_keys=True, indent=4)
  109 
  110 
  111 class MACAddressField(forms.Field):
  112     """
  113     Validates a 48-bit MAC address.
  114     """
  115     widget = forms.CharField
  116     default_error_messages = {
  117         'invalid': 'MAC address must be in EUI-48 format',
  118     }
  119 
  120     def to_python(self, value):
  121         value = super().to_python(value)
  122 
  123         # Validate MAC address format
  124         try:
  125             value = EUI(value.strip())
  126         except AddrFormatError:
  127             raise forms.ValidationError(self.error_messages['invalid'], code='invalid')
  128 
  129         return value
  130 
  131 
  132 #
  133 # Choice fields
  134 #
  135 
  136 class ChoiceField(forms.ChoiceField):
  137     """
  138     Overrides Django's built-in `ChoiceField` to use NetBox's `StaticSelect` widget
  139     """
  140     widget = widgets.StaticSelect
  141 
  142 
  143 class MultipleChoiceField(forms.MultipleChoiceField):
  144     """
  145     Overrides Django's built-in `MultipleChoiceField` to use NetBox's `StaticSelectMultiple` widget
  146     """
  147     widget = widgets.StaticSelectMultiple
  148
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/netbox/utilities/forms/fields/fields.py b/netbox/utilities/forms/fields/fields.py
  --- a/netbox/utilities/forms/fields/fields.py
  +++ b/netbox/utilities/forms/fields/fields.py
  @@ -3,6 +3,7 @@
   from django import forms
   from django.db.models import Count
   from django.forms.fields import JSONField as _JSONField, InvalidJSONInput
  +from django.templatetags.static import static
   from netaddr import AddrFormatError, EUI
   
   from utilities.forms import widgets
  @@ -26,10 +27,9 @@
       A textarea with support for Markdown rendering. Exists mostly just to add a standard `help_text`.
       """
       widget = forms.Textarea
  -    # TODO: Port Markdown cheat sheet to internal documentation
  -    help_text = """
  +    help_text = f"""
           <i class="mdi mdi-information-outline"></i>
  -        <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank" tabindex="-1">
  +        <a href="{static('docs/reference/markdown/')}" target="_blank" tabindex="-1">
           Markdown</a> syntax is supported
       """
  
verification_info: {"golden_diff": "diff --git a/netbox/utilities/forms/fields/fields.py b/netbox/utilities/forms/fields/fields.py\n--- a/netbox/utilities/forms/fields/fields.py\n+++ b/netbox/utilities/forms/fields/fields.py\n@@ -3,6 +3,7 @@\n from django import forms\n from django.db.models import Count\n from django.forms.fields import JSONField as _JSONField, InvalidJSONInput\n+from django.templatetags.static import static\n from netaddr import AddrFormatError, EUI\n \n from utilities.forms import widgets\n@@ -26,10 +27,9 @@\n     A textarea with support for Markdown rendering. Exists mostly just to add a standard `help_text`.\n     \"\"\"\n     widget = forms.Textarea\n-    # TODO: Port Markdown cheat sheet to internal documentation\n-    help_text = \"\"\"\n+    help_text = f\"\"\"\n         <i class=\"mdi mdi-information-outline\"></i>\n-        <a href=\"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet\" target=\"_blank\" tabindex=\"-1\">\n+        <a href=\"{static('docs/reference/markdown/')}\" target=\"_blank\" tabindex=\"-1\">\n         Markdown</a> syntax is supported\n     \"\"\"\n", "issue": "Provide Markdown help with links to local documentation pages\n### NetBox version\n\nv3.2.4\n\n### Feature type\n\nNew functionality\n\n### Proposed functionality\n\nCurrently netbox supports a documentation package as part of the main release due to https://github.com/netbox-community/netbox/issues/6328\r\n\r\nI propose to change the Markdown assistance available in some text areas ( for example in comments fields) that is currently going to \"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet\" to another URL as part of the offline documentation package \r\n![image](https://user-images.githubusercontent.com/44149262/173758856-79739e48-1eb3-4173-9b09-9908fa1c92df.png)\r\n\r\nI propose that a new section in the documentation package is created, based in the github url above, and use the corresponding link within this assistance fields. \r\n\r\nThe final url could be something like, if this section is placed under references. \r\nhttps://netboxfqdn/static/docs/reference/markdown/\n\n### Use case\n\n\r\n\r\nThe following use cases are applicable:\r\n\r\n    Provide the correct documentation that is always related to the specific version being used, instead of the online version that refers the latest version.\r\n    Provide access to the documentation to system installed in a isolated management environment that do not have internet access.\r\n\n\n### Database changes\n\nnone\n\n### External dependencies\n\nnone\n", "before_files": [{"content": "import json\n\nfrom django import forms\nfrom django.db.models import Count\nfrom django.forms.fields import JSONField as _JSONField, InvalidJSONInput\nfrom netaddr import AddrFormatError, EUI\n\nfrom utilities.forms import widgets\nfrom utilities.validators import EnhancedURLValidator\n\n__all__ = (\n    'ChoiceField',\n    'ColorField',\n    'CommentField',\n    'JSONField',\n    'LaxURLField',\n    'MACAddressField',\n    'MultipleChoiceField',\n    'SlugField',\n    'TagFilterField',\n)\n\n\nclass CommentField(forms.CharField):\n    \"\"\"\n    A textarea with support for Markdown rendering. Exists mostly just to add a standard `help_text`.\n    \"\"\"\n    widget = forms.Textarea\n    # TODO: Port Markdown cheat sheet to internal documentation\n    help_text = \"\"\"\n        <i class=\"mdi mdi-information-outline\"></i>\n        <a href=\"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet\" target=\"_blank\" tabindex=\"-1\">\n        Markdown</a> syntax is supported\n    \"\"\"\n\n    def __init__(self, *, label='', help_text=help_text, required=False, **kwargs):\n        super().__init__(label=label, help_text=help_text, required=required, **kwargs)\n\n\nclass SlugField(forms.SlugField):\n    \"\"\"\n    Extend Django's built-in SlugField to automatically populate from a field called `name` unless otherwise specified.\n\n    Parameters:\n        slug_source: Name of the form field from which the slug value will be derived\n    \"\"\"\n    widget = widgets.SlugWidget\n    help_text = \"URL-friendly unique shorthand\"\n\n    def __init__(self, *, slug_source='name', help_text=help_text, **kwargs):\n        super().__init__(help_text=help_text, **kwargs)\n\n        self.widget.attrs['slug-source'] = slug_source\n\n\nclass ColorField(forms.CharField):\n    \"\"\"\n    A field which represents a color value in hexadecimal `RRGGBB` format. Utilizes NetBox's `ColorSelect` widget to\n    render choices.\n    \"\"\"\n    widget = widgets.ColorSelect\n\n\nclass TagFilterField(forms.MultipleChoiceField):\n    \"\"\"\n    A filter field for the tags of a model. Only the tags used by a model are displayed.\n\n    :param model: The model of the filter\n    \"\"\"\n    widget = widgets.StaticSelectMultiple\n\n    def __init__(self, model, *args, **kwargs):\n        def get_choices():\n            tags = model.tags.annotate(\n                count=Count('extras_taggeditem_items')\n            ).order_by('name')\n            return [\n                (str(tag.slug), '{} ({})'.format(tag.name, tag.count)) for tag in tags\n            ]\n\n        # Choices are fetched each time the form is initialized\n        super().__init__(label='Tags', choices=get_choices, required=False, *args, **kwargs)\n\n\nclass LaxURLField(forms.URLField):\n    \"\"\"\n    Modifies Django's built-in URLField to remove the requirement for fully-qualified domain names\n    (e.g. http://myserver/ is valid)\n    \"\"\"\n    default_validators = [EnhancedURLValidator()]\n\n\nclass JSONField(_JSONField):\n    \"\"\"\n    Custom wrapper around Django's built-in JSONField to avoid presenting \"null\" as the default text.\n    \"\"\"\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        if not self.help_text:\n            self.help_text = 'Enter context data in <a href=\"https://json.org/\">JSON</a> format.'\n            self.widget.attrs['placeholder'] = ''\n\n    def prepare_value(self, value):\n        if isinstance(value, InvalidJSONInput):\n            return value\n        if value is None:\n            return ''\n        return json.dumps(value, sort_keys=True, indent=4)\n\n\nclass MACAddressField(forms.Field):\n    \"\"\"\n    Validates a 48-bit MAC address.\n    \"\"\"\n    widget = forms.CharField\n    default_error_messages = {\n        'invalid': 'MAC address must be in EUI-48 format',\n    }\n\n    def to_python(self, value):\n        value = super().to_python(value)\n\n        # Validate MAC address format\n        try:\n            value = EUI(value.strip())\n        except AddrFormatError:\n            raise forms.ValidationError(self.error_messages['invalid'], code='invalid')\n\n        return value\n\n\n#\n# Choice fields\n#\n\nclass ChoiceField(forms.ChoiceField):\n    \"\"\"\n    Overrides Django's built-in `ChoiceField` to use NetBox's `StaticSelect` widget\n    \"\"\"\n    widget = widgets.StaticSelect\n\n\nclass MultipleChoiceField(forms.MultipleChoiceField):\n    \"\"\"\n    Overrides Django's built-in `MultipleChoiceField` to use NetBox's `StaticSelectMultiple` widget\n    \"\"\"\n    widget = widgets.StaticSelectMultiple\n", "path": "netbox/utilities/forms/fields/fields.py"}], "after_files": [{"content": "import json\n\nfrom django import forms\nfrom django.db.models import Count\nfrom django.forms.fields import JSONField as _JSONField, InvalidJSONInput\nfrom django.templatetags.static import static\nfrom netaddr import AddrFormatError, EUI\n\nfrom utilities.forms import widgets\nfrom utilities.validators import EnhancedURLValidator\n\n__all__ = (\n    'ChoiceField',\n    'ColorField',\n    'CommentField',\n    'JSONField',\n    'LaxURLField',\n    'MACAddressField',\n    'MultipleChoiceField',\n    'SlugField',\n    'TagFilterField',\n)\n\n\nclass CommentField(forms.CharField):\n    \"\"\"\n    A textarea with support for Markdown rendering. Exists mostly just to add a standard `help_text`.\n    \"\"\"\n    widget = forms.Textarea\n    help_text = f\"\"\"\n        <i class=\"mdi mdi-information-outline\"></i>\n        <a href=\"{static('docs/reference/markdown/')}\" target=\"_blank\" tabindex=\"-1\">\n        Markdown</a> syntax is supported\n    \"\"\"\n\n    def __init__(self, *, label='', help_text=help_text, required=False, **kwargs):\n        super().__init__(label=label, help_text=help_text, required=required, **kwargs)\n\n\nclass SlugField(forms.SlugField):\n    \"\"\"\n    Extend Django's built-in SlugField to automatically populate from a field called `name` unless otherwise specified.\n\n    Parameters:\n        slug_source: Name of the form field from which the slug value will be derived\n    \"\"\"\n    widget = widgets.SlugWidget\n    help_text = \"URL-friendly unique shorthand\"\n\n    def __init__(self, *, slug_source='name', help_text=help_text, **kwargs):\n        super().__init__(help_text=help_text, **kwargs)\n\n        self.widget.attrs['slug-source'] = slug_source\n\n\nclass ColorField(forms.CharField):\n    \"\"\"\n    A field which represents a color value in hexadecimal `RRGGBB` format. Utilizes NetBox's `ColorSelect` widget to\n    render choices.\n    \"\"\"\n    widget = widgets.ColorSelect\n\n\nclass TagFilterField(forms.MultipleChoiceField):\n    \"\"\"\n    A filter field for the tags of a model. Only the tags used by a model are displayed.\n\n    :param model: The model of the filter\n    \"\"\"\n    widget = widgets.StaticSelectMultiple\n\n    def __init__(self, model, *args, **kwargs):\n        def get_choices():\n            tags = model.tags.annotate(\n                count=Count('extras_taggeditem_items')\n            ).order_by('name')\n            return [\n                (str(tag.slug), '{} ({})'.format(tag.name, tag.count)) for tag in tags\n            ]\n\n        # Choices are fetched each time the form is initialized\n        super().__init__(label='Tags', choices=get_choices, required=False, *args, **kwargs)\n\n\nclass LaxURLField(forms.URLField):\n    \"\"\"\n    Modifies Django's built-in URLField to remove the requirement for fully-qualified domain names\n    (e.g. http://myserver/ is valid)\n    \"\"\"\n    default_validators = [EnhancedURLValidator()]\n\n\nclass JSONField(_JSONField):\n    \"\"\"\n    Custom wrapper around Django's built-in JSONField to avoid presenting \"null\" as the default text.\n    \"\"\"\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        if not self.help_text:\n            self.help_text = 'Enter context data in <a href=\"https://json.org/\">JSON</a> format.'\n            self.widget.attrs['placeholder'] = ''\n\n    def prepare_value(self, value):\n        if isinstance(value, InvalidJSONInput):\n            return value\n        if value is None:\n            return ''\n        return json.dumps(value, sort_keys=True, indent=4)\n\n\nclass MACAddressField(forms.Field):\n    \"\"\"\n    Validates a 48-bit MAC address.\n    \"\"\"\n    widget = forms.CharField\n    default_error_messages = {\n        'invalid': 'MAC address must be in EUI-48 format',\n    }\n\n    def to_python(self, value):\n        value = super().to_python(value)\n\n        # Validate MAC address format\n        try:\n            value = EUI(value.strip())\n        except AddrFormatError:\n            raise forms.ValidationError(self.error_messages['invalid'], code='invalid')\n\n        return value\n\n\n#\n# Choice fields\n#\n\nclass ChoiceField(forms.ChoiceField):\n    \"\"\"\n    Overrides Django's built-in `ChoiceField` to use NetBox's `StaticSelect` widget\n    \"\"\"\n    widget = widgets.StaticSelect\n\n\nclass MultipleChoiceField(forms.MultipleChoiceField):\n    \"\"\"\n    Overrides Django's built-in `MultipleChoiceField` to use NetBox's `StaticSelectMultiple` widget\n    \"\"\"\n    widget = widgets.StaticSelectMultiple\n", "path": "netbox/utilities/forms/fields/fields.py"}]}