You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating URL's for the buttons above is tricky. Once they're generated, it's hard to keep them up-to-date as new versions are released. FreshMark solves the "Markdown with variables" problem by embedding tiny JavaScript programs into the comments of your Markdown, which statically generate the rest of the document. By running these programs as part of your build script, your project's documentation will always stay up-to-date.
25
+
Generating URL's for the buttons above is tricky. Once they're generated, it's hard to keep them up-to-date as new versions are released. FreshMark solves the "Markdown with variables" problem by embedding tiny JavaScript SCRIPTs into the comments of your Markdown, which statically generate the rest of the document. By running these SCRIPTs as part of your build script, your project's documentation will always stay up-to-date.
26
26
27
27
Here is what the code looks like for the shields at the top of this document:
28
28
@@ -51,20 +51,20 @@ To run FreshMark on some text, call [FreshMark.compile()](https://diffplug.githu
51
51
52
52
## How it works
53
53
54
-
FreshMark has three pieces, `SECTION`, `PROGRAM`, and `INPUT`. They are parsed as shown below:
54
+
FreshMark has three pieces, `SECTION`, `SCRIPT`, and `BODY`. They are parsed as shown below:
55
55
56
56
```javascript
57
57
<!---freshmark SECTION (identifier)
58
-
PROGRAM (javascript)
58
+
SCRIPT (javascript)
59
59
-->
60
-
INPUT (markdown)
60
+
BODY (markdown)
61
61
<!---freshmark /SECTION-->
62
62
```
63
63
64
-
When `PROGRAM` is run, there are two magic variables:
64
+
When `SCRIPT` is run, there are two magic variables:
65
65
66
-
* `input` - This is everything inside of INPUT (guaranteed to have only unix newlines at runtime)
67
-
* `output` - The script must assign to this variable. FreshMark will generate a new string where the `INPUT` section has been replaced with this value.
66
+
* `input` - This is everything inside of BODY (guaranteed to have only unix newlines at runtime)
67
+
* `output` - The script must assign to this variable. FreshMark will generate a new string where the `BODY` section has been replaced with this value.
68
68
69
69
Only four functions are provided:
70
70
@@ -79,8 +79,8 @@ It's full ECMAScript 5.1, so you can define any other functions you like, but th
79
79
80
80
When you run FreshMark, you can supply it with a map of key-value pairs using the command line or via a properties file. If you're running FreshMark from a build system plugin such as Gradle, then all of your project's metadata will automatically be supplied. These key-value pairs are used in the following way:
81
81
82
-
* Before `PROGRAM` is executed, any `{{key}}` templates will be substituted with their corresponding value.
83
-
* When `PROGRAM` is executed, all of these key-value pairs are available as variables.
82
+
* Before `SCRIPT` is executed, any `{{key}}` templates will be substituted with their corresponding value.
83
+
* When `SCRIPT` is executed, all of these key-value pairs are available as variables.
0 commit comments