-
Notifications
You must be signed in to change notification settings - Fork 55
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
Dashes in Need IDs Not Supported by needflow #61
Comments
…rscores in entity names in PlantUML diagram definitions
…rscores in entity names in PlantUML diagram definitions
in entity names in PlantUML diagram definitions
the test case for this is failing for me when I run it locally. it looks like this - @with_app(buildername='html', srcdir='doc_test/doc_github_issue_61')
def test_doc_github_61(app, status, warning):
"""
Test for https://github.com/useblocks/sphinxcontrib-needs/issues/61
"""
# PlantUML doesn't support entity names with dashes in them, and Needs uses
# the IDs as entity names, and IDs could have dashes. To avoid this limitation,
# Entity names are transformed to replace the dashes with underscores in the entity
# names.
# Even if there's an error creating the diagram, there's no way to tell since the
# error message is embedded in the image itself. The best we can do is make sure
# the transformed entity names are in the alt text of the image.
app.build()
html = Path(app.outdir, 'index.html').read_text()
alt_text = re.findall('<img.*?alt=(.*?)>', html, re.MULTILINE + re.DOTALL)
assert len(alt_text) == 5
assert "A-001" in alt_text[4]
assert "A-002" in alt_text[4]
assert "A_001" in alt_text[4]
assert "A_002" in alt_text[4] this line causes the issue - Probably worth mentioning that i can't run your Tox test suite on my machine, so i'm using the |
If a need has an ID that has a dash in it, then needflow will not be able to render the diagram. This is because PlantUML does not support dashes in entity names.
Example:
Would result in error like this:
I have a fix for this, and I'll provide a Pull Request later today. The fix is simply to transform the entity names in the diagram definition to replace dashes with underscores. This doesn't affect how the diagram is displayed as the text used in the diagram node does not have a restriction on dashes - only the entity names in the diagram definition.
The text was updated successfully, but these errors were encountered: