2.1.2 • Published 1 month ago

@html_first/html_scrambler v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

html_scrambler

a simple yet highly extendable nodeJS SSG scrambler library.

for scrambling generated static web html resources from, including but not limited to:

  • bootstrap studio.
  • pinegrow.
  • WYSIWYG web builder.
  • or bassically any program that generate static web folder, as long as it is able to add custom html attribute.

into chunks of file, that(by extending our builder_class) are usable for any html based web framework/templating language like:

  • laravel blade,
  • svelte,
  • next,
  • ejs, or...
  • basically anything.

or at least that is the mission of this project

how to initiate

create file in your project folder

// main.mjs
// @ts-check
import { h_watcher } from '@html_first/html_scrambler';

const watcher = new h_watcher({
	/**
	 * options
	 * make no worries as we already make it type safe and ?documented? inside the module
	 */
});
watcher.run({
	/**
	 * options
	 * ditto
	 */
});

initiate watcher using

node main.mjs

html call pattern

to call your class;method add attribute on the element to proccess

which then be called each index incrementally (starts from 1) and will end if there are no more index+1 after the curent index

nb

  • you might want to utilize attribute_delimiter_2 and attribute_delimiter_3 from (inside builder class) this.builder.b_build.attribute_delimiter_2 or this.builder.b_build.attribute_delimiter_3 for this.builder.split to split with escaped curent delimiter

html example

<div id="test" build b-1="php;foreach;$table as $row">test</div>

meaning:

  • that #test element will call registered class named php,
  • run method named foreach
  • with "$table as \$row" as first argument

which, with our example class, php, it will result into

<?php foreach($table as $row){ ?><div id="test">test</div><?php };?>

* examples are available in the listed github repo

code splitting

our example class also have bss class, which show code example on how to code split one html into multiple file

you can call it using partial method

<div id="test" build b-1="bss;partial;component/test.blade.php;@include('view.name')">test</div>

which will turn main html line into

@include('view.name')

and create new file at "${build_path}/component/test.blade.php" with this

<div id="test">test</div>

How to install

npm i @html_first/html_scrambler
2.1.2

1 month ago

2.1.1

1 month ago

2.1.0

1 month ago

2.0.2

1 month ago

2.0.1

1 month ago

2.0.0

1 month ago

1.0.26

1 month ago

1.0.25

1 month ago

1.0.24

1 month ago

1.0.22

1 month ago

1.0.21

1 month ago

1.0.23

1 month ago

1.0.19

1 month ago

1.0.18

1 month ago

1.0.17

1 month ago

1.0.16

1 month ago

1.0.8

1 month ago

1.0.7

1 month ago

1.0.11

1 month ago

1.0.10

1 month ago

1.0.20

1 month ago

1.0.15

1 month ago

1.0.14

1 month ago

1.0.13

1 month ago

1.0.12

1 month ago

1.0.6

1 month ago

1.0.5

1 month ago

1.0.4

1 month ago

1.0.3

1 month ago

1.0.2

1 month ago

1.0.1

1 month ago

1.0.0

1 month ago