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

Parse .-prefixed reference identifiers (relative identifiers) #37

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@

import os
import sys
from importlib.metadata import version as pkgversion
from pathlib import Path
from typing import TYPE_CHECKING, Any

from duty import duty
from duty.callables import black, blacken_docs, coverage, lazy, mkdocs, mypy, pytest, ruff, safety

if sys.version_info < (3, 8):
from importlib_metadata import version as pkgversion
else:
from importlib.metadata import version as pkgversion


if TYPE_CHECKING:
from duty.context import Context

Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,7 @@ typing = [
security = [
"safety>=2",
]

[tool.ruff]
# Full config is in config/ruff.toml
line-length = 132
7 changes: 1 addition & 6 deletions scripts/gen_credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import re
import sys
from importlib.metadata import PackageNotFoundError, metadata
from itertools import chain
from pathlib import Path
from textwrap import dedent
Expand All @@ -13,11 +13,6 @@
from jinja2 import StrictUndefined
from jinja2.sandbox import SandboxedEnvironment

if sys.version_info < (3, 8):
from importlib_metadata import PackageNotFoundError, metadata
else:
from importlib.metadata import PackageNotFoundError, metadata

project_dir = Path(".")
pyproject = toml.load(project_dir / "pyproject.toml")
project = pyproject["project"]
Expand Down
3 changes: 2 additions & 1 deletion src/mkdocs_autorefs/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def handleMatch(self, m: Match[str], data: Any) -> Element | EvalIDType: # type
def evalId(self, data: str, index: int, text: str) -> EvalIDType: # noqa: N802 (parent's casing)
"""Evaluate the id portion of `[ref][id]`.

If `[ref][]` use `[ref]`.
If `[ref][]` use "ref".
If `[ref][id]` use "id".

Arguments:
data: The data to evaluate.
Expand Down