Skip to content

issue #11492 @plantumlfile command not recognized #11500

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

Closed

Conversation

albert-github
Copy link
Collaborator

  • The original problem is about the fact that fact that the @startuml command had a filename and this was not expected / anticipated, the result was a concatenation of the name with and "inline" name (i.e. an generated dummy name) and the given name
  • Potential problem with handing out the same number for an "inline" file name (multithreading, now protected by means of a mutex.
  • With a \plantumlfile it is possible to have multiple diagrams in one file, only one was shown, now all are shown.

- The original problem is about the fact that fact that the `@startuml` command had a filename and this was not expected / anticipated, the result was a concatenation of the name with and "inline" name (i.e. an generated dummy name) and the given name
- Potential problem with handing out the same number for an "inline" file name (multithreading, now protected by means of a mutex.
- With a `\plantumlfile` it is possible to have multiple diagrams in one file, only one was shown, now all are shown.
@@ -95,34 +73,153 @@ QCString PlantumlManager::writePlantUMLSource(const QCString &outDirArg,const QC
case '\t': break;
case ' ': break;
case '@':
if (initial && literal_at(p,"start")) // @start...
if (!insideComment && literal_at(p,"start")) // @start...
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand the use-case of this inline parser stuff. Do you have an example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example: example.tar.gz

if (fileName.isEmpty()) // generate name
{
std::lock_guard<std::mutex> lock(g_PlantUmlMutex);
puName = "inline_umlgraph_"+QCString().setNum(umlindex);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using numbers like this will give instable output, i.e. when using multiple threads every run the numbers can be assigned to different graphs, and thus the output will change even if the input did not. A typical solution is to use a hash of the filename + line number, representing where the graph is found in the input, and use that to create the output name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original was already using the non stable numbers and this could lead to multiple use of the same number (it is unlikely that this happens, but better to be safe hence the mutex). It indeed would be better to use a hash.

doxygen added a commit that referenced this pull request May 25, 2025
@doxygen
Copy link
Owner

doxygen commented May 25, 2025

@albert-github I've made some simplifications. Somehow the PR could not get merged automatically, so I'll close it manually. Let me know if you see any issues.

@doxygen doxygen closed this May 25, 2025
@albert-github albert-github deleted the feature/issue_11492 branch May 26, 2025 10:53
@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label May 26, 2025
@albert-github
Copy link
Collaborator Author

At first glance I don't see any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed but not released Bug is fixed in github, but still needs to make its way to an official release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy