roll-right 0.1.4 → 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 CHANGED
@@ -1,305 +1,553 @@
1
1
  # roll-right
2
2
 
3
- A command line tool that gathers selected code components from curated bases of code and that, first, fans them into templates for site pages and that, second, populates templates with static site-specific code in order to generate static pages for sites.
3
+ ***A tool that helps generate HTML pages, or other types of pages such as PWA components.***
4
4
 
5
- ***Here are steps of a generation process for site maintainers***:
5
+ ## Overview
6
6
 
7
- 1. store commonly used, well-tested code in files in selected directories
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
- The generation process is not limited to coalescing code for pages. There is support for generating node.js modules, generating web page modules, etc. for npm publication.
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
- ## install it
11
+ ### install it
18
12
 
19
13
  ```
20
14
  npm install -g roll-right
21
15
  ```
22
16
 
17
+ ### run it
23
18
 
24
- ## run it
19
+ <b>Here is an example:</b>
25
20
 
26
21
  ```
27
- roll-right --phase 1 <website-identifier> <directory including config>
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 2 <website-identifier> <directory including config>
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
- ## reverse it
35
+ ### purpose
38
36
 
39
- It can help, when developing, to split up a file that has been composed by **roll-right**. Later versions of **roll-right** will put in file separators when files are appended together to form a single file artifact for a web page or module. The command line tool, **roll-right-breakup**, will output a directory of all the files between the separators. There are times that it may be useful to use compare tools with the output of **roll-right-breakup** and the source files.
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
- Here is how to call it:
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
- **roll-right-breakup** will create a directory in the calling directory named **rr-breakup** or within the optional directory if it is on the command line.
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
- ## HTML Generation Steps
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. For generation of HTML, a project should begin first with a pre-template. The developer will either make one of these, or use one from a repository of them. A pre-template contains some HTML, usually the header; and, the header may **variable forms** in it. The ouline of the body may be available. But, somewhere in the pre-template will be **link forms** that indicate where files may be included. **May be included**... The pre-template usually lists more files than a project may want. But, the next step,
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
- ## An example - human page
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
- In order to generate the template, a pre-template is required. Here is the pre-template for the human page (some code is removed for the sake of brevity):
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
- <!doctype html>
70
- <html>
71
- <head>
72
- <meta charset="utf-8">
73
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
74
- <meta name="author" content="{{who_am_I}}" />
75
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
76
- <meta id="theme-color" name="theme-color" content="{{user-theme-color}}">
77
-
78
- <link rel="canonical" href="{{canonical}}">
79
-
80
- <title>{{who_am_I}}</title>
81
- <meta name="description" content="{{pageDescription}}">
82
- <style>
83
- /*csslint important:false*/
84
- .super-header {
85
- border: solid 1px rgb(223, 89, 11);
86
- padding: 2px;
87
- font-size: smaller;
88
- font-weight: 700;
89
- background-color: rgb(255, 254, 248);
90
- color: rgb(74, 83, 55);
91
- max-height:32px;
92
- width: 100%;
93
- }
94
- .content-container {
95
- border: solid 1px rgb(0, 6, 85);
96
- padding: 2px;
97
- padding-left: 1px;
98
- background-color: white;
99
- position: absolute;
100
- top: 34px;
101
- bottom: 0;
102
- width : calc(100vw - 4px);
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
- ... etc ...
106
- </style>
107
- </head>
108
- <body>
109
- <div id="super-header" class="super-header" style="white-space: nowrap;overflow-x: scroll;" >
110
- <span class="owner_name">{{who_am_I}}</span>
111
- <div id="open-controls" style="display:inline-block;">
112
- <button onclick="show_controls()">&gt;&gt;</button>
113
- </div>
114
- <div id="user-controls" style="display:none;">
115
- :: control page ::
116
- <button id="db_container-btn" onclick="show_local_data()">local data</button>&nbsp;
117
- <button id="manager_container-btn" onclick="show_id_manager()">identity manager</button>&nbsp;
118
- <button id="wallet_container-btn" onclick="show_wallet_manager()">wallet manager</button>&nbsp;
119
- <button id="application_container-btn" onclick="show_application()" class="selected-frame">application</button>
120
- <button onclick="hide_controls()">&lt;&lt;</button>
121
- </div>
122
- </div>
123
-
124
- <div id="application_container" class="content-container" >
125
- <iframe id="content-frame" src="" class="super-container" >
126
- Source will open here
127
- </iframe>
128
- </div>
129
-
130
- <div id="manager_container" class="content-container" >
131
- <iframe id="id-manager-frame" src="https://www.of-this.world/manager" class="super-container" onload="info_to_manager_container()">
132
- manager frame
133
- </iframe>
134
- </div>
135
-
136
-
137
- <!-- ... ETC. ... -->
138
-
139
- </div>
140
-
141
- </body>
142
- <script>
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
- $$script::file_ops.js<<
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
- </script>
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
- In the above code, one can see the **variable forms** such as `{{canonical}}`, while for this project all the **link forms**
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
- But, it does bring in scripts. It does not necessarily bring in all the scripts or even all of each script. The *alpha* field of a configuration object determines how much of the listed scripts to include.
239
+ $$script::[for-humans]/site_page_tab_com.js<<
169
240
 
170
- Here is a configuration file for the human frame.
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
- "ext_default_dir" : {
189
- ".html" : "[alpha-copious]/html",
190
- ".js" : "[alpha-copious]/client",
191
- ".svg" : "[alpha-copious]/icons"
192
- },
193
- "top_dir_location" : {
194
- "script" : "[alpha-copious]/script",
195
- "for-humans" : "[alpha-copious]/for-humans",
196
- "html" : "[alpha-copious]/html",
197
- "app-dir" : "[app-local]/scripts"
198
- },
199
- "files" : {
200
- "index.html" : {
201
- "footer_A.html" : 6,
202
- "name::about_box" : {
203
- "file" : "fadable_box.html",
204
- "key_values" : {
205
- "Z_INDEX" : 102,
206
- "BOX_NAME" : ">name"
207
- }
208
- },
209
- "intergalactic-explain.html" : "1",
210
- "script" : {
211
- "pc_location.js" : 1,
212
- "crypto-global.js" : 1,
213
- "base64.js" : 1,
214
- "crypto-wraps.js" : 1,
215
- "crypto-hash.js" : 1,
216
- "common.js" : 2,
217
- "field_checks.js" : 3,
218
- "https_checks.js" : 4,
219
- "post_fetch.js" : {
220
- "order" : 14,
221
- "include" : ["postData"],
222
- "exclude" : false
223
- },
224
- "uploader_class.js" : 6,
225
- "file_ops.js" : 1,
226
- "one_table_db.js" : 1,
227
- "script/flexy_items_A-animation.js" : 12,
228
- "for-humans/human_frame_client.js" : 1,
229
- "for-humans/external-id-intake.js" : 13,
230
- "for-humans/frame_page_opener.js" : 1,
231
- "for-humans/frame_page_tab_com.js" : 1,
232
- "app-dir/user_db.js" : 2,
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
- This project only makes a template and leaves a later process to fill it out. So, there is no **beta** field. But, there is an **alpha** field.
304
+ $$files::footer_A.tmplt<<
244
305
 
245
- Notice that the **alpha** field begins with the field **pre_template**. That is the file above. Look at the **[alpha-copious]** form in the directory path. This is a path abbreviation. The path form substitution rules are listed in the **alpha** object under the fields **path_abreviations** and **top_dir_location**. The expand bottom up.
306
+ $$verbatim::{
307
+ <!-- start dynamic content -->
308
+ }
246
309
 
247
- Under the **files** field, are fields whose keys are the names of files being generated. This configuration will generate **index.html**. Some HTML files are lists under **index.html**. But, these files are not mentioned in the pre-template being used, so they will be ignored. This example is only concerned with the inclusion of JavaScript.
310
+ $$files::squashable_menu_A.tmplt<<
248
311
 
249
- In the `<script>` section, all the files that might go into the pre-template are given. There are a few that won't be used by the pre-template. In general, the file has to be listed by both the pre-template and the configuration to be included. The only assurance is that file depencies are included. So, a file that is not listed in either the pre-template or the configuration but that a file being included requires to operate, that file will be included as well.
312
+ $$files::calc::contact_box<<${box_i=100}
250
313
 
251
- Notice the **post_fetch** inclusion:
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
- This inclusion shows just one function, **postData**, being included in the project. The source of post_fetch lists the set of functions it exports. And, the "post_fetch.js" field value is a selector of the method. Other methods will not be included from the file unless there are dependencies.
318
+ $$files::loop::calc::topicBox_<1,3><<${box_i++}
262
319
 
263
- Some of the files listed in the field names are file paths. For example, `for-humans/human_frame_client.js` seems to indicate that a directory "for-humans" will be used. But, in fact, the directory is defined by the top-dir fields and the abbreviations as such:
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
- This form is expanded further until an absolute path is determined.
324
+ $$files::intergalactic-explain.tmplt<<
270
325
 
326
+ $$template::{
327
+ {{{advertPopups.content}}}
328
+ }
271
329
 
272
- This example did not use the file form. Here is an example of that:
330
+ $$html:end_body_html<<
331
+ //
332
+ //
333
+ $$html:start_script<<
273
334
 
274
- ```
275
- $$files::nav_bar_A.html<<
276
- ```
335
+ // global defs of some static topology
336
+ $$script::[alt-script]/flexy_items_A-top.js<<
277
337
 
278
- The file version of the **link form** uses the **ext_default_dir** field to establish the location of the file based on the extension. In the file form example, **roll-right** will look for `nav_bar_A.html` in the directory `[alpha-copious]/html` once the path variable `[alpha-copious]` is expanded.
338
+ //
279
339
 
280
- ## How it Helps
340
+ $$script::[alt-script]/flexy_items_A-layout-and-menu.js<<
281
341
 
282
- This tool is not a replacement for final publication steps enabled by rollup, browserify, or others. Instead, this stool may generate code that will be sumbitted to those tools.
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
- In fact, whole pages needing no further manipulation may be generated by this tool. So, in some cases this tool does the job that others do. However, some build systems use the other tools to generate their final runtime products. And, this tool may be upstream from those tools.
351
+ $$script::[alt-script]/flexy_items_A-app-finalize.js<<
285
352
 
286
- In particular, this tool addresses moving preexisting code into certain packaged contexts at the source level. Other packages rollup modules into single code sets or module collections into one file.
353
+ $$html:end_script<<
287
354
 
288
- This tool can be used to replicate code into projects, allowing for function by function selection. The final output will be a combined source file with a chain of support for working code. That is, a developer may request that a whole module be copied into a combined source file for a project, or he may select some functions to be placed into the combined source file. But, he may expect that the functions included will have their supporting functions brought in as well.
355
+ ```
289
356
 
290
- More commonly, this tool is useful for creating web pages that host bundled operations and that provide basic common libraries that will not be accessed on the global (window) level. In the sense that a browser provides a common library accessible to all parts of a project, a window can offer an extension of that capability. The extension is mostly a packaging of that capability into simpler calls.
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
- One may ask why one would allow code (fixed version) to be copied into a number of projects without creating a module publication. The answer has more to do with expediency of project creation with some time being taken to decide what is a maintable module. The tool will copy just one function from a group of functions into a project if that is specified. But, when the module is maintained, the tool may copy all the function of a group into the new module and ready the code for publication. Projects that use the module will import all the functions in some sense into their code. Certainly, down stream tree shaking may work to reduce the number of functions included. But, that may just move certain worries down stream.
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
- So, there are options for deciding how alpha code will be included in projects. But, this tool also provides generation based on skeletons.
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
- In order to create a template, this tool reads a skeleton file and a JSON configuration that describes how to select alpha code and use some or all of the skeleton to create an .html file that has code and variables, where the mark the place where final code will be placed.
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
- ## Setting up publisher calls in a node.js module
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