Skip to content

Commit 2425b59

Browse files
committed
added more doc comments to interface files
1 parent eb4ae18 commit 2425b59

9 files changed

+72
-3
lines changed

lib/Fabricators.rei

+5
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
/** Built-in Fabricators
2+
* See Types module for explanation on the namings and types.
3+
*/
4+
15
let md: Types.fabricator(string);
6+
/** Load Markdown files from a specified (relative) path */

lib/Factories.rei

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/** Built-in Factories
2+
* See Types module for explanation on the namings and types.
3+
*/
14
let log: Types.factory(unit);

lib/Fs.rei

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/** Utility Functions for the filesystem */
2+
13
let readFiles: string => list(string);
4+
/** Get a list of all files (absolute path) in a given relative path */
25

36
let filterMd: list(string) => list(string);
7+
/** Get only Markdown files from a list of files */
48

59
let file2string: string => string;
10+
/** Read a file (absolute path) in as a string */
611

7-
let writeFile: (string, string) => unit;
12+
let writeFile: (/*path*/ string, /*content*/ string) => unit;
13+
/** Write a string into a file at the specified path */

lib/Md.rei

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/** Utility Functions for Markdown files */
2+
13
let string2html: string => string;
4+
/** Parse string as markdown into string of html */

lib/Print.rei

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** Utility Functions to write to the stdout */
2+
13
let info: string => unit;
24
let success: string => unit;
35
let error: string => unit;

lib/Refabricators.rei

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/** Built-in Refabricators
2+
* See Types module for explanation on the namings and types.
3+
*/
14
let between: Types.refabricator((string, string));

lib/Types.re

+42
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,51 @@
1+
/** Common Types of the Refabricator Library
2+
*
3+
* - Fabrics consist of a name and the actual content
4+
* - a fabric is a function taking a unit and returning a name and the actual content
5+
* - a fabricator is "generator" of fabrics
6+
* - a refabricator manipulates the result of a fabric
7+
* - a factory produces the SSG's output based on fabrics and their manipulations of refabricators
8+
* - an appliedFactory is an already configure factory which takes fabrics and processes them
9+
*/
10+
111
type name = string;
12+
/** Name of the result of a fabric */
13+
214
type content = string;
15+
/** Content of the result of a fabric */
16+
317
type t = (name, content);
18+
/** Result of a fabric */
19+
420
type fabric = unit => t;
21+
/** A fabric is a generator function for a source.
22+
* The function can be called later on to actually fetch sources
23+
* aka "lazyly loaded source"
24+
*/
25+
526
type fabrics = list(fabric);
27+
/** Multiple fabrics
28+
* aka "multiple lazyly loaded sources"
29+
*/
30+
631
type fabricator('a) = 'a => fabrics;
32+
/** Constructor of multple fabrics.
33+
* Each concrete type of fabricator has it's own set of arguments.
34+
* aka "loader of fabrics"
35+
*/
36+
737
type refabricator('a) = ('a, fabrics) => fabrics;
38+
/** Manipulates fabrics
39+
* Each concrete type of refabricator has it's own set of arguments
40+
* aka "rewriter of source's content"
41+
*/
42+
843
type factory('a) = ('a, fabrics) => result(unit, string);
44+
/** Construct an `appliedFactory`, which will process fabrics (e.g. write them to file)
45+
* aka "Processor of fetched & manipulated content"
46+
*/
47+
948
type appliedFactory = fabrics => result(unit, string);
49+
/** Construct an `appliedFactory`, which will process fabrics (e.g. write them to file)
50+
* aka "Processor of fetched & manipulated content"
51+
*/

lib/Util.re

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let concat = fabrics => List.concat(fabrics);
22

3-
let rename = (name, (_oldName, content)) => (name, content);
3+
let rename = (rename, (name, content)) => (name |> rename, content);
44

55
let modify =
66
(modify, (name, content)) => (name, modify(content));

lib/Util.rei

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
/** Uility Functions for fabrics */
2+
13
let concat: list(Types.fabrics) => Types.fabrics;
4+
/** Combine a list of several `fabrics` into a single `fabrics`. */
25

3-
let rename: (string, Types.t) => Types.t;
6+
let rename: (string => string, Types.t) => Types.t;
7+
/** Rename the result of a fabric */
48

59
let modify: (string => string, Types.t) => Types.t;
10+
/** Modify the content of a fabric */

0 commit comments

Comments
 (0)