Comments (6)
I am looking into this. I plan to add support for templates to solve this and #4 simultaneously.
from hpp2plantuml.
v0.5 should now support templates. See the readme for an example setting the title and skinparam. Please let me know if that fixes the issue.
from hpp2plantuml.
The extends results in only the content of the file to be included. The block preamble only results in what is added there. I am missing what normally is added by hpp2plantuml.
from hpp2plantuml.
As example, please also add
{% block preamble %}
!include default.puml
title The Title
{% endblock %}
In that way, the file to be included is not included literally but via reference.
from hpp2plantuml.
I don't understand the problem. Here are the steps I use and the corresponding
outputs.
Setup a virtual environment
virtualenv -p python3 hpp2plantuml/
Load the virtual environment
source hpp2plantuml/bin/activate
For Windows this may look like: hpp2plantuml\Scripts\activate.bat
.
Clone the repository
This is to get the example files.
git clone https://github.com/thibaultmarin/hpp2plantuml.git hpp2plantuml-src/
Install hpp2plantuml
pip install hpp2plantuml
Tests
Default template
Using the default template, I get the following result (no preamble):
hpp2plantuml -i "hpp2plantuml-src/tests/simple_classes_*.hpp" -o output_1.puml
Result:
@startuml
/' Objects '/
abstract class Class01 {
+{abstract} AbstractPublicMethod(int param) : bool
+PublicMethod(int param) : bool {query}
+{static} StaticPublicMethod(bool param) : bool
#{abstract} _AbstractMethod(int param) : bool
#_ProtectedMethod(int param) : bool
#{static} _StaticProtectedMethod(bool param) : bool
#_protected_var : int
+public_var : int
}
class Class02 {
+AbstractPublicMethod(int param) : bool
-_AbstractMethod(int param) : bool
-_PrivateMethod(int param) : bool
-{static} _StaticPrivateMethod(bool param) : bool
-_private_var : int
}
class Class03 <template<typename T>> {
+Class03()
+~Class03()
-_data : Class01*
-_obj : Class01*
-_typed_obj : T*
-_obj_list : list<Class02>
}
namespace Interface {
class Class04 {
+Class04()
+~Class04()
-_obj : Class01*
-_flag : bool
}
}
namespace Interface {
class Class04_derived {
+Class04_derived()
+~Class04_derived()
-_var : int
}
}
enum Enum01 {
VALUE_0
VALUE_1
VALUE_2
}
/' Inheritance relationships '/
.Class01 <|-- .Class02
namespace Interface {
Class04 <|-- Class04_derived
}
/' Aggregation relationships '/
.Class03 "2" o-- .Class01
.Class03 o-- .Class02
Interface.Class04 o-- .Class01
@enduml
Custom template
To add a title and skinparam
options, the custom template examples seems to
work for me:
hpp2plantuml -i "hpp2plantuml-src/tests/simple_classes_*.hpp" -o output_2.puml -t hpp2plantuml-src/tests/custom_template.puml
Result:
@startuml
title "This is a title"
skinparam backgroundColor #EEEBDC
skinparam handwritten true
/' Objects '/
abstract class Class01 {
+{abstract} AbstractPublicMethod(int param) : bool
+PublicMethod(int param) : bool {query}
+{static} StaticPublicMethod(bool param) : bool
#{abstract} _AbstractMethod(int param) : bool
#_ProtectedMethod(int param) : bool
#{static} _StaticProtectedMethod(bool param) : bool
#_protected_var : int
+public_var : int
}
class Class02 {
+AbstractPublicMethod(int param) : bool
-_AbstractMethod(int param) : bool
-_PrivateMethod(int param) : bool
-{static} _StaticPrivateMethod(bool param) : bool
-_private_var : int
}
class Class03 <template<typename T>> {
+Class03()
+~Class03()
-_data : Class01*
-_obj : Class01*
-_typed_obj : T*
-_obj_list : list<Class02>
}
namespace Interface {
class Class04 {
+Class04()
+~Class04()
-_obj : Class01*
-_flag : bool
}
}
namespace Interface {
class Class04_derived {
+Class04_derived()
+~Class04_derived()
-_var : int
}
}
enum Enum01 {
VALUE_0
VALUE_1
VALUE_2
}
/' Inheritance relationships '/
.Class01 <|-- .Class02
namespace Interface {
Class04 <|-- Class04_derived
}
/' Aggregation relationships '/
.Class03 "2" o-- .Class01
.Class03 o-- .Class02
Interface.Class04 o-- .Class01
@enduml
Include template
If I try to use the template you are proposing, the output does not look good to
me:
echo "{% block preamble %}" > custom_include.puml
echo '!'"include default.puml" >> custom_include.puml
echo "title The Title" >> custom_include.puml
echo "{% endblock %}" >> custom_include.puml
hpp2plantuml -i "hpp2plantuml-src/tests/simple_classes_*.hpp" -o output_3.puml -t custom_include.puml
Result:
!include default.puml
title The Title
I think that 4.1 and 4.2 behave as expected. Can you please
describe in detail what the problem is (input/output/expected output)?
from hpp2plantuml.
@PanderMusubi, can this and #4 be closed?
from hpp2plantuml.
Related Issues (20)
- Enums are not connected to classes which hold them HOT 2
- Feature request: Represent arbitrary packages HOT 2
- Nested namespace with empty top namespace HOT 2
- Is it possible to add subparts for every class block? HOT 1
- #ifdef in enum causes CppParseError exception HOT 2
- help me convert this puml to png HOT 2
- Keep order of members HOT 1
- Problem parsing std::function member HOT 2
- Support for template signatures HOT 1
- concated namespace problem HOT 3
- Generate PlantUML for headers in multple directories HOT 1
- Do not handle nest namespace correctly HOT 2
- Support initialization list
- Problem parsing brace-or-equal initializer for class members HOT 3
- Array member in struct will be parsed to its element type
- Ability to check dependency from #includes HOT 1
- Class enumerator is not connecting HOT 1
- #defines in enumerator is causing error HOT 1
- There is no possibility of parsing classes with Qt
- Some diagram description contains errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hpp2plantuml.