Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed docs edit links #1525

Merged
merged 1 commit into from Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Expand Up @@ -43,7 +43,7 @@ repos:
hooks:
- id: doc8
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.26.0
rev: v1.26.1
hooks:
- id: yamllint
exclude: >
Expand All @@ -54,7 +54,7 @@ repos:
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.7.0
rev: v5.8.0
hooks:
- id: isort
args:
Expand All @@ -65,8 +65,8 @@ repos:
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.4
- repo: https://github.com/pycqa/flake8.git
rev: 3.9.0
hooks:
- id: flake8
language_version: python3
Expand Down
38 changes: 37 additions & 1 deletion docs/conf.py
Expand Up @@ -84,7 +84,20 @@

# General substitutions.
project = 'Ansible Lint Documentation'
copyright = "2013-2020 Ansible, Inc" # pylint: disable=redefined-builtin
copyright = "2013-2021 Ansible, Inc" # pylint: disable=redefined-builtin

github_url = "https://github.com"
github_repo_org = "ansible"
github_repo_name = "ansible-lint"
github_repo_slug = f"{github_repo_org}/{github_repo_name}"
github_repo_url = f"{github_url}/{github_repo_slug}"

extlinks = {
"issue": (f"{github_repo_url}/issues/%s", "#"),
"pr": (f"{github_repo_url}/pull/%s", "PR #"),
"commit": (f"{github_repo_url}/commit/%s", ""),
"gh": (f"{github_url}/%s", "GitHub: "),
}

# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
Expand Down Expand Up @@ -154,6 +167,29 @@

html_theme_path = ['../_themes']
html_theme = 'sphinx_ansible_theme'

html_theme_options = {
"collapse_navigation": False,
"analytics_id": "UA-128382387-1",
"style_nav_header_background": "#5bbdbf",
"style_external_links": True,
# 'canonical_url': "https://docs.ansible.com/ansible/latest/",
'vcs_pageview_mode': 'edit',
"navigation_depth": 3,
}

html_context = {
'display_github': 'True',
'github_user': 'ansible-community',
'github_repo': 'ansible-lint',
'github_version': 'master/docs/',
'current_version': version,
'latest_version': 'latest',
# list specifically out of order to make latest work
'available_versions': ('latest', 'stable'),
'css_files': (), # overrides to the standard theme
}

html_short_title = 'Ansible Lint Documentation'

# The style sheet to use for HTML and HTML Help pages. A file of that name
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/utils.py
Expand Up @@ -689,9 +689,9 @@ def compose_node(parent: yaml.nodes.Node, index: int) -> yaml.nodes.Node:
# the line number where the previous token has ended (plus empty lines)
line = loader.line
node = Composer.compose_node(loader, parent, index) # type: ignore
node.__line__ = line + 1
if not isinstance(node, yaml.nodes.Node):
raise RuntimeError("Unexpected yaml data.")
setattr(node, '__line__', line + 1)
return node

def construct_mapping(
Expand Down