docjs 0.1.5 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/docs/ARCHITECTURE.md DELETED
File without changes
data/docs/CONCEPT.md DELETED
@@ -1,80 +0,0 @@
1
- Concept of the Documententation
2
- ===============================
3
-
4
- There are only two build-in types, we want to pay attention to:
5
-
6
- 1. Objects
7
- 2. Functions
8
-
9
-
10
- Object
11
- ------
12
- By **Objects** we mean all kind of *things*, that can contain other things. Those containted ones, we call **properties** of the Object.
13
-
14
- In JavaScript this may look like:
15
-
16
- var obj = {
17
- property_one: function() { ... },
18
- property_two: {
19
- // another object
20
- },
21
- property_three: 3
22
- }
23
-
24
-
25
- Function
26
- --------
27
- **Functions** are *things*, that can be executed. They can have **parameters** and **return-values** There are two types of Functions: plain functions and **constructors**.
28
-
29
- Example for a plain function:
30
-
31
- function my_func(param) {
32
- return "Hello world!";
33
- }
34
-
35
- Example for a function as a constructor
36
-
37
- function my_constructor() {
38
- this.message = "Hello world!";
39
- }
40
-
41
-
42
- Remember: any return-value of a constructor-function will be ignored and replaced by this
43
-
44
- But a function can be an object at the same time. For example:
45
-
46
- function my_func_two() {
47
- return "fancy function";
48
- }
49
- my_func_two.message = "Say hello to Mr. Foo";
50
-
51
- Most important a function can contain one special property **prototype**.
52
-
53
- Remember: In this case the function has to be a constructor. Otherwise prototype would be useless, because it is only used when creating instances of the function using new. After creating an instance the prototype-object is accessible in the this-context of the instance.
54
-
55
- function my_constructor() {
56
- this.message = "Hello world!";
57
- }
58
- my_constructor.prop1 = 456;
59
- my_constructor.prototype = {
60
- some_proto_prop: 123
61
- }
62
-
63
- Revealing Module Pattern
64
- ------------------------
65
- But what about revealing modules?
66
-
67
- function my_module() {
68
-
69
- // some private stuff here
70
-
71
- return {
72
- property_of_the: "returned object"
73
- };
74
- }
75
-
76
- One should pay attention to this pattern while creating a documentation tool.
77
-
78
- Conclusion
79
- ----------
80
- So we can break it down to Functions and Objects. Objects can have properties. Functions can, at the same time, be Objects. There are special functions, called *constructors*, which in turn have one special property called *prototype*. This property has to be handled special in documentation.
@@ -1,39 +0,0 @@
1
- Fullqualifier
2
- -------------
3
- Like an absolute path (/etc/init.d/apache2) we use `FOO.bar` as fullqualifier to
4
- an object or function.
5
-
6
- A leading dot suggests filling the empty leading space with the current parsing-context.
7
- As such `.something_else` would be resolved to `FOO.bar.something_else` in the current context.
8
-
9
- Examplecode:
10
-
11
- /**
12
- * @function my_module
13
- * @return [my_module.object]
14
- */
15
- function my_module() {
16
-
17
- // some private stuff here
18
-
19
-
20
- /**
21
- * @property .foo
22
- */
23
- my_module.foo = 123;
24
-
25
-
26
- /**
27
- * @property .foo_bar
28
- */
29
- my_module.foo_bar = 789;
30
-
31
-
32
- /**
33
- * @object .object
34
- */
35
- return {
36
- /* @property .object.property_of_the */
37
- property_of_the: "returned object"
38
- };
39
- }
File without changes