Skip to content

Commit

Permalink
Fixing crash for links to non existing needs in table view (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-parkes authored Nov 13, 2024
1 parent ad076e3 commit ac83462
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ or you can include it only if the extension is available in your virtual environ
...
try:
import sphinx-needs-data-explorer
extensions.add('sphinx-needs-data-explorer')
import sphinx_needs_data_explorer
extensions.add('sphinx_needs_data_explorer')
except ImportError:
pass
...
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
project = "Sphinx Needs Data Explorer"
copyright = "2024, MP"
author = "MP"
release = "0.9.0"
version = "0.9.0"
release = "0.9.1"
version = "0.9.1"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ license = {file = "LICENSE"}

[tool.poetry]
name = "sphinx_needs_data_explorer"
version = "0.9.0"
version = "0.9.1"
description = "Sphinx-needs-data-explorer is a Sphinx extension to visualize Sphinx-Needs data"
authors = ["Michael Parkes <[email protected]>"]
readme = "README.rst"
Expand All @@ -19,7 +19,7 @@ exclude = [
]

[tool.poetry.dependencies]
python = "^3.12"
python = "^3.10"
Sphinx = ">=6.1.3"

[tool.poetry.group.dev.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions sphinx_needs_data_explorer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from sphinx.util import logging
from sphinx.errors import ExtensionError

__version__ = "0.9.0"
version_info = (0, 9, 0)
__version__ = "0.9.1"
version_info = (0, 9, 1)

logger = logging.getLogger(__name__)

Expand Down
18 changes: 11 additions & 7 deletions sphinx_needs_data_explorer/_static/sphinx_needs_data_explorer.html
Original file line number Diff line number Diff line change
Expand Up @@ -869,14 +869,18 @@ <h3>Sphinx-Needs attributes found in this project that can be used for data filt
function transformAndJoin(data,gnodes) {
const transformedData = [];
for (const key of data) {
const docname = gnodes[key]['data']?.["docname"];
if (docname) {
const transformedValue = `
<a href="../${docname}.html#${key}"
title="${docname}.html">${key}</a>`;
transformedData.push(transformedValue);
if(key in gnodes) {
const docname = gnodes[key]['data']?.["docname"];
if (docname) {
const transformedValue = `
<a href="../${docname}.html#${key}"
title="${docname}.html">${key}</a>`;
transformedData.push(transformedValue);
} else {
//transformedData.push("");
}
} else {
//transformedData.push("");
console.log(`key=${key} not found!`);
}
}
return transformedData;
Expand Down

0 comments on commit ac83462

Please sign in to comment.