roll-right 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +467 -219
- package/bin/breakup.js +0 -1
- package/bin/index.js +181 -93
- package/docs/rr-background.md +35 -0
- package/historical/old_index.js +95 -0
- package/index.js +0 -6
- package/lib/PreStagingSubsitutions.js +64 -0
- package/lib/SkelToTemplate.js +4005 -0
- package/lib/TemplateToPreStaging.js +433 -0
- package/lib/bundle_directives.js +48 -0
- package/lib/html_directives.js +52 -0
- package/lib/mod_utils.js +1 -2
- package/lib/phase1.js +16 -70
- package/lib/phase2.js +13 -11
- package/lib/rr_utils.js +7 -15
- package/lib/sys_utils.js +36 -0
- package/lib/utils.js +350 -42
- package/package.json +10 -7
- package/test/index.js +30 -2
- package/testme.txt +3885 -0
- package/tools/genpage.js +34 -11
- package/tools/subst_to_vars.js +48 -0
package/README.md
CHANGED
|
@@ -1,305 +1,553 @@
|
|
|
1
1
|
# roll-right
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
***A tool that helps generate HTML pages, or other types of pages such as PWA components.***
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
2. provide a file describing families of page skeletons
|
|
9
|
-
3. provide a JSON description that selects which skeleton parts are to be used along with source directories
|
|
10
|
-
4. run roll-right in phase 1 with the JSON to generate site templates
|
|
11
|
-
5. provide static components, pictures, etc. to populate templates
|
|
12
|
-
6. run roll-right in phase 2 with .subst files specifying the template population
|
|
13
|
-
7. use other tools to deploy files dropped into a staging directory
|
|
7
|
+
**roll-right** operations begin with the tool reading a configuration file that lists output groups. Each output group defines targets, which include a list of concerns and formulas for output directories, indicating where the files for the concerns should go. Each output group also contains a table mapping output file names to skeletons that should be used to generate them.
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
**roll-right** compiles the skeletons, .skel files, which are description of web pages in a skeleton language. The language allows for describing repetitions of sections, data driven section replication and expansion, sub-skeleton inclusion with conditional selection based on configuration variables and simple calculations.
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
### install it
|
|
18
12
|
|
|
19
13
|
```
|
|
20
14
|
npm install -g roll-right
|
|
21
15
|
```
|
|
22
16
|
|
|
17
|
+
### run it
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
<b>Here is an example:</b>
|
|
25
20
|
|
|
26
21
|
```
|
|
27
|
-
roll-right --phase
|
|
22
|
+
roll-right --phase prepare --sources [websites]/template-configs/ --generator generate.json --structure parsed.json
|
|
28
23
|
```
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
```
|
|
26
|
+
roll-right --phase template --sources [websites]/template-configs/ --generator generate.json --structure parsed.json
|
|
27
|
+
```
|
|
31
28
|
|
|
32
29
|
```
|
|
33
|
-
roll-right --phase
|
|
30
|
+
roll-right --phase page --sources [websites]/template-configs/ --values assignments.json
|
|
34
31
|
```
|
|
35
32
|
|
|
33
|
+
In the examples, there is a parameter ***sources*** that is a directory. The other parameters that take files as arguments are expected to be offsets from the ***sources*** parameter. The documentation that follows will include a description of these parameters.
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
### purpose
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
> This tool helps create a flow in creating and maintaining web pages and PWAs in a few phases.
|
|
38
|
+
>
|
|
39
|
+
> Each phase runs against a configuration file that helps select web page skeletons for a number of concerns (different URLs and web applications) and operates to fill out the skeletons with the custom content through a few steps until outputting a final pre-release page for testing, prior to release.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
The web pages (apps) in the pre-release directories can undergo further transformation before they are deposited into a final staging directory, where the pages can reside in their compressed form with bundles in subdirectories structured for delivery to directories accessed by a web server. Other tools may take on this final step, for example [copious-software-dev-manager](https://github.com/copious-world/copious-software-dev-manager.git).
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
roll-right-breakup <path to file> <optional output directory>
|
|
45
|
-
```
|
|
43
|
+
### three phases:
|
|
46
44
|
|
|
45
|
+
There are three phases:
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
1. Skeletons to skeleton parsing data and a named section database for each page belonging to a concern.
|
|
48
|
+
2. Parsing data along with finalized named section databases to Web Page Templates.
|
|
49
|
+
3. Web Page Templates to pre-staging HTML files (or app files)
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
Once pages are in staging, delivery to server directories or other uses are left to other tools. But, the files in pre-staging may be observed in the browser for testing and display quality.
|
|
52
|
+
|
|
53
|
+
The following provide a few more hints about the phase:
|
|
51
54
|
|
|
52
|
-
1
|
|
53
|
-
2. The developer needs to make a cofiguration file. The configuration file is read by the **roll-right**, enabling **roll-right** to find the pre-tempalte and the set of files that will be use to replace **link forms**. The configuration file has its own set of variables. Every configuration file contains a JSON object with two fields **alpha** and **beta**. The **alpha** field contains the phase 1 configuration, while the **beta** field contains the phase 2 configuration. It is more likely that different projects will use the same alpha field and different beta fields.
|
|
54
|
-
3.
|
|
55
|
+
1) **prepare**
|
|
55
56
|
|
|
57
|
+
> In the preparation phase (***prepare***), the roll-right reads in skeleton files, creates a parse tree from them for the concerns, and produces a database of visual regions for each file generated for a concern. The tool puts the parse tree into a file in the project's sources directory. Then. in a directory set aside for a concern. the tool writes a named section db for each file being generated for the concern. The content creator may edit the named databases.
|
|
56
58
|
|
|
59
|
+
2) **template**
|
|
57
60
|
|
|
61
|
+
> During the ***template*** phase, the tool reads the files generated by the prepare phase along with the edited versions of the named databases. In this phase, the tool finalizes any skeleton compilation left given the named databases reflect the content choices provided by a content editor. The tool generates visual template files, e.g. HTML files with variable forms and file import forms. Besides generating templates, the variable valuation files are generated. A content editor would put values into the valuation file, such things as dates, company names, etc. The tool attempts to merge in value files that may have previously supplied values to the variables.
|
|
58
62
|
|
|
63
|
+
3) **pages**
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
> ***pages*** is the tool's final phase. During the pages phase, the tool reads in the templates and the value files and generates final HTML files and manages their JavaScript bundles. The files are placed into pre-staging directories for each concern, where each page file belonging to a concern has all the values provide for the concern for the page
|
|
61
66
|
|
|
62
|
-
For humans of this world, we have created the of-this.world collection of subdomains. Each subdomain has a main access page, which is a dashboard owned by a particular user. The dashboard prominently displays a set of `<iframes>` that host other applications that make requests through it.
|
|
63
67
|
|
|
64
|
-
Each dashboard owner, a human, will have the page generated for him/her containing some name and identity information, the public part. Other processes make user that private information is stored in the user's browser under the user's URL. Each page is generated from a template used by the **of-this.world** server. And, the template is generated by an application of **roll-right**.
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
#### initial setup
|
|
70
|
+
|
|
71
|
+
Prior to the use of the tool, a directory or set of directories, containing skeletons should be created. **roll-right** does not create these skeletons. That is up to the manager of a website concern or may be created automatically by scraping sites for themes. **roll-right** will read from the directory specified in its configuration file. In my own setup, final skeletons are placed into a pre-template directory, and there are others, such as those closer to the PWA projects. The final skeletons are called "final" because they start, originally, as files listing all the JavaScript file and visual components that needed for a number of projects. But, among a number of sites, much of the code can be replicated. So, there are other tools that edit the original skeletons by removing some file inclusions which get moved into bundles, CSS files that are included may be turned into links to CSS bundles are deferred loading files. The **roll-right** configuration can be used to make the tool aware of bundles and link files that should be moved into the directories used by the concerns' pages.
|
|
72
|
+
|
|
73
|
+
## Background
|
|
74
|
+
|
|
75
|
+
For more on the evolution of this tools you may be interested in the following: [roll-right background](./docs/rr-background.md)
|
|
76
|
+
|
|
77
|
+
## Differences Compared to Bundlers
|
|
78
|
+
|
|
79
|
+
The main process used by this package is substitution and expansion. The output is mainly a self contained file or a small collection of files. The output is not bundled. Also, there is a dependency on Handlebars, which handles conditional substitution.
|
|
80
|
+
|
|
81
|
+
This tool does put script and markup into a file, given a repository of commonly occurring template snippets and code files. The files an output page will use and include must be mentioned in the original skeleton file in some way, directly or through decision logic or code. This tool leaves compression and a certain amount of tree shaking to other tools.
|
|
82
|
+
|
|
83
|
+
## Basic Use Process
|
|
84
|
+
|
|
85
|
+
***Here are steps of a generation process for site maintainers***:
|
|
86
|
+
|
|
87
|
+
1. Store commonly used, well-tested code in files in selected directories
|
|
88
|
+
2. Provide a collection of files each describing families of pages called *skeletons*
|
|
89
|
+
3. Provide a JSON description, the configuration, that selects which skeleton parts are to be used along with source directories
|
|
90
|
+
4. Run **roll-right** in the *prepare* phase with the JSON configuration to generate intermediate compilation files and *prepare* databases of sections for each output.
|
|
91
|
+
5. Decide on further template customization (or select defaults) by editing component descriptions from the *prepare* phase.
|
|
92
|
+
6. For each concern, provide static html components, pictures, etc. to be used to populate templates; keep them in directories per website, app, etc. (usually a ***static*** directory within the concern's directory )
|
|
93
|
+
7. Run the *template* phase to generate `.tmplt` files, one for each output page/file being generated. This also generates `.subst` files.
|
|
94
|
+
8. Edit `.subst` files for each file being output (or possibly one master `.subst` file per concern) in order to specify content.
|
|
95
|
+
9. Run **roll-right** in the *page* phase with `.subst` files specifying the template instantiation values.
|
|
96
|
+
10. Use other tools to deploy files that have been dropped into a pre-staging directory.
|
|
97
|
+
|
|
98
|
+
It is possible that command line call of the tool can be done once if the user is willing to accept defaults and to have all the resource directories ready. Generally, however, the command line tool will be called once for each phase for each initial configuration file.
|
|
99
|
+
|
|
100
|
+
## HTML Generation Steps
|
|
101
|
+
|
|
102
|
+
1. For generation of HTML, a project should begin first with a skeleton The developer will either make one of these, or use one from a repository of them. The skeleton will not contain HTML. If it being used to generate HTML, the skeleton may lines indicating that HTML tags should be included at certain points. Between those tags it may have lines indicating the import of partial template files which may include HTML markup as well as substitution variable forms.
|
|
103
|
+
2. The developer needs to make a configuration file. **roll-right** reads configuration file, enabling **roll-right** to find the pre-template and the set of files that will be use to replace **link forms**. The configuration file has its own set of variables. It contains a set of directory abbreviations, some global variable assignments, and a list of output groups. Each output group indicates the targets that should be generated and the skeletons that should be used to generate the outputs for a set of concerns indicated within the output group structure.
|
|
104
|
+
3. **roll-right** compiles the skeletons given the variable assignments in the configuration file. The parsing output will be stored in the sources directory. The parsing output will include intermediate parsing information for every skeleton in use for a run. A number of section database file, called `calc_<something>.db`will be generated, one for each output file being generated. The `calc_<something>.db`file may be edited by the user. It is called "calc" because it may either make a link reference to a file in a static directory belonging to a concern, or it may be a calculation. In some cases, the calc file indicates how to make replications of a section which is again a calculation used in skeleton processing.
|
|
105
|
+
4. **roll-right** reads the parsing information and the edited `calc_<something>.db`files and generates template files. roll-right places the template files for a concern in a template directory. It also places files containing maps of substitution variables to values, one for each template being generated. It also produces a master substitution map for the entire website belonging to each concern.
|
|
106
|
+
5. During the template phase **roll-right** attempts to merge previously determined substitutions in with the new substitution maps being generated. It might be the case that the site maintainer does not have to change any values in the substitution maps, but he may. In either case, **roll-right** will read in the templates and the substitution maps and used them to generate complete HTML files. The HTML files will be deposited in the pre-staging directories for each concern.
|
|
107
|
+
|
|
108
|
+
## An example
|
|
109
|
+
|
|
110
|
+
Here is a full skeleton for a kind of page that may be used by a concern.
|
|
67
111
|
|
|
68
112
|
```
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
113
|
+
$$defs:{
|
|
114
|
+
"top_level" : true,
|
|
115
|
+
"path_abreviations" : {
|
|
116
|
+
"[alpha-copious]" : "[github]/alphas/alpha-copious",
|
|
117
|
+
"[github]" : "~/GitHub",
|
|
118
|
+
"[websites]" : "[alphas]/websites"
|
|
119
|
+
},
|
|
120
|
+
"ext_default_dir" : {
|
|
121
|
+
"tmplt" : "[alpha-copious]/html",
|
|
122
|
+
"js" : "[alpha-copious]/client",
|
|
123
|
+
"svg" : "[alpha-copious]/icons",
|
|
124
|
+
"css" : "[alpha-copious]/css"
|
|
125
|
+
},
|
|
126
|
+
"top_dir_location" : {
|
|
127
|
+
"script" : "[alpha-copious]/client",
|
|
128
|
+
"for-humans" : "[alpha-copious]/for-humans",
|
|
129
|
+
"files" : "[alpha-copious]/html"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// ----
|
|
133
|
+
$$html:start_doc_head<<
|
|
134
|
+
$$files::header.tmplt<<
|
|
135
|
+
$$html:end_head<<
|
|
136
|
+
|
|
137
|
+
$$html:start_style<<
|
|
138
|
+
$$css::styles1.css<<
|
|
139
|
+
$$html:end_style<<
|
|
140
|
+
|
|
141
|
+
$$html:start_script<<
|
|
142
|
+
$$files<js>::top_vars<<
|
|
143
|
+
$$html:end_script<<
|
|
144
|
+
|
|
145
|
+
$$html:start_body<<
|
|
146
|
+
|
|
147
|
+
$$files::params::nav_bar_V.smplt<< {
|
|
148
|
+
$@{lr_div}$files::params::left-right-div.smplt<< {
|
|
149
|
+
$@{logo}$files::logo.tmplt<<
|
|
150
|
+
$@{spacer}$files::spacer.tmplt<<
|
|
151
|
+
$@{menu}$files::shroom.tmplt<<{
|
|
152
|
+
$@{mushroom}$icons::mushroom-menu-icon.svg<<
|
|
103
153
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
$$script::pc_location.js<<
|
|
145
|
-
$$script::crypto-global.js<<
|
|
146
|
-
$$script::base64.js<<
|
|
147
|
-
$$script::crypto-hash.js<<
|
|
148
|
-
$$script::crypto-wraps.js<<
|
|
154
|
+
}
|
|
155
|
+
$@{logout}$files::logout.tmplt<<
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
$$files::flexy_items_A-main.tmplt<<
|
|
159
|
+
|
|
160
|
+
$$files::footer_A.tmplt<<
|
|
161
|
+
|
|
162
|
+
$$verbatim::{
|
|
163
|
+
<!-- start dynamic content -->
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
$$files::squashable_menu_A.tmplt<<
|
|
167
|
+
|
|
168
|
+
$$files::calc::contact_box<<${box_i=100}
|
|
169
|
+
|
|
170
|
+
$$files::calc::about_box<<${box_i++}
|
|
171
|
+
|
|
172
|
+
$$files::calc::thankyou_box<<${box_i++}
|
|
173
|
+
|
|
174
|
+
$$files::loop::calc::topicBox_<1,3><<${box_i++}
|
|
175
|
+
|
|
176
|
+
$$files::calc::register<<${box_i++}
|
|
177
|
+
|
|
178
|
+
$$files::calc::login<<${box_i++}
|
|
179
|
+
|
|
180
|
+
$$files::intergalactic-explain.tmplt<<
|
|
181
|
+
|
|
182
|
+
$$template::{
|
|
183
|
+
{{{advertPopups.content}}}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
$$html:end_body_html<<
|
|
187
|
+
//
|
|
188
|
+
//
|
|
189
|
+
$$html:start_script<<
|
|
190
|
+
|
|
191
|
+
// global defs of some static topology
|
|
192
|
+
$$script::[alt-script]/flexy_items_A-top.js<<
|
|
193
|
+
|
|
149
194
|
$$script::common.js<<
|
|
195
|
+
|
|
196
|
+
$$script::field_checks.js<<
|
|
197
|
+
|
|
150
198
|
$$script::https_checks.js<<
|
|
199
|
+
|
|
151
200
|
$$script::post_fetch.js<<
|
|
152
|
-
|
|
201
|
+
|
|
202
|
+
$$script::uploader_class.js<<
|
|
203
|
+
|
|
204
|
+
$$script::validation_class.js<<
|
|
205
|
+
|
|
206
|
+
$$script::captcha_service.js<<
|
|
207
|
+
//
|
|
208
|
+
$$script::login-logout.js<<
|
|
209
|
+
|
|
153
210
|
$$script::one_table_db.js<<
|
|
154
|
-
$$script::app-dir/user_db.js<<
|
|
155
|
-
$$script::for-humans/shared_constants.js<<
|
|
156
|
-
$$script::for-humans/human_frame_client.js<<
|
|
157
|
-
$$script::for-humans/frame_page_tab_com.js<<
|
|
158
|
-
$$script::app-dir/window_app.js<<
|
|
159
211
|
|
|
160
|
-
|
|
212
|
+
$$script::file_ops.js<<
|
|
161
213
|
|
|
162
|
-
|
|
214
|
+
$$script::[alt-script]/flexy_items_A-layout-and-menu.js<<
|
|
215
|
+
|
|
216
|
+
$$script::[alt-script]/flexy_items_A-animation.js<<
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
// CAPTCHA PERFORMANT
|
|
220
|
+
|
|
221
|
+
$$script::captcha_app.js<<
|
|
222
|
+
|
|
223
|
+
$$verbatim::{
|
|
224
|
+
// === --------------------------------------- === --------------------------------------- === --------------------------------------
|
|
225
|
+
// APPLICATIONS
|
|
226
|
+
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
$$script::[for-humans]/shared_constants.js<<
|
|
230
|
+
|
|
231
|
+
$$script::[for-humans]/msg_vars.js<<
|
|
232
|
+
|
|
233
|
+
$$script::[for-humans]/external-id-intake.js<<
|
|
163
234
|
|
|
235
|
+
$$script::[for-humans]/human_frame_client.js<<
|
|
164
236
|
|
|
165
|
-
|
|
166
|
-
are in the script section. This project does no use more HTML than provided in the file.
|
|
237
|
+
$$script::[for-humans]/frame_page_opener.js<<
|
|
167
238
|
|
|
168
|
-
|
|
239
|
+
$$script::[for-humans]/site_page_tab_com.js<<
|
|
169
240
|
|
|
170
|
-
|
|
241
|
+
$$script::user_db.js<<
|
|
242
|
+
|
|
243
|
+
$$script::[app<scripts>]/site_app.js<<
|
|
244
|
+
|
|
245
|
+
$$script::[alt-script]/flexy_items_A-app-finalize.js<<
|
|
246
|
+
|
|
247
|
+
$$html:end_script<<
|
|
171
248
|
|
|
172
249
|
```
|
|
173
|
-
{
|
|
174
|
-
"alpha" : {
|
|
175
|
-
"pre_template" : "[alpha-copious]/pre-template/human_page.html",
|
|
176
|
-
"business_url" : "copious.world",
|
|
177
|
-
"out_dir" : "./templates",
|
|
178
|
-
"key_values" : {
|
|
179
|
-
"$$AUTHOR" : "Richard Leddy",
|
|
180
|
-
"INSERT" : ""
|
|
181
|
-
},
|
|
182
|
-
"path_abreviations" : {
|
|
183
|
-
"[alpha-copious]" : "[github]/alphas/alpha-copious",
|
|
184
|
-
"[github]" : "~/Documents/GitHub",
|
|
185
|
-
"[app-local]" : "[github]/alphas/of-this-world"
|
|
186
250
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
"
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
"for-humans/shared_constants.js" : 1,
|
|
234
|
-
"app-dir/window_app.js" : 2
|
|
235
|
-
}
|
|
236
|
-
}
|
|
251
|
+
**roll-right** can work on this skeleton, but by using some tools pull out files that an be in bundles or linked, **roll-right** can work on a smaller file. Here is the file transformed after the use of some tools that pre-process the skeletons.
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
$$defs:{
|
|
255
|
+
"top_level" : true,
|
|
256
|
+
"path_abreviations" : {
|
|
257
|
+
"[alpha-copious]" : "[github]/alphas/alpha-copious",
|
|
258
|
+
"[github]" : "~/GitHub",
|
|
259
|
+
"[websites]" : "[alphas]/websites"
|
|
260
|
+
},
|
|
261
|
+
"ext_default_dir" : {
|
|
262
|
+
"tmplt" : "[alpha-copious]/html",
|
|
263
|
+
"js" : "[alpha-copious]/client",
|
|
264
|
+
"svg" : "[alpha-copious]/icons",
|
|
265
|
+
"css" : "[alpha-copious]/css"
|
|
266
|
+
},
|
|
267
|
+
"top_dir_location" : {
|
|
268
|
+
"script" : "[alpha-copious]/client",
|
|
269
|
+
"for-humans" : "[alpha-copious]/for-humans",
|
|
270
|
+
"files" : "[alpha-copious]/html"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// ----
|
|
274
|
+
$$html:start_doc_head<<
|
|
275
|
+
$$files::header.tmplt<<
|
|
276
|
+
$$bundle::bundle_13.js
|
|
277
|
+
$$bundle::web3-mixed-boxy_bundle.js
|
|
278
|
+
$$link<css>::shared_styles.css<<
|
|
279
|
+
$$html:end_head<<
|
|
280
|
+
|
|
281
|
+
$$html:start_style<<
|
|
282
|
+
$$css::quick_view.css<<
|
|
283
|
+
$$html:end_style<<
|
|
284
|
+
|
|
285
|
+
$$html:start_script<<
|
|
286
|
+
$$files<js>::top_vars<<
|
|
287
|
+
$$html:end_script<<
|
|
288
|
+
|
|
289
|
+
$$html:start_body<<
|
|
290
|
+
|
|
291
|
+
$$files::params::nav_bar_V.smplt<< {
|
|
292
|
+
$@{lr_div}$files::params::left-right-div.smplt<< {
|
|
293
|
+
$@{logo}$files::logo.tmplt<<
|
|
294
|
+
$@{spacer}$files::spacer.tmplt<<
|
|
295
|
+
$@{menu}$files::shroom.tmplt<<{
|
|
296
|
+
$@{mushroom}$icons::mushroom-menu-icon.svg<<
|
|
237
297
|
}
|
|
238
298
|
}
|
|
299
|
+
$@{logout}$files::logout.tmplt<<
|
|
239
300
|
}
|
|
240
301
|
|
|
241
|
-
|
|
302
|
+
$$files::flexy_items_A-main.tmplt<<
|
|
242
303
|
|
|
243
|
-
|
|
304
|
+
$$files::footer_A.tmplt<<
|
|
244
305
|
|
|
245
|
-
|
|
306
|
+
$$verbatim::{
|
|
307
|
+
<!-- start dynamic content -->
|
|
308
|
+
}
|
|
246
309
|
|
|
247
|
-
|
|
310
|
+
$$files::squashable_menu_A.tmplt<<
|
|
248
311
|
|
|
249
|
-
|
|
312
|
+
$$files::calc::contact_box<<${box_i=100}
|
|
250
313
|
|
|
251
|
-
|
|
314
|
+
$$files::calc::about_box<<${box_i++}
|
|
252
315
|
|
|
253
|
-
|
|
254
|
-
"post_fetch.js" : {
|
|
255
|
-
"order" : 14,
|
|
256
|
-
"include" : ["postData"],
|
|
257
|
-
"exclude" : false
|
|
258
|
-
},
|
|
259
|
-
```
|
|
316
|
+
$$files::calc::thankyou_box<<${box_i++}
|
|
260
317
|
|
|
261
|
-
|
|
318
|
+
$$files::loop::calc::topicBox_<1,3><<${box_i++}
|
|
262
319
|
|
|
263
|
-
|
|
320
|
+
$$files::calc::register<<${box_i++}
|
|
264
321
|
|
|
265
|
-
|
|
266
|
-
"for-humans" : "[alpha-copious]/for-humans",
|
|
267
|
-
```
|
|
322
|
+
$$files::calc::login<<${box_i++}
|
|
268
323
|
|
|
269
|
-
|
|
324
|
+
$$files::intergalactic-explain.tmplt<<
|
|
270
325
|
|
|
326
|
+
$$template::{
|
|
327
|
+
{{{advertPopups.content}}}
|
|
328
|
+
}
|
|
271
329
|
|
|
272
|
-
|
|
330
|
+
$$html:end_body_html<<
|
|
331
|
+
//
|
|
332
|
+
//
|
|
333
|
+
$$html:start_script<<
|
|
273
334
|
|
|
274
|
-
|
|
275
|
-
$$
|
|
276
|
-
```
|
|
335
|
+
// global defs of some static topology
|
|
336
|
+
$$script::[alt-script]/flexy_items_A-top.js<<
|
|
277
337
|
|
|
278
|
-
|
|
338
|
+
//
|
|
279
339
|
|
|
280
|
-
|
|
340
|
+
$$script::[alt-script]/flexy_items_A-layout-and-menu.js<<
|
|
281
341
|
|
|
282
|
-
|
|
342
|
+
$$script::[alt-script]/flexy_items_A-animation.js<<
|
|
343
|
+
// CAPTCHA PERFORMANT
|
|
344
|
+
$$verbatim::{
|
|
345
|
+
// === --------------------------------------- === --------------------------------------- === --------------------------------------
|
|
346
|
+
// APPLICATIONS
|
|
347
|
+
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
|
348
|
+
}
|
|
349
|
+
$$script::[app<scripts>]/site_app.js<<
|
|
283
350
|
|
|
284
|
-
|
|
351
|
+
$$script::[alt-script]/flexy_items_A-app-finalize.js<<
|
|
285
352
|
|
|
286
|
-
|
|
353
|
+
$$html:end_script<<
|
|
287
354
|
|
|
288
|
-
|
|
355
|
+
```
|
|
289
356
|
|
|
290
|
-
|
|
357
|
+
The tools that make this change are not part of roll-right. But, roll-right does pay attention to the bundling statements:
|
|
291
358
|
|
|
292
|
-
|
|
359
|
+
```
|
|
360
|
+
$$bundle::bundle_13.js
|
|
361
|
+
$$bundle::web3-mixed-boxy_bundle.js
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
Also, there is a CSS link, whereas before the file was included. In the first version of the skeleton, roll-right would have included the CSS in the output file. In the edited version, a link to the file will be included in the HTML header.
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
$$link<css>::shared_styles.css<<
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
## configuration
|
|
293
373
|
|
|
294
|
-
|
|
374
|
+
The configuration for the first phase is used to pick a general structure by picking skeletons for concerns. The configuration will specify a common source for the files providing skeletal forms for all the concerns listed in that particular configuration. One configuration may specify a number of skeleton uses and output specializations for a number of concerns. Different configurations can be used all the same for collecting outputs into other targeted directories.
|
|
295
375
|
|
|
296
|
-
|
|
376
|
+
```
|
|
377
|
+
{
|
|
378
|
+
"@target" : "templates/",
|
|
379
|
+
"inputs" : {
|
|
380
|
+
"path_abreviations" : {
|
|
381
|
+
"[websites]" : "[alphas]/websites",
|
|
382
|
+
"[PWA]" : "[alphas]/PWA-apps",
|
|
383
|
+
"[alphas]" : "[github]/alphas",
|
|
384
|
+
"[alpha-copious]" : "[alphas]/alpha-copious",
|
|
385
|
+
"[github]" : "~/GitHub/",
|
|
386
|
+
"[skeletons]" : "[alpha-copious]/pre-template",
|
|
387
|
+
"[names]" : "[alpha-copious]/name-drops",
|
|
388
|
+
"[PWA-lib]" : "[PWA]/lib",
|
|
389
|
+
"[PWA-skeletons]" : "[PWA]/pre-template",
|
|
390
|
+
"[client]" : "[alpha-copious]/client",
|
|
391
|
+
"[template-configs]" : "[websites]/template-configs"
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"ext_default_dirs" : {
|
|
395
|
+
"tmplt" : "[alpha-copious]/html",
|
|
396
|
+
"js" : "[alpha-copious]/client",
|
|
397
|
+
"svg" : "[alpha-copious]/icons"
|
|
398
|
+
},
|
|
399
|
+
"top_dir_locations" : {
|
|
400
|
+
"script" : "[client]",
|
|
401
|
+
"client" : "[client]",
|
|
402
|
+
"pwa-lib" : "[PWA-lib]",
|
|
403
|
+
"databases" : "[alpha-copious]/databases",
|
|
404
|
+
"alt-script" : "[alpha-copious]/script",
|
|
405
|
+
"for-humans" : "[alpha-copious]/for-humans",
|
|
406
|
+
"html" : "[alpha-copious]/html",
|
|
407
|
+
"css" : "[alpha-copious]/css",
|
|
408
|
+
"icons" : "[alpha-copious]/icons",
|
|
409
|
+
"names" : "[alpha-copious]/name-drops"
|
|
410
|
+
},
|
|
411
|
+
"use_case<[targets.dir]>" : {
|
|
412
|
+
"app<scripts>" : "[targets.dir]",
|
|
413
|
+
"app<static>" : "[targets.dir]",
|
|
414
|
+
"app<images>" : "[targets.dir]"
|
|
415
|
+
},
|
|
416
|
+
"app_skel_vars" : {
|
|
417
|
+
"boxy" : {
|
|
418
|
+
"topic_count" : 3
|
|
419
|
+
},
|
|
420
|
+
"mixed" : {
|
|
421
|
+
"topic_count" : 3,
|
|
422
|
+
"groups" : [
|
|
423
|
+
{ "group_name" : "docs", "SOURCE-LINK" : "{{{shop_docs}}}", "FRAME-ACTIONS" : "onclick=''" },
|
|
424
|
+
{ "group_name" : "blog", "SOURCE-LINK" : "{{{shop_blog}}}", "FRAME-ACTIONS" : "onclick=''" },
|
|
425
|
+
{ "group_name" : "search", "SOURCE-LINK" : "{{{shop_search}}}", "FRAME-ACTIONS" : "onclick=''" }
|
|
426
|
+
]
|
|
427
|
+
},
|
|
428
|
+
"shops" : {
|
|
429
|
+
"topic_count" : 3,
|
|
430
|
+
"groups" : [
|
|
431
|
+
{ "group_name" : "docs", "SOURCE-LINK" : "{{{shop_docs}}}", "FRAME-ACTIONS" : "onclick=''" },
|
|
432
|
+
{ "group_name" : "blog", "SOURCE-LINK" : "{{{shop_blog}}}", "FRAME-ACTIONS" : "onclick=''" },
|
|
433
|
+
{ "group_name" : "search", "SOURCE-LINK" : "{{{shop_search}}}", "FRAME-ACTIONS" : "onclick=''" }
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"global_variable_values" : {
|
|
438
|
+
"var_to_value" : {
|
|
439
|
+
"AUTHOR" : "R. Leddy"
|
|
440
|
+
},
|
|
441
|
+
"by_concern" : {
|
|
442
|
+
"copious" : {},
|
|
443
|
+
"popsong" : {},
|
|
444
|
+
"villa-family" : {},
|
|
445
|
+
"bakersfield-robots": {},
|
|
446
|
+
"docs.copious.world": {},
|
|
447
|
+
"shops.copious.world": {},
|
|
448
|
+
"shops.for-humans.net": {}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"outputs" : [
|
|
452
|
+
{
|
|
453
|
+
"targets" : {
|
|
454
|
+
"dir" : "[websites]/@concern/@kernel",
|
|
455
|
+
"dir_form" : "[websites]/@concern/@target",
|
|
456
|
+
"concerns" : ["copious","popsong","villa-family"],
|
|
457
|
+
"uses_config_vars" : "boxy"
|
|
458
|
+
|
|
459
|
+
},
|
|
460
|
+
"skeletons" : {
|
|
461
|
+
"index.tmplt" : "[skeletons]/web3-boxy.skel",
|
|
462
|
+
"login.tmplt" : "[skeletons]/login-boxy.skel",
|
|
463
|
+
"blog/index.tmplt" : "[skeletons]/galactic-blog.skel",
|
|
464
|
+
"demos/index.tmplt" : "[skeletons]/galactic-blog.skel",
|
|
465
|
+
"streams/index.tmplt" : "[skeletons]/galactic-blog.skel"
|
|
466
|
+
},
|
|
467
|
+
"name_parameters" : {
|
|
468
|
+
"db" : "[names]/name-drop.db",
|
|
469
|
+
"parameter_values" : "[websites]/@concern/@target/name-drop.json",
|
|
470
|
+
"index.tmplt" : [ "contact_box", "about_box", "topicBox_<1,3>", "thankyou_box", "register" ],
|
|
471
|
+
"login.tmplt" : [ "contact_box", "thankyou_box", "login" ]
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"targets" : {
|
|
476
|
+
"dir" : "[websites]/@concern/@kernel",
|
|
477
|
+
"dir_form" : "[websites]/@concern/@target",
|
|
478
|
+
"concerns" : ["bakersfield-robots","docs.copious.world"],
|
|
479
|
+
"uses_config_vars" : "mixed"
|
|
480
|
+
},
|
|
481
|
+
"skeletons" : {
|
|
482
|
+
"index.tmplt" : "[skeletons]/web3-mixed-boxy.skel",
|
|
483
|
+
"login.tmplt" : "[skeletons]/login-boxy.skel",
|
|
484
|
+
"blog/index.tmplt" : "[skeletons]/galactic-blog.skel",
|
|
485
|
+
"demos/index.tmplt" : "[skeletons]/galactic-blog.skel"
|
|
486
|
+
},
|
|
487
|
+
"name_parameters" : {
|
|
488
|
+
"db" : "[names]/name-drop.db",
|
|
489
|
+
"parameter_values" : "[websites]/@concern/@target/name-drop.json",
|
|
490
|
+
"index.tmplt" : [ "contact_box", "about_box", "topicBox_<1,3>", "thankyou_box", "register" ],
|
|
491
|
+
"login.tmplt" : [ "contact_box", "thankyou_box", "login" ]
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"targets" : {
|
|
496
|
+
"dir" : "[websites]/@concern/@kernel",
|
|
497
|
+
"dir_form" : "[websites]/@concern/@target",
|
|
498
|
+
"concerns" : ["of-this.world","for-humans.net"]
|
|
499
|
+
},
|
|
500
|
+
"skeletons" : {
|
|
501
|
+
"index.tmplt" : "[skeletons]/galactic.skel"
|
|
502
|
+
},
|
|
503
|
+
"name_parameters" : {
|
|
504
|
+
"db" : "[names]/name-drop.db",
|
|
505
|
+
"parameter_values" : "[websites]/@concern/@target/name-drop.json",
|
|
506
|
+
"index.tmplt" : [ "contact_box", "about_box", "topicBox_<1,3>", "thankyou_box", "register" ],
|
|
507
|
+
"login.tmplt" : [ "contact_box", "thankyou_box", "login" ]
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"targets" : {
|
|
512
|
+
"dir" : "[websites]/@concern/@kernel",
|
|
513
|
+
"dir_form" : "[websites]/@concern/@target",
|
|
514
|
+
"concerns" : ["shops.copious.world","shops.for-humans.net"],
|
|
515
|
+
"uses_config_vars" : "shops"
|
|
516
|
+
},
|
|
517
|
+
"skeletons" : {
|
|
518
|
+
"index.tmplt" : "[skeletons]/shop-kiosk.skel"
|
|
519
|
+
},
|
|
520
|
+
"name_parameters" : {
|
|
521
|
+
"db" : "[names]/name-drop.db",
|
|
522
|
+
"parameter_values" : "[websites]/@concern/@target/name-drop.json",
|
|
523
|
+
"index.tmplt" : [ "contact_box", "about_box", "topicBox_<1,3>", "thankyou_box", "register" ],
|
|
524
|
+
"login.tmplt" : [ "contact_box", "thankyou_box", "login" ]
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"targets" : {
|
|
529
|
+
"dir" : "[PWA]/@concern/@kernel",
|
|
530
|
+
"dir_form" : "[PWA]/@concern/@target",
|
|
531
|
+
"concerns" : ["safe-recorder"]
|
|
532
|
+
},
|
|
533
|
+
"skeletons" : {
|
|
534
|
+
"index.tmplt" : "[skeletons]/PWA.skel",
|
|
535
|
+
"recorder-PWA.tmplt" : "[PWA-skeletons]/recorder-PWA.skel",
|
|
536
|
+
"ownership.tmplt" : "[PWA-skeletons]/ownership.skel"
|
|
537
|
+
},
|
|
538
|
+
"name_parameters" : {
|
|
539
|
+
"db" : "[names]/name-drop.db"
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
]
|
|
543
|
+
}
|
|
297
544
|
|
|
298
545
|
|
|
299
|
-
|
|
546
|
+
```
|
|
300
547
|
|
|
301
|
-
First install the command line version of roll-right.
|
|
302
548
|
|
|
303
549
|
|
|
550
|
+
## How it Helps
|
|
304
551
|
|
|
552
|
+
Once the snippets, sub templates, skeletons, and code modules are in place, this tool generates entire sites with a carriage return. The project [copious-software-dev-manager](https://github.com/copious-world/copious-software-dev-manager.git) can call this tool. The software dev manager is web app that helps prepare the skeletons, fill out substitution maps, and finally release the software, doing some bundle management. This is all a work in progress.
|
|
305
553
|
|