Skip to content

Commit a2e4bbb

Browse files
committed
latest content
1 parent 55e3135 commit a2e4bbb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+19574
-38
lines changed

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Form Tools Documentation
33
44
description: "Documentation and tutorials for all things Form Tools."
55
exclude: [repos]
6-
baseurl: "/docs"
6+
baseurl: ""
77
url: "http://docs.formtools.org"
88

99
# build settings

_data/module_list.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"name":"Form Builder","description":"Automatically publish any forms directly onto your website. No programming knowledge needed!","icons":{"16x16":"assets/images/icon-16x16.png","32x32":"assets/images/icon-32x32.png","48x48":"assets/images/icon-48x48.png","64x64":"assets/images/icon-128x128.png","128x128":"assets/images/icon-128x128.png"},"folder":"module-form_builder"}]
1+
[{"name":"Form Builder","description":"Automatically publish any forms directly onto your website. No programming knowledge needed!","icons":{"16x16":"icon-16x16.png","32x32":"icon-32x32.png","48x48":"icon-48x48.png","64x64":"icon-64x64.png","128x128":"icon-128x128.png"},"folder":"module-form_builder"}]

assets/css/core.css

+5
Original file line numberDiff line numberDiff line change
@@ -8495,6 +8495,11 @@ img.mfp-img {
84958495
opacity: 0;
84968496
}
84978497

8498+
.icon48x48 {
8499+
display: inline-block;
8500+
width: 48px;
8501+
height: 48px;
8502+
}
84988503
.icon64x64 {
84998504
display: inline-block;
85008505
width: 64px;
Loading
896 Bytes
Loading
Loading
Loading
Loading

gruntfile.js

+23-30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = function(grunt) {
33

44
var fs = require("fs");
55
var vm = require("vm");
6+
var rimraf = require('rimraf');
67

78
var _includeInThisScope = function (path) {
89
var code = fs.readFileSync(path);
@@ -11,20 +12,19 @@ module.exports = function(grunt) {
1112
_includeInThisScope("grunt/plugin_list.js");
1213
_includeInThisScope("grunt/helpers.js");
1314

15+
1416
var generateListFile = function(source) {
1517
var sourceObj = (source === "module") ? modules : themes;
16-
1718
var found = [];
1819
for (var i=0; i<sourceObj.length; i++) {
1920
var folder = source + "-" + sourceObj[i];
2021
var packageFile = "repos/" + folder + "/package.json";
2122
if (!fs.existsSync(packageFile)) {
2223
continue;
2324
}
24-
2525
var json = grunt.file.readJSON(packageFile);
2626

27-
// copy the icons out of the module/theme
27+
// copy the icons out of the module/theme and into the docs section
2828
if (source === "module") {
2929
copyIcons(folder, json.icons);
3030
} else {
@@ -33,57 +33,50 @@ module.exports = function(grunt) {
3333

3434
// append the folder name. This is used to construct links to the icons
3535
json.folder = folder;
36-
3736
found.push(json);
3837
}
3938

4039
grunt.file.write("_data/" + source + "_list.json", JSON.stringify(found));
4140
};
4241

43-
44-
var iconFile, targetFolder;
4542
var copyIcons = function (folder, icons) {
46-
47-
// remove the old folder
48-
config.clean.folder = ["./assets/generated/" + folder];
49-
grunt.task.run("clean:folder")
43+
// wipe out of the old folder and recreate it
44+
var path = "assets/generated/" + folder;
45+
rimraf.sync(path);
46+
fs.mkdirSync(path);
5047

5148
// now copy over the icons
5249
for (var icon in icons) {
53-
iconFile = "./repos/" + folder + "/" + icons[icon];
54-
targetFolder = "assets/generated/" + folder + "/";
55-
56-
// create the folder
57-
grunt.task.run("shell:copyIcon");
50+
var sourceFile = "./repos/" + folder + "/assets/images/" + icons[icon];
51+
var targetLocation = "assets/generated/" + folder + "/" + icons[icon];
52+
copyFileSync(sourceFile, targetLocation);
5853
}
5954
};
6055

61-
var getCopyIconCommand = function () {
62-
var commands = [];
63-
commands.push("sudo mkdir " + targetFolder);
64-
commands.push("sudo chmod 777 " + targetFolder);
65-
commands.push("sudo cp " + iconFile + " " + targetFolder);
66-
67-
console.log("_______________________________");
68-
console.log(commands);
69-
console.log("_______________________________");
70-
71-
return commands.join('&&');
56+
var copyFileSync = function(srcFile, destFile) {
57+
var content = fs.readFileSync(srcFile);
58+
fs.writeFileSync(destFile, content);
7259
};
7360

74-
7561
var config = {
7662
pkg: grunt.file.readJSON("package.json"),
7763
clean: {},
7864
template: {},
7965
copy: {},
80-
8166
shell: {
8267
start: { command: "jekyll serve --watch" },
8368
update: { command: getUpdateCommands() },
8469
downloadModules: { command: getModuleRepoCommands() },
8570
downloadThemes: { command: getThemeRepoCommands() },
86-
copyIcon: { command: function() { getCopyIconCommand(); } }
71+
72+
// builds the module documentation into /modules/[MODULE_FOLDER]
73+
buildModuleDoc: {
74+
command: [
75+
"cd repos/module-form_builder",
76+
"jekyll build --config _config_docs.yml --destination ../../modules/module-form_builder"
77+
].join('&&')
78+
}
79+
8780
}
8881
};
8982

@@ -108,7 +101,7 @@ module.exports = function(grunt) {
108101
grunt.registerTask("init", ["shell:downloadModules", "shell:downloadThemes", "createModuleListFiles"]);
109102

110103
// updates the content of the external repos and rebuilds
111-
grunt.registerTask("update", ["shell:update", "createModuleListFiles"]);
104+
grunt.registerTask("update", ["shell:update", "createModuleListFiles", "shell:buildModuleDoc"]);
112105

113106
// starts the server
114107
grunt.registerTask("start", ["shell:start"]);

modules/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
heading: Modules
66
---
77

8-
{% for module_info in site.data.modules_list %}
8+
{% for module_info in site.data.module_list %}
99

1010
<div class="row">
1111
<div class="col-lg-1">
12-
<span class="icon64x64" style="background-image: {{module_info.icon.64x64}};"></span>
12+
<span class="icon48x48" style="background-image: url('../assets/generated/{{module_info.folder}}/{{module_info.icons.48x48}}')"></span>
1313
</div>
14-
<div class="col-lg-3">
15-
<a href="{{site.baseurl}}/tutorials/post_form_captchas/">{{module_info.name}}</a>
14+
<div class="col-lg-2">
15+
<a href="{{module_info.folder}}/">{{module_info.name}}</a>
1616
</div>
17-
<div class="col-lg-8">
17+
<div class="col-lg-9">
1818
{{module_info.description}}
1919
</div>
2020
</div>

modules/module-form_builder/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Form Builder Documentation
2+
3+
This branch contains the documentation for the Form Builder module.
4+
5+
6+
#### How to run
7+
8+
`jekyll serve --watch`

0 commit comments

Comments
 (0)