Skip to content

Commit 976006e

Browse files
authored
Merge pull request #393 from kirchsth/feature/380_stdlib
#380 Release process supports new stdlib README.md structure and updated license
2 parents 0ba61cb + 10add18 commit 976006e

File tree

6 files changed

+118
-12
lines changed

6 files changed

+118
-12
lines changed

.scripts/HowToCreateANewRelease.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ git -C $deploy_repository_folder branch C4$release_version
182182
git -C $deploy_repository_folder checkout C4$release_version
183183
```
184184

185-
### 4.2. prepare the C4_*.puml and INFO file
185+
### 4.2. prepare the C4_*.puml, themes and README.md files
186186

187187
```bash
188-
python ./.scripts/transform_files.py CreatePlantUMLStdlibC4Folder $deploy_repository_folder/C4
188+
python ./.scripts/transform_files.py CreatePlantUMLStdlibC4Folder $deploy_repository_folder/stdlib/C4
189189
```
190190

191191
### 4.3. Commit changes with comment "Update C4-PlantUML to $release_version"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: C4
3+
display_name: C4 (C4-PlantUML)
4+
description: The C4 library enables a simple way of describing and communicate software architectures with an intuitive language.
5+
author: Ricardo Niepel, kirchsth and contributors
6+
version: {release version without v}
7+
release: https://github.com/plantuml-stdlib/C4-PlantUML/tree/release/v{release version without v}
8+
license: MIT
9+
source: https://github.com/plantuml-stdlib/C4-PlantUML
10+
origin: https://c4model.com
11+
---
12+
**C4 specific stdlib properties:**
13+
![name: C4](https://img.shields.io/badge/name-C4-black)
14+
![display_name: C4 (C4-PlantUML)](https://img.shields.io/badge/display__name-C4_(C4--PlantUML)-black)
15+
![version: {release version without v}](https://img.shields.io/badge/version-{release version without v}-black)
16+
[![release: https://github.com/plantuml-stdlib/C4-PlantUML/tree/release/v{release version without v}][Release Badge]][Release Link]
17+
![description: The C4 library enables a simple way of describing and communicate software architectures with an intuitive language.](https://img.shields.io/badge/description-The_C4_library_enables_a_simple_way_of_describing_and_communicate_software_architectures_with_an_intuitive_language.-black)
18+
[![license: MIT][License Badge]][License Link]
19+
![author: Ricardo Niepel, kirchsth and contributors](https://img.shields.io/badge/author-Ricardo_Niepel,_kirchsth_and_contributors-black)
20+
[![source: https://github.com/plantuml-stdlib/C4-PlantUML][Source Badge]][Source Link]
21+
[![origin: https://c4model.com][Origin Badge]][Origin Link]
22+
23+
[Release Badge]: https://img.shields.io/badge/release-https://github.com/plantuml--stdlib/C4--PlantUML/tree/release/v{release version without v}-blue
24+
[Release Link]: https://github.com/plantuml-stdlib/C4-PlantUML/tree/release/v{release version without v}
25+
[License Badge]: https://img.shields.io/badge/license-MIT-green
26+
[License Link]: https://github.com/plantuml-stdlib/C4-PlantUML/blob/master/LICENSE
27+
[Source Badge]: https://img.shields.io/badge/source-https://github.com/plantuml--stdlib/C4--PlantUML-blue
28+
[Source Link]: https://github.com/plantuml-stdlib/C4-PlantUML
29+
[Origin Badge]: https://img.shields.io/badge/origin-https://c4model.com-blue
30+
[Origin Link]: https://c4model.com
31+
32+
**Support and community:**
33+
[![issues: C4][Issues Badge]][Issues Link]
34+
[![open master commits][Open Badge]][Open Link]
35+
[![discussions: C4][Discussions Badge]][Discussions Link]
36+
37+
[Issues Badge]: https://img.shields.io/badge/issues-https://github.com/plantuml--stdlib/C4--PlantUML/issues-orange
38+
[Issues Link]: https://github.com/plantuml-stdlib/C4-PlantUML/issues
39+
[Open Badge]: https://img.shields.io/github/commits-difference/plantuml-stdlib/C4-PlantUML?base=release%2Fv{release version without v}&head=master&label=Open%20master%20commits&color=orange
40+
[Open Link]: https://github.com/plantuml-stdlib/C4-PlantUML/compare/v{release version without v}...master
41+
[Discussions Badge]: https://img.shields.io/badge/discussions-https://github.com/plantuml--stdlib/C4--PlantUML/discussions-orange
42+
[Discussions Link]: https://github.com/plantuml-stdlib/C4-PlantUML/discussions
43+
44+
# C4 library (C4-PlantUML) [C4]
45+
46+
The C4 library enables a simple way of describing and communicate software architectures with an intuitive language.
47+
48+
It is the PlantUML integrated version of [C4-PlantUML](https://github.com/plantuml-stdlib/C4-PlantUML) and has the big advantage that it can be used without additional external includes.
49+
(E.g. container diagrams can be drawn with `!include <C4/C4_Container>` and no `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml` is required.)
50+
51+
## Example of usage:
52+
53+
```plantuml
54+
@startuml
55+
!include <C4/C4_Container>
56+
LAYOUT_LEFT_RIGHT()
57+
58+
Person(admin, "Administrator")
59+
System_Boundary(c1, "Sample System") {
60+
Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines")
61+
}
62+
System(twitter, "Twitter")
63+
64+
Rel(admin, web_app, "Uses", "HTTPS")
65+
Rel(web_app, twitter, "Gets tweets from", "HTTPS")
66+
67+
SHOW_LEGEND()
68+
@enduml
69+
```
70+
71+
<br/>
72+
73+
**renders following image:**
74+
75+
[![Example](https://www.plantuml.com/plantuml/png/JL1TQy9047o_Nx5DNn8GYyN7KanJgmMhOivAdyAPRE7WFiBT1f7I_zvDjTfxMUvcPcTk9f5KeCuQSQDTRRe6uQ4OtnNZgl2Eb7OO7iKY_rXjPRMOliXgypgRopGJOeqXUfUgncetW2JlfuuK5FcGPA8yHa9RFVdEDIeSqth4f5BPrY2Si2I3Bm5yBaxf0VULQbjcxd0FUTiQNIlItYNyLDmE82_Nm-LKiYGWt0z7yFPUz5XkZ3z4w2A62EIXzhPLJB6T8TrRoeCcmW2aBHhsYXpn-nmofHF8Uyuq1iK6pT_dhh6saPKyvrAkooJx9LtGwvePKkGhzkCpUFjV8ihvQiTTpgRBP-vnWgxX-dy0)](https://www.plantuml.com/plantuml/uml/JL1TQy9047o_Nx5DNn8GYyN7KanJgmMhOivAdyAPRE7WFiBT1f7I_zvDjTfxMUvcPcTk9f5KeCuQSQDTRRe6uQ4OtnNZgl2Eb7OO7iKY_rXjPRMOliXgypgRopGJOeqXUfUgncetW2JlfuuK5FcGPA8yHa9RFVdEDIeSqth4f5BPrY2Si2I3Bm5yBaxf0VULQbjcxd0FUTiQNIlItYNyLDmE82_Nm-LKiYGWt0z7yFPUz5XkZ3z4w2A62EIXzhPLJB6T8TrRoeCcmW2aBHhsYXpn-nmofHF8Uyuq1iK6pT_dhh6saPKyvrAkooJx9LtGwvePKkGhzkCpUFjV8ihvQiTTpgRBP-vnWgxX-dy0)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- start C4 section -->
2+
![name: C4](https://img.shields.io/badge/name-C4-black)
3+
![display_name: C4 (C4-PlantUML)](https://img.shields.io/badge/display__name-C4_(C4--PlantUML)-black)
4+
[![version: {release version without v}][Version Badge]][Version Link]
5+
![license: MIT](https://img.shields.io/badge/license-MIT-green)
6+
![author: Ricardo Niepel, kirchsth and contributors](https://img.shields.io/badge/author-Ricardo_Niepel,_kirchsth_and_contributors-black)
7+
[![all properties see: ./stdlib/C4/README.md][See Badge]][See Link]
8+
9+
[Version Badge]: https://img.shields.io/badge/version-{release version without v}-blue
10+
[Version Link]: https://github.com/plantuml-stdlib/C4-PlantUML/tree/release/v{release version without v}
11+
[See Badge]: https://img.shields.io/badge/all_stdlib_specific_properties_see-./stdlib/C4/README.md-blue
12+
[See Link]: ./stdlib/C4/README.md
13+
<!-- end C4 section -->

.scripts/plantuml_stdlib_info.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

.scripts/transform_files.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ def replace_first_regex_copy_file(
151151
file.write(filedata)
152152

153153

154+
def replace_regex_copy_file(
155+
source_path, target_path, compiled_search_regex, replace
156+
):
157+
with open(source_path, "r") as file:
158+
filedata = file.read()
159+
filedata = compiled_search_regex.sub(replace, filedata)
160+
with open(target_path, "w") as file:
161+
file.write(filedata)
162+
163+
154164
# Calculates the next version (inclusive starting v) based on the give version values.
155165
# If v3 == 0 then v2 is increased otherwise v3
156166
def calculate_next_version(release, v1, v2, v3):
@@ -394,13 +404,6 @@ def create_plantuml_stdlib_c4_folder(target_path):
394404
"!include <C4/C4_Component>",
395405
)
396406

397-
replace_first_regex_copy_file(
398-
"./.scripts/plantuml_stdlib_info.txt",
399-
os.path.join(target_path, "INFO"),
400-
re.compile(r"\{release version without v\}"),
401-
release_version[1:],
402-
)
403-
404407
themes_path = target_path+"/themes"
405408
os.makedirs(themes_path, exist_ok=True)
406409
paths = glob.glob("./themes/puml-theme-C4_*.puml")
@@ -416,6 +419,23 @@ def create_plantuml_stdlib_c4_folder(target_path):
416419
"DOES NOT EXIST",
417420
)
418421

422+
replace_regex_copy_file(
423+
"./.scripts/plantuml-stdlib_C4_README.txt",
424+
os.path.join(target_path, "README.md"),
425+
re.compile(r"\{release version without v\}"),
426+
release_version[1:],
427+
)
428+
429+
with open("./.scripts/plantuml-stdlib_README_section.txt", "r") as f:
430+
section = f.read()
431+
updatedSection = re.sub(r"\{release version without v\}", release_version[1:], section)
432+
with open(os.path.join(target_path, "./../../README.md"), "r") as f:
433+
content = f.read()
434+
pattern = r'<!-- start C4 section -->.*?<!-- end C4 section -->'
435+
updated_content = re.sub(pattern, updatedSection, content, flags=re.DOTALL)
436+
with open(os.path.join(target_path, "./../../README.md"), "w") as f:
437+
f.write(updated_content)
438+
419439
print(f"all C4 related plantuml-stdlib files copied into {target_path}.")
420440

421441

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Ricardo Niepel
3+
(c) 2018-2020 Ricardo Niepel, 2021-2025 Ricardo Niepel, kirchsth and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)