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

Mermaid PDF Rendering #397

Open
kristi-balla opened this issue Feb 7, 2025 · 0 comments
Open

Mermaid PDF Rendering #397

kristi-balla opened this issue Feb 7, 2025 · 0 comments

Comments

@kristi-balla
Copy link

Hey everybody, lately I tried to get this to pdf, but the extension complains about a mermaid error:

---
title: Bridge Pattern Hashing Example
---
classDiagram
namespace ApplicationDomain {
    class Hashing {
        <<Abstract>>
        + hashDocument(String doc) String
    }
    class PreviewHashing {
        + hashDocument(String doc) String
    }
    class EnterpriseHashing {
        + hashDocument(String doc) String
    }
}
namespace SolutionDomain {
    class HashFunction {
        <<Interface>>
        + calculateHashCode(String input) String
    }
    class SimpleHash {
        + calculateHashCode(String input) String
    }
    class CryptoSecHash {
        + calculateHashCode(String input) String
    }
}
    class ExamSystem {
        + readFile(String path) String
        + hashFile(String input, Hashing hash): String
    }
    Hashing --> HashFunction: implementation
    ExamSystem --> Hashing
    PreviewHashing --|> Hashing
    EnterpriseHashing --|> Hashing
    SimpleHash --|> HashFunction
    CryptoSecHash --|> HashFunction

I played a bit around with v11.x, v10.x and v9.x versions and all complain about syntax errors. As you can probably see on GitHub, there are none:

---
title: Bridge Pattern Hashing Example
---
classDiagram
namespace ApplicationDomain {
    class Hashing {
        <<Abstract>>
        + hashDocument(String doc) String
    }
    class PreviewHashing {
        + hashDocument(String doc) String
    }
    class EnterpriseHashing {
        + hashDocument(String doc) String
    }
}
namespace SolutionDomain {
    class HashFunction {
        <<Interface>>
        + calculateHashCode(String input) String
    }
    class SimpleHash {
        + calculateHashCode(String input) String
    }
    class CryptoSecHash {
        + calculateHashCode(String input) String
    }
}
    class ExamSystem {
        + readFile(String path) String
        + hashFile(String input, Hashing hash): String
    }
    Hashing --> HashFunction: implementation
    ExamSystem --> Hashing
    PreviewHashing --|> Hashing
    EnterpriseHashing --|> Hashing
    SimpleHash --|> HashFunction
    CryptoSecHash --|> HashFunction
Loading

After some trial and error, I managed to reduce the culprit to the namespace keyword and the annotations: <<Abstract>> and <<Interface>>. However, the code also works on the playground. I haven't used this in a while, so could someone help me come up with a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant