Browse Source

Updated the doxygen documentation

Adding images support for doxygen documentation ( in doc/img ) + automated images generation with graphviz & make
Yann Weber 8 years ago
parent
commit
d774480aa6

+ 2
- 1
.gitignore View File

@@ -3,5 +3,6 @@
3 3
 .git
4 4
 .idea
5 5
 settings_local.py
6
-doc
6
+doc/html
7
+doc/*.sqlite3.db
7 8
 .*.swp

+ 2
- 2
Doxyfile View File

@@ -703,7 +703,7 @@ CITE_BIB_FILES         =
703 703
 # messages are off.
704 704
 # The default value is: NO.
705 705
 
706
-QUIET                  = NO
706
+QUIET                  = YES
707 707
 
708 708
 # The WARNINGS tag can be used to turn on/off the warning messages that are
709 709
 # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
@@ -892,7 +892,7 @@ EXAMPLE_RECURSIVE      = NO
892 892
 # that contain images that are to be included in the documentation (see the
893 893
 # \image command).
894 894
 
895
-IMAGE_PATH             = 
895
+IMAGE_PATH             = doc/img
896 896
 
897 897
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
898 898
 # invoke to filter for each input file. Doxygen will invoke the filter program

+ 46
- 0
Lodel/__init__.py View File

@@ -8,6 +8,7 @@
8 8
 #
9 9
 # @section mainpage_docs Documentation
10 10
 #
11
+# - Lodel2 architecture : @subpage lodel2_arch 
11 12
 # - Fieldtypes : @subpage lodel2_fieldtypes
12 13
 # @subsection mainpage_docs_leapi LeAPI
13 14
 #
@@ -27,4 +28,49 @@
27 28
 # - @ref leapi
28 29
 # - DataSource
29 30
 #  - DataSource.MySQL
31
+#
32
+
33
+## @page lodel2_arch Lodel2 architecture
34
+#
35
+#
36
+# @section lodel2_arch_basic Lodel2
37
+#
38
+# Lodel 2 is a CMS that allows to define content types ......
39
+#
40
+# @section lodel2_arch_edmod Lodel2 Editorial Model
41
+#
42
+# The editorial model is the part of lodel2 that allows to defines content types.
43
+#
44
+# To handle this the editorial model has 3  abstractions :
45
+# - Classes
46
+# - Types
47
+# - Fields
48
+#
49
+# @warning An editorial model does NOT contains values.
50
+#
51
+# The editorial model is used to generate the dynamic part of the Lodel2 API ( see @ref leapi )
52
+#
53
+# @subsection lodel2_arch_edmod_classes Editorial model classes ( EmClass )
54
+#
55
+# An EmClass is basically a named collection of EmFields ( see @ref lodel2_arch_edmod_fields ) associated with a classtype.
56
+#
57
+# Classtypes are "family" of EmClasses. They defines allowed hierarchical relations between EmClass.
30 58
 # 
59
+# @subsection lodel2_arch_edmod_types Editorial model types ( EmType )
60
+#
61
+# An EmType is a named EmClass specialization. In fact some EmField in an EmClass can be defined as optionnal and then be selected
62
+# or not to be included in an EmType.
63
+# 
64
+# @subsection lodel2_arch_edmod_fields Editorial model fields ( EmField )
65
+#
66
+# EmFields defines what kind of datas can be stored in EmTypes. Actually its the associationg with an EmFieldtype ( see @ref lodel2_fieldtypes )
67
+# that really defines what kind of datas can be stored.
68
+#
69
+# @subsection lodel2_arch_edmod_fig Editorial model figures
70
+#
71
+# @subsubsection lodel2_arch_edmod_fig_components Editorial model main components
72
+# @image html graphviz/em_components.png
73
+# @subsubsection lodel2_arch_edmod_fig_relations Editorial model relations between components
74
+# @image html graphviz/em_relations.png
75
+# @subsubsection lodel2_arch_edmod_fig_hierarchy Hierarchical relations between EmTypes given a classtype
76
+# @image html graphviz/em_types_hierarch.png

+ 27
- 6
Makefile View File

@@ -1,21 +1,42 @@
1 1
 all: check doc pip
2 2
 
3
+# Running unit tests
3 4
 check:
4 5
 	python -m unittest -v
5 6
 
6
-doc: cleandoc
7
-	doxygen
8
-
7
+# Rule to update libs
9 8
 pip: cleanpycache
10 9
 	pip install --upgrade -r requirements.txt
11 10
 
11
+#
12
+# Documentation rules
13
+#
14
+graphviz_images_path = doc/img/graphviz
15
+
16
+doc: cleandoc docimages
17
+	doxygen
18
+
19
+# Generating graphviz images
20
+docimages:
21
+	cd $(graphviz_images_path); make
22
+
23
+#
24
+# Cleaning rules
25
+#
12 26
 .PHONY: check doc clean cleanpyc cleandoc cleanpycache
13 27
 
14
-cleandoc:
15
-	-rm -Rfv ./doc/
28
+clean: cleanpyc cleandoc cleanpycache
29
+
30
+# Documentation cleaning
31
+cleandoc: cleandocimages
32
+	-rm -Rfv ./doc/html ./doc/doxygen_sqlite3.db
33
+
34
+cleandocimages:
35
+	cd $(graphviz_images_path); make clean
36
+
37
+# Python cleaning
16 38
 cleanpyc:
17 39
 	-find ./ |grep -E "\.pyc$$" |xargs rm -fv 2>/dev/null
18 40
 cleanpycache: cleanpyc
19 41
 	-find ./ -type d |grep '__pycache__' | xargs rmdir -fv 2>/dev/null
20 42
 
21
-clean: cleanpyc cleandoc cleanpycache

+ 14
- 0
doc/img/graphviz/Makefile View File

@@ -0,0 +1,14 @@
1
+dotfiles := $(wildcard *.dot)
2
+images := $(patsubst %.dot,%.png,$(wildcard *.dot))
3
+
4
+all: $(images)
5
+	
6
+%.png: %.dot
7
+	dot -Tpng $< > $@
8
+
9
+.PHONY: clean distclean
10
+
11
+clean:
12
+	-rm $(images)
13
+
14
+distclean: clean

+ 13
- 0
doc/img/graphviz/em_components.dot View File

@@ -0,0 +1,13 @@
1
+digraph editorial_model_components {
2
+
3
+	label="Editorial model components"
4
+
5
+	classtypes [ label="{ entity | person | index }", shape=record]
6
+	class [ label="<f0> Class| { <f2> fields|<f3> optionnal field }", shape=record ]
7
+	type [ label="<f0> Type| { <f2> fields| <f3> selected field }", shape=record ]
8
+
9
+	classtypes -> class [ label="Defines possibles hierarchy" ]
10
+	class:f0 -> type:f0 [ label="specialize", style="dotted" ]
11
+	class:f2 -> type:f2 [ label="inherit"]
12
+	class:f3 -> type:f3 [ label="select" ]
13
+}

+ 26
- 0
doc/img/graphviz/em_relations.dot View File

@@ -0,0 +1,26 @@
1
+digraph editorial_model_relations {
2
+	
3
+	label="Editorial Model relations"
4
+
5
+	classtypes
6
+
7
+	r_class1 [ label="<f0> Class 1| {STR |INTEGER(optionnal) | STR | REL_TO_TYPE}", shape=record ]
8
+
9
+	r_class2 [ label="<f0> Class 2| {STR |STR }", shape=record ]
10
+
11
+	r_type1 [ label="<f0> Type 1| { STR |INTEGER | STR |<fr>REL_TO_TYPE}}", shape=record ]
12
+	r_type2 [ label="<f0> Type 2|{ STR | STR |<fr>REL_TO_TYPE}", shape=record ]
13
+
14
+	r_type3 [ label="<f0> Type 3|{ STR |STR }", shape=record ]
15
+
16
+	classtypes -> r_class1
17
+	classtypes -> r_class2
18
+
19
+	r_class1 -> r_type1 [ label="inherit", style="dotted" ]
20
+	r_class1 -> r_type2 [ label="inherit", style="dotted" ]
21
+
22
+	r_class2 -> r_type3 [ label="inherit", style="dotted" ]
23
+
24
+	r_type1:fr -> r_class2 [ label="link to Class 2" ]
25
+	r_type2:fr -> r_class1 [ label="link to Class 1" ]
26
+}

+ 77
- 0
doc/img/graphviz/em_types_hierarch.dot View File

@@ -0,0 +1,77 @@
1
+digraph em_types_hierarchy {
2
+
3
+	label="Editorial Model types hierarchy"
4
+
5
+	subgraph cluster_person {
6
+		label="Person"
7
+		h_person [ label="Person", shape="tripleoctagon" ]
8
+
9
+		hc3 [ label="Class 3", shape="doubleoctagon"]
10
+		hc4 [ label="Class 4", shape="doubleoctagon"]
11
+
12
+		ht6 [ label="Type 6", shape="octagon" ]
13
+		ht7 [ label="Type 7", shape="octagon" ]
14
+		ht8 [ label="Type 8", shape="octagon" ]
15
+
16
+		h_person -> {hc3, hc4}
17
+
18
+		hc3 -> { ht6,ht7 }
19
+		hc4 -> ht8
20
+
21
+		ht6 -> ht7 [ label="identity", color="blue" ]
22
+		ht6 -> ht8 [ label="identity", color="blue" ]
23
+		ht8 -> ht8 [ label="identity", color="blue" ]
24
+	}
25
+
26
+	subgraph cluster_entity {
27
+		label="Entity"
28
+		h_entity [ label="Entity", shape="tripleoctagon" ]
29
+
30
+		hc1 [ label="Class 1", shape="doubleoctagon"]
31
+		hc2 [ label="Class 2", shape="doubleoctagon"]
32
+
33
+		ht1 [ label="Type 1", shape="octagon" ]
34
+		ht2 [ label="Type 2", shape="octagon" ]
35
+		ht3 [ label="Type 3", shape="octagon" ]
36
+		ht4 [ label="Type 4", shape="octagon" ]
37
+		ht5 [ label="Type 5", shape="octagon" ]
38
+
39
+		
40
+		h_entity -> { hc1, hc2 }
41
+
42
+		hc1 -> { ht1,ht2,ht3 }
43
+		hc2 -> { ht4, ht5 }
44
+
45
+		ht1 -> ht1 [label="translation", color="red"]
46
+		ht3 -> ht3 [label="translation", color="red"]
47
+		ht5 -> ht5 [label="translation", color="red"]
48
+		ht4 -> ht1 [ label="parent", color="green"]
49
+		ht2 -> ht1 [ label="parent", color="green"]
50
+		ht5 -> ht4 [ label="parent", color="green"]
51
+		ht3 -> ht4 [ label="parent", color="green"]
52
+		ht3 -> ht1 [ label="parent", color="green"]
53
+
54
+
55
+	}
56
+
57
+	subgraph cluster_entry {
58
+		label="Entry"
59
+		h_entry [ label="Entry", shape="tripleoctagon" ]
60
+
61
+		hc5 [ label="Class 5", shape="doubleoctagon"]
62
+
63
+		ht9 [ label="Type 9", shape="octagon" ]
64
+		ht10 [ label="Type 10", shape="octagon" ]
65
+
66
+		h_entry -> hc5
67
+
68
+		hc5 -> {ht9, ht10}
69
+
70
+		ht9 -> ht9 [ label="parent", color="green" ]
71
+		ht9 -> ht9 [ label="translation", color="red" ]
72
+		ht10 -> ht10 [ label="translation", color="red" ]
73
+	}
74
+
75
+	ht5 -> hc3 [ label="relation to type", style="dotted"]
76
+	ht2 -> hc5 [ label="relation to type", style="dotted"]
77
+}

+ 14
- 0
doc/img/graphviz/lodel2_archi.dot View File

@@ -0,0 +1,14 @@
1
+digraph Lodel2_architecture {
2
+	
3
+
4
+	ui [ label="User interface" ]
5
+	leapi [ label="<api>Lodel Editorial API|{Static API|<dynamic> Dynamically generated API}", shape=record ]
6
+	editorial_model [ label="<em>Editorial Model|{Classes|Types|{<fields>Fields|<ftype>fieldtypes}}", shape=record ]
7
+
8
+	editorial_model:em -> leapi:dynamic [ label="Generate" ]
9
+	editorial_model:ftype -> editorial_model:fields [ label="Defines field value" ]
10
+	leapi -> editorial_model:ftype [ label="Asks for data validation" ]
11
+	ui -> leapi:api
12
+	leapi:api -> ui
13
+
14
+}

Loading…
Cancel
Save