Skip to content

Commit 84fc3c2

Browse files
committed
Add Mermaid build diagram
1 parent ddfa21e commit 84fc3c2

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

docs/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
# Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
33

4+
``` cpp title="hello.cpp2"
5+
main: () = {
6+
std::cout << "Hello, world!\n";
7+
}
8+
```
9+
410
## What is Cpp2?
511

612
"Cpp2," short for "C++ syntax 2," is my ([Herb Sutter's](https://github.com/hsutter)) personal project to try to make writing ordinary C++ types/functions/objects be much **simpler and safer**, without breaking backward compatibility. Bjarne Stroustrup said it best:

docs/welcome/hello-world.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# **Hello, world!**
22

3+
<table><tr><td>
4+
``` cpp title="hello.cpp2"
5+
main: () = {
6+
std::cout << "Hello, world!\n";
7+
}
8+
```
9+
</td><td>
10+
``` mermaid
11+
graph TB
12+
A[hello.cpp2] ==> B([cppfront]);
13+
B ==> C[hello.cpp];
14+
C ==> D([Your favorite C++ compiler]);
15+
```
16+
</td></tr></table>
17+
318
## A `hello.cpp2` program
419

520
Here is the usual one-line starter program that prints `Hello, world!`. Note that this is a complete program, no `#!cpp #include` required:

mkdocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ markdown_extensions:
8080
generic: true
8181
- footnotes
8282
- pymdownx.details
83-
- pymdownx.superfences
83+
- pymdownx.superfences:
84+
custom_fences:
85+
- name: mermaid
86+
class: mermaid
87+
format: !!python/name:pymdownx.superfences.fence_code_format
8488
- pymdownx.mark
8589
- attr_list
8690

0 commit comments

Comments
 (0)