Skip to content

Commit

Permalink
Add an option to disable rfc-local.css link (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson authored Aug 9, 2022
1 parent d111945 commit e5c45d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions xml2rfc/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ def main():
help=configargparse.SUPPRESS),
htmloptions.add_argument('--no-inline-version-info', action='store_false', dest="inline_version_info",
help=configargparse.SUPPRESS),
htmloptions.add_argument('--no-rfc-local', action='store_false', dest='rfc_local', default=True,
help='Do not link to rfc-local.css')

v2v3options = optionparser.add_argument_group('V2-V3 Converter Options')
v2v3options.add_argument('--add-xinclude', action='store_true',
Expand Down
1 change: 1 addition & 0 deletions xml2rfc/writers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
'raw': False,
'rfc': None,
'rfc_base_url': 'https://www.rfc-editor.org/rfc/',
'rfc_local': True,
'rfc_reference_base_url': 'https://rfc-editor.org/rfc/',
'silence': default_silenced_messages,
'skip_config_files': False,
Expand Down
2 changes: 1 addition & 1 deletion xml2rfc/writers/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def render_rfc(self, h, x):
else:
add.style(head, None, css, type="text/css")

if not (self.options.pdf and not os.path.exists('rfc-local.css')):
if self.options.rfc_local and (not self.options.pdf or os.path.exists('rfc-local.css')):
add.link(head, None, href="rfc-local.css", rel="stylesheet", type="text/css")

# 6.3.7. Links
Expand Down

0 comments on commit e5c45d4

Please sign in to comment.