rustyphoenixlecture 1.10.0

This project aims to provide a simple a powerfull lecture compilation to generate html web sites
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962

The RustyPhoenixLecture is the next version developed in Rust or the previous PhoenixTex2Html developed previously in C++.

A lot of functionalities were added to this new project.


# Introduction
#secIntroduction

Let's introduce the topic of this lecture. The idea is just to test if the rustyphoenixlecture program does it job well.

RustyPhoenixLecture is the next version of the already well used [PhoenixTex2Html](https://cta-lapp.pages.in2p3.fr/PHOENIX_LIBS2/static-site-generator/PhoenixTex2Html/).
The main idea is to keep all good ideas of PhoenixTex2Html but with markdown as main language and not latex and also to make sure all black magic with cmake is no longer mandatory and can be integrated smoothly in markdown.

You can see the Reference and label at section @secReferenceAndLabel for more information. And you can jump directly to see the conclusion in section @secConclusion.

## Managing
#secManaging

First rustyphoenixlecture is completely autonomous and do not rely on cmake and stays in markdown for simplicity of use.

Just a small example of C++ :

```cpp
#include <iostream>
int main(int argc, char** argv){
	int value = 4;
	std::cout << "Hello world !" << std::endl;
	return 0;
}
```

And if we want to compile :

```cmake
cmake_minimum_required(VERSION 3.20)
project(SimpleCpp)

add_executable(my_awsome_program main.cpp)
```

You probably realize that, all programs such as cmake or language such as C++ are automatically highlighted.
No need to call extra commands and forget if you want to treat of a program, a language, or a library such as libhdf5.

Indeed we can use `code snipet` to highlight some parameters, options or commands

# Lecture Configuration
#secLectureConfiguration

The lecture is create with a toml configuration which is :

```toml
# Vector of files in the lecture
vec_file = ["index.md"]
# Title of the lecture
title = "A great lecture"
# Name of the lecture (other lectures will reference this one with that name)
name = "TestLecture"
# Url of the lecture
project_url = "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/static-site-generator/RustyPhoenixLecture"
# Url where to find the documentation of the project or the generated lecture
documentation_url = "https://cta-lapp.pages.in2p3.fr/PHOENIX_LIBS2/static-site-generator/RustyPhoenixLecture"
# If the lecture is part of a mater project
master_project = "https://paubert.pages.in2p3.fr/Lectures/"
# Email contact for suggestions
contact_mail = "pierre.aubert@lapp.in2p3.fr"
# Vector of authors of the lecture
vec_author = ["Pierre Aubert"]
#Relative to the current configuration location
theme_path = "../themes/book"
# Vector of parser directories which contains all toml configuration for languages highlighting
vec_parser = ["parser"]
# Vector of environment directories which contains all toml configuration for extra environment
vec_environment = ["environment"]

[dependencies]
```
Where :
- **vec_file** is the vector of input markdown files of the lecture
- **title** is the title of the lecture
- **name** is the name of the lecture to allows remote citation from other lectures
- **project_url** is the url of the lecture project
- **documentation_url** is the url where the lecture is published (i.e. pages for gitlab)
- **master_project** is the url of a larger projet if the current lecture is in a constellation of lectures
- **contact_mail** is the email of the main authors
- **vec_author** is the list of authors
- **theme_path** is a path to the theme directory. You can use `${PREFIX_SHARE}` in the name to use installed theme
- **vec_parser** is list of paths to parser directories. You can use `${PREFIX_SHARE}` in the name to use installed theme
- **vec_environment** is list of paths to environments directories. You can use `${PREFIX_SHARE}` in the name to use installed theme
- **dependencies** section section allows to add extra lecture from which we can cite labels (see section @secReferenceAndLabel)

If you use `${PREFIX_SHARE}` in **theme_path**, **vec_parser**, **vec_environment**, you have to specify the path to the theme package you choose. Example :
```toml
# Vector of files in the lecture
vec_file = ["index.md"]
# Title of the lecture
title = "A great lecture"
# Name of the lecture (other lectures will reference this one with that name)
name = "TestLecture"
# Url of the lecture
project_url = "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/static-site-generator/RustyPhoenixLecture"
# Url where to find the documentation of the project or the generated lecture
documentation_url = "https://cta-lapp.pages.in2p3.fr/PHOENIX_LIBS2/static-site-generator/RustyPhoenixLecture"
# If the lecture is part of a mater project
master_project = "https://paubert.pages.in2p3.fr/Lectures/"
# Email contact for suggestions
contact_mail = "pierre.aubert@lapp.in2p3.fr"
# Vector of authors of the lecture
vec_author = ["Pierre Aubert"]
#Relative to the current configuration location
theme_path = "${PREFIX_SHARE}/RustyPhoenixLectureThemeBook/book"
# Vector of parser directories which contains all toml configuration for languages highlighting
vec_parser = ["${PREFIX_SHARE}/RustyPhoenixLectureThemeBook/parser"]
# Vector of environment directories which contains all toml configuration for extra environment
vec_environment = ["${PREFIX_SHARE}/RustyPhoenixLectureThemeBook/environment"]

[dependencies]
```


Example of **dependencies**:
```toml
[dependencies]
lecture_name = "https://pages.gitlab.com/url/to/this/lecture/"

```


# Lecture components
#secLectureComponent

The lecture is composed of several components :
- **Title** see section @secLectureComponentTitle
- **Images** and **Figures** see section @secLectureComponentImages
- **List** see section @secLectureComponentList
- **Table** see section @secLectureComponentTable
- **Detail** see section @secLectureComponentDetail
- **Environments** see section @secLectureComponentEnvironment
- **Parser** see section @secLanguageHighlighting
- **Mathematic formulae** see section @secMathematicFormulae

## Title
#secLectureComponentTitle

Titles are define as follow :

```markdown
# Title

## Chapter

### Section

#### Sub section

##### Sub sub section

```

And titles can be embeded in environments (see section @secLectureComponentEnvironment) :
![markdown](embededtitle.md)

```resumeBox
# First point

Text in this environment for the first point

# Second point

Text in this environment for the second point
```


## Images
#secLectureComponentImages

In the long tradition of the PhoenixTex2Html, we need to test the images of the new RustyPhoenixLecture with Tweety in the text ![tweety](Images/tb_tweety.png) or a figure :

![figure](Images/tb_tweety.png)
#figTweety

But we have to call 
```markdown
![figure](Images/tb_tweety.png)
```
 with the **figure** keyword.

And we can cite the image too if is has a label (see section @secReferenceAndLabel).

```noteBox
**Note** : you don't have to define a caption inside the figure because this is more convenient to cite the figure and explain it in the next paragraph.
```


## List
#secLectureComponentList

List can be defined with :
```markdown
- Some item
	- Sub item
- An other item
	- Other sub item

```
Which gives :
- Some item
	- Sub item
- An other item
	- Other sub item

## Table
#secLectureComponentTable

Tables can be defined with :

```markdown
| some column | other column |
| 42 | 23 |

```
Which gives :
| some column | other column |
| 42 | 23 |


```noteBox
**Note** : every cell is centered by default because everyone wants text to be centered in a table by default.
```

## Detail
#secLectureComponentDetail

The **detail** environment allows to collapse a long content and showing only the beginning. Then is can be opened by clicking on its title.

If you write :
![markdown](detail.md)

You will get :
```detail
Some title

Some content
```

## Environments
#secLectureComponentEnvironment

As in the previous PhoenixTex2Html, RustyPhoenixLecture allows to use extra environments defined in toml configuration files.

An environment **envname** can be used as any markdown environment :
![markdown](envname.md)

We can ask some questions :

```question
What I am doing here ?
```

And some answer :

```answer
Reading the documentation.
```

Some advise :

```advise
You should read the documentation.
```

### Nested environments
#secLectureComponentEnvironmentNested

And environments can be nested :
```idea
Should be great if the environments could be nested.

```trouble
Ok but we have to make sure the parsing do not break
```

```warning
Should be nice, but the markdown highlighter of your favorite editor will probably break, even if the lecture will be fine.
```

```answer
Ok, we so have to force all environments to have a name. There is no more default environment with vanilla triple backquotes,
otherwise this would not be possible.
```

	```

Here is the corresponding markdown :
![markdown](nested_environment.md)

```noteBox
**Note** : the trick here is to indent with one tabulation the closing triple backquotes of the main environment - **idea** in our case - to make sure your favorite highlighter will not ruine the highlighting of what is following until the next.
```

```noteBox
**Note** : you can also include code to highlight as mentionned in section @secDevelopment. In this case, your favorite IDE will not break the highlighting or your markdown.
```

Ok, I agree that this is wiered and I do not really get how I found it but this trick is working on zed and kate.


### Environments config
#secLectureComponentEnvironmentConfig

All environments are defined in **environment** directory as toml configuration such as **environment/environment.toml**. Here multiple environments can be defined per files :
```toml
[[environment]]
name = "question"
balise = "div"
is_paragraph_allowed = true
image = "book/images/wip.png"
style = """
color: white;background-color: #4c5f82;
border: 2px solid blue;
border-radius: 10px;
padding: 10px;
margin-top: 30px;
margin-bottom: 30px;
"""
```
Where :
- **name** is the name of the environment (**envname** in section @secLectureComponentEnvironment)
- **balise** is the name of html marker to use (**div**, **pre**, **span**, etc)
- **is_paragraph_allowed** tells if paragraphs can be created inside the environment (this changes the layout but simplifies a lot the environment)
- **image** which illustrates the environment. Its path should be relative to the generated html, and having them in **book/images** prevent to make a mess of the output directory. If **image** is empty, no image will be displayed in the environment.
- **style** is the css style to define this environment



### All environments
#secLectureComponentEnvironmentAll

And since I am lazy, I will not write you all the examples of all environments myself. Moreover, you can all some dedicated environments for yourself and also you won't test them by hand.
Ok, let's pretend, we aren't lazy but we want to spend our time on the things which matter. So, if you are using this markdown : 
```markdown
__all_environment_example__
```

You will get this :

__all_environment_example__


### List env by name
#secLectureComponentEnvironmentByName

It is also possible to list environments by name.

The most common usage is to list the **work in progress** environments which is **wip** but of course we do not want to be limited and we can list all the environments which are defined for the lecture (see section @secLectureComponentEnvironmentConfig).

It will not create any section so you have the control on it and you can call this command in all the section you want.

```warning
**Warning** : this function can be called only once in the whole lecture to avoid dupplication of information. And you will get an error if you call it several times.
```

```noteBox
**Note** : if you list all possible environments (see section @secLectureComponentEnvironmentAll), the corresponding one will be listed too.
```

You can list all the **wip** environments of your lecture with : 
```markdown
![list_env](wip)
```

And this will give :
![list_env](wip)


## Clipboard copy
#secLectureClipboardCopy

In a lecture or a documentation, it is quite powerfull to give ready to use commands to the reader.
```markdown
<!-- here the text will be copied and displayed in the lecture -->
![textclipboard](some text to copy)
<!-- here the text will be copied but not displayed in the lecture -->
![copyclipboard](some hidden text to copy)
```
Here is and example ![textclipboard](some text to copy). Or hidden text ![copyclipboard](some hidden text to copy).

Once you write a lecture or documentation, at some point you will have to give some long command which are also tedious to copy, such as a command to run a container with podman from a given container url.
```markdown
<!-- here we pass only the url to the container and the copy function make the whole podman run command for you -->
![clipboard_podman_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)
```
You can try to start the container with podman : ![clipboard_podman_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)

Which will give you the command :

```terminal
podman pull gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91
podman run -it --rm --net=host gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91
# And you don't have to copy it manually
```
Of course, you can do the same with docker :
```markdown
<!-- here we pass only the url to the container and the copy function make the whole podman run command for you -->
![clipboard_docker_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)
```
You can try to start the container with docker : ![clipboard_docker_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)

```terminal
docker pull gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91
docker run -it --rm --net=host gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91
# And you don't have to copy it manually
```

Of course, you can do the same with apptainer :
```markdown
<!-- here we pass only the url to the container and the copy function make the whole podman run command for you -->
![clipboard_apptainer_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)
```
You can try to start the container with apptainer : ![clipboard_apptainer_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)

And you will get
```terminal
apptainer pull gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2
apptainer run --bind build:/build --writable-tmpfs performancewithstencil_cpu_interactive_code_server_1.0.2.sif
# And you don't have to copy it manually
```
Of course,  apptainer needs a lot of disk space to pull images this is also why we split the two commands which is not mandatory for podmand and docker but makes it coherent.

Since, it helps but this will remain tedious if you want to get all possible command for podman, apptainer and docker, you can use this :
```markdown
<!-- here we pass only the url to the container and the copy function make the whole podman run command for you -->
![clipboard_podman_apptainer_docker_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)
```
And you will get : ![clipboard_podman_apptainer_docker_run](gitlab-registry.in2p3.fr/cta-lapp/cours/performancewithstencil/performancewithstencil_cpu_interactive_code_server:1.0.2@sha256:cc8a657107c3d6bb9ea30de7471962966cc9f57cd3fecb64533760ee2fca4e91)

for all container you want and you still can copy the raw url if you prefer.

# Development
#secDevelopment

When writing a lecture, we generally need to incorporate snipet of C++ or CMakeLists.txt. And we have to ensure these snipets do compile and do not contains errors.
Let's use the example of the chapter @secManaging but with files.

So, here is the main.cpp :

![cpp](Examples/SimpleProject/main.cpp)

And the CMakeLists.txt :

![cpp](Examples/SimpleProject/CMakeLists.txt)

To get with we just use :

```markdown
So, here is the main.cpp :

![cpp](Examples/SimpleProject/main.cpp)

And the CMakeLists.txt :

![cpp](Examples/SimpleProject/CMakeLists.txt)
```
And these C++ and cmake files are automatically parsed by rustyphoenixlecture to extract the lecture comments inside them which can produce entire parts, chapters or sections whithin a single line.
With this trick, you ensure your examples are always aligned with your lecture and do compile and produce relevant results without any copy-paste or synchronisation needed from your side.

Basically, a lecture comment starts as a comment but with a brace. For C++ it is **//{** for single line comment.
You can get these files to have the full example.

```cpp
//{We have to include I/O includes :
#include <iostream>

//{Then, we can define the main function :
int main(int argc, char** argv){
	int value = 4;
//{Some printing :
	std::cout << "Hello world ! " << value << std::endl;
//{The end of the function
	return 0;
}
```

```noteBox
**Note** : all paths are relative to the location of the **lecture configuration**.
```

# Reference and label
#secReferenceAndLabel

Reference and label are a key point in writing lectures.

You can declare a label with 
```markdown
#someName
```
and refer to it with 
```markdown
@someName
```

To make a figure with a label as in section @secLectureComponentImages we do :
```markdown
![figure](Images/tb_tweety.png)
#figTweety

```

And we get this :

![figure](Images/tb_tweety.png)
#figTweety2

And we can explain that, @figTweety2 is very interesting because...

```noteBox
**Note** : if any element of the lecture has a label, it will be displayed with a following **paperclip icon**. So you can refer to it with an automatic redirection and make sure the link from this paperclip will be available if the label has the same name.
```

You can also refer to a label in an other lecture. To do so, you have to add a **dependency** in the **lecture.toml** configuration (see section @secLectureConfiguration) with the desired lecture name and documentation url which is the url where this particular lecture is published. Example :

```toml
[dependencies]
lecture_name = "https://pages.gitlab.com/url/to/this/lecture/"

```

Then, you can refer to all labels defined in this lecture - all all lectures in the **dependencies** section with :
```markdown
@lecture_name::some_label

```

From, this, it works, and it is solved as a label, and you get an error if the label, or the lecture does not exist.

```noteBox
**Note** : to ensure this mechamism is working, each lecture produces a **lecture_citation.toml** which will be searched automatically by your current lecture if you add some **dependencies** and the their configuration files are not in the **dependencies** directory next to your **lecture.toml** lecture configuration. In our example, we should have a **dependencies/lecture_name.toml** downloaded automatically from the other lecture if the file does not exist.
```

# Language Highlighing
#secLanguageHighlighting

What would be a lecture compiler wihtout a way to highlight all the programming languages you want, all configuration, all scripts and all terminal output just to bring clarity in your lecture or documentation.

All highlighting configuration start with :
```toml
[highlighting]
# Do we want line numbers
is_line_number = true
# Plain text identifier
token_charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
# Vector of accepted extensions
vec_extention = ["c", "cpp", "c++", "h", "hpp"]
# Vector of accepted filenames for highlithing this particular language
vec_filename = []
# Definition of a single line comment
single_line_comment = "//"
# Beginning of a multi-line comment
multi_line_comment_begin = "/*"
# Ending of a multi-line comment
multi_line_comment_end = "*/"
```

We have to define :
- if we have to show the line numbers
- token charset or what composes classic token in this particular language
- vector of accepted file extensions for this language. Usefull if you want to include some files see section @secDevelopment.
- vector of filenames such as CMakeLists.txt or Dockerfile which correspond to specific languages
- the single line comment, if there is no single line comment you should let the field enmpty
- the beginning of a multiple lines comment, if there is no multiple lines comments you should let the field enmpty
- the ending of a multiple lines comment, if there is no multiple lines comments you should let the field enmpty


## Keywords
#secLanguageHighlightingKeyword

Keywords are the more common used feature to highlight a language.

```toml
[[keyword]]
style = "rustBuiltinFunction"
vec_token = [
	"println!",
	"vec!",
	"panic!",
	"bail!",
	"assert!",
	"assert_ne!",
	"assert_eq!",
	"todo!",
	"macro_rules!",
	"stringify!",
]
vec_match = ["..=",
	"..",
	":",
	"{",
	"}",
	"?",
	"$",
	"=",
	"<",
	"=>",
	"->",
	">",
	"&",
	";",
]
```
Where :
- **style** is the css style of the parsed expression
- **vec_token** : vector of token which cannot be followed by any token characters defined in the **token_charset** of section @secLanguageHighlighting
- **vec_match** : vector of any expressions which can be followed by any characters

## Get until
#secLanguageHighlightingGetUntil

Parsing a set of characters from a defined token to an other can help highlighting **strings**, **macros** or **comments** :

```toml
[[getuntil]]
style = "dsString"
start_token = "\""
end_token = "\""

[[getuntil]]
style = "dsChar"
start_token = "'"
end_token = "'"

[[getuntil]]
style = "cppmacro"
start_token = "#"
end_token = "\n"

[[getuntil]]
style = "dsCommentMono"
start_token = "//"
end_token = "\n"

[[getuntil]]
style = "dsCommentMulti"
start_token = "/*"
end_token = "*/"
```
Where :
- **style** is the css style of the parsed expression
- **start_token** is the first token of the expression
- **end_token** is the last token of the expression


## Get until replace
#secLanguageHighlightingGetUntilReplace

The **getuntil** from section @secLanguageHighlightingGetUntil is powerfull but works only for token.
The **getuntilreplace** works for any expression which is delimited by blocks.

```toml
[[getuntilreplace]]
start_token = "beginCustomFigure"
end_token = "endCustomFigure"
replace_start = """<div class="figureStyle">"""
replace_end = "</div>"

```
Where :
- **start_token** is the first token of the expression
- **end_token** is the last token of the expression
- **replace_start** will replace the **start_token** in the final html
- **replace_end** will replace the **end_token** in the final html

So you can create custom blocks if needed.

Let's have this :
```markdown
beginCustomFigure
Let's use the custom block to highlight this sentence
endCustomFigure
```
And you get :
beginCustomFigure
Let's use the custom block to highlight this sentence
endCustomFigure

## Sequence
#secLanguageHighlightingSequence

To be able to define a sequence of token is very usefull to highlight numbers for example :

```toml
[[sequence]]
style = "dsNumber"
vec_step = [
	{oneof = "1234567890"},
	{oneof = "lu"}
]

[[sequence]]
style = "dsNumber"
vec_step = [
	{token = "."},
	{oneof = "1234567890"},
	{oneof = "f"}
]

[[sequence]]
style = "rustBuiltinFunction"
vec_step = [
	{oneof = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"},
	{keyword = "::"},
]
```
Here, we parse integer and floating point numbers.

Where :
- **style** is the css style of the parsed expression
- **vec_step** is the vector of steps of the sequence
- **token** defines a token which as to be parsed entirely and only if the next char is not in the **token_charset** of section @secLanguageHighlighting
- **keyword** defines a token which as to be parser entirely but is independent of next char
- **oneof** defines a char set where the parsed expression will be exclusively composed of these characters in any order possible

```noteBox
**Note** : all steps which are defined before a **token** or a **keyword** are mandatory to get the sequence **style**.
```

## Replace
#secLanguageHighlightingReplace

The **replace** section defines token which have to be replaced by some html directly :

```toml
[replace]
"g++" = """<a class="program" href="https://gcc.gnu.org/onlinedocs/gcc/">g++</a>"""
gcc = """<a class="program" href="https://gcc.gnu.org/onlinedocs/gcc/">gcc</a>"""
cmake = """<a class="program" href="https://www.cmake.org/">cmake</a>"""
maqao = """<a class="program" href="https://www.maqao.org/">maqao</a>"""
valgrind = """<a class="program" href="https://valgrind.org/">valgrind</a>"""
RustyPhoenixLecture = """<a class="project_style" href="https://cta-lapp.pages.in2p3.fr/PHOENIX_LIBS2/static-site-generator/RustyPhoenixLecture/">RustyPhoenixLecture</a>"""
PhoenixTex2Html = """<a class="project_style" href="https://cta-lapp.pages.in2p3.fr/PHOENIX_LIBS2/static-site-generator/PhoenixTex2Html/">PhoenixTex2Html</a>"""
```

So, you do not have to remember how to emphase maqao, or cmake, valgrind, gcc, etc. And you get their documentation link automatically.


## Special parsing
#secLanguageHighlightingSpecialParsing

When writing a lecture, it is always anoying to remember which keyword to highlight, which color to choose, and which url to link with this language or this tool.
There is also a special configuration named **lecture_keyword.toml** where you can combined all the features of the previous sections to highlight automatically all token and keywords you want in the plain text or your lecture.

The following :
```markdown
Here, we can discuss about cmake to compile C++ programs with gcc
and we get all highlighting and documentation url automatically.
```
Gives :

Here, we can discuss about cmake to compile C++ programs with gcc and we get all highlighting and documentation url automatically.

Of course, you can custom what you want to highlight in your lecture or documentation.

## Parser list

If you want to get all available parsers for your configuration, you can have a look into the **parser** directory where the **lecture.toml** is. Or you can use the 
```markdown
__all_parser_example__
```
 keyword.

You will get this in the next section.

__all_parser_example__




# Archives
#secArchive

It is also important to be able to get a full archived project at once. So you can use : 
```markdown
![archive](path/to/some/directory)
```

To create an archive from a directory in **ressource** with sources you already stripped with the media inclusion.
As always paths are relative to the current lecture source file in markdown.

Here is one example for the small c++ example of section @secManaging : ![archive](Examples/SimpleProject)

# Mathematic Formulae
#secMathematicFormulae

We can define some mathematic formulae with : ![markdown](Examples/formulae.md)

Here we have some latex but you could also use typst with the proper synthax.

And we can get the following :

Inline formula $E = m c^2$#formulaEinstein .

Let's express the **Gray Scott** reaction with differential equations :
```formula
\begin{eqnarray*}
	\dfrac{\partial u}{\partial t} & = & r_u \nabla^2 u - uv^2 + f_r \times \left(1 - u\right) \\
	\dfrac{\partial v}{\partial t} & = & r_v \nabla^2 v + uv^2 - \left(f_r + k_r\right) \times v
\end{eqnarray*}
```
#formulaGrayScottReaction

Of couse, you should know the famous @formulaEinstein or the @formulaGrayScottReaction.

Where :
- $u$ and $v$ representent concentration or **U** and **V** species
- $r_u$ and $r_v$ representent diffusion rate of **U** and **V**
- $k_r$ (**Kill Rate**), conversion rate of **V** into **P**
- $f_r$ (**Feed Rate**), speed of the process which feeds **U** and kills **V** and **P**
- $\nabla^2 u$ and $\nabla^2 v$ represent difference of spacial concentration between the current cell and its neighbours


# Work in progress
#secWorkInProgress

The **Work in progress** or **wip** environment allows to define what should be in the lecture or documentation but not properly written at this time.

So, you can defined the following :
![markdown](wip_example.md)

And get :
```wip
I should finish this example but I don't have time for now because I need to sleep.
```

```noteBox
**Note** : in PhoenixTex2Html all **work in progress** are tracked by default in your lecture. For rustyphoenixlecture you can choose which environment to list (see section @secLectureComponentEnvironmentByName)
```

# Add speakers
#secAddSpeaker

A list of speaker can be added in the lecture with **names**, **affiliation**, **biography**, etc. The configuration can be incorporated with :

```markdown
![speaker](timetable_gray_scott_2026_speakers.toml)
```

```noteBox
**Note** : as always, the filename is relative to the parent directory of the current file.
```

And the configuration looks like :
```toml
[[speaker]]
name = "John Doe"
title = "Dr"
label = "john_doe"
function = "Research Engineer"
affiliation = "LAPP / IN2P3 / CNRS"
description = "Some biography."
```
Where :
- **name** is the name and surname of the speaker
- **title** is the title of the speaker if there is one (professor, doctor, etc)
- **label** ables to reference the the speaker in all the lectures, incluing timetables
- **function** is the job or role of the speaker
- **affiliation** describes where the speaker works
- **description** is the biography of the speaker


You can see the result in the next section (@sec_full_speakers) from the **Gray Scott School**.

![speaker](timetable/timetable_gray_scott_2026_speakers.toml)

# Add time table
#secTimeTable

A timetable is defined by a toml configuration file.

First, let's describe the lecture :
```toml
[timetable]
invitation = "gray_scott_2026"
main_url = "https://cta-lapp.pages.in2p3.fr/cours/gray_scott_revolutions/grayscott2026/"
#Main location
location = "Auditorium Marcel Vivargent"
label = "gray_scott_school_2026_timetable"
```
Where :
- **invitation** is the base name of the invitation **ics** which will be generated to integrate the timetable in a agenda application
- **main_url** is the main url of the website where the current timetable is defined. All invitation will point to this to get update of the session content without downloading a new **ics**.
- **location** is the default location of most session of the lecture to avoid redundant information in the configuration
- **label** is the label of the timetable to refer to is in the current lecture or other lecture (see section @secReferenceAndLabel)

Then, we can create week :
```toml
[[block]]
week_title = "CPU Computing"
date = 2026-06-22
invitation = "gray_scott_cpu_computing"
```
Where :
- **week_title** is the title of the week is there is a thematic
- **date** defines the first date of the week in the date format of toml (it can be defined in any type of block, week or session block)
- **invitation** is the base name of the invitation **ics** which will be generated for this week only

Then, we can add block :
```toml
[[block]]
title = "Welcome"
begin = 14:00:00
duration = 00:10:00
speakers = ["giovanni_lamanna"]
invitation = "gray_scott_wellcome"
description = """Presentation of the CNRS/LAPP environment
"""
```
Where :
- **title** is the title of the block
- **begin** is the begin time of the block (in the time format of toml). If there is no **begin** the starting of the session is determined automatically by the end of hte previous one
- **duration** is the duration of the block (the end will be determine automatically)
- **speakers** is the list of the speakers of the block. The speaker will be linked to the defined speaker (see section @secAddSpeaker)
- **invitation** is the base name of the invitation of the block. If several blocks have the same **invitation**, then they will be merged in the same **ics**
- **description** is the description of the session in markdown
- **date** is the date where the session append (in the date format of toml). It has to be defined at least once for each new day.

So, for the next day, we will have :
```toml
[[block]]
title = "C++ 17/20/23 on CPU"
duration = 01:30:00
speakers = ["pierre_aubert"]
description = """Optimization with C++17/20 and 23. Application on lectures from the previous day. Optimisation and Vectorization.
See containers to be used in section @partContainerListTimeTable.
"""
begin = 09:00:00
date = 2026-06-23
invitation = "gray_scott_cpu_cpp17"
```
With a new **date** defined because we are defining a new day of the week.

Sessions can have several styles :
- **timetableBlockStyle** : classic lecture session (the default block)
- **timetableSeminarStyle** : seminar
- **timetableBootstrapStyle** : bootstrap
- **timetableCoffeeBreak** : coffee break
- **timetableManagementStyle** : management (wellcome, etc)


You can add a timetable in your lecture with the following command :

```markdown
![timetable](timetable/timetable_gray_scott_2026.toml)
```

And get this :

![timetable](timetable/timetable_gray_scott_2026.toml)

<!--## List time table
#partContainerListTimeTable

Just an example of reference to show they do work in the timetable too.-->