What is this? \css and \js Something with library(http/http_server)?

In looking at this example code from @CapelliC

home_page(_Request) :-
    reply_html_page(
        [ title('cyajax test'),
          \cy_cdn
        ],
        [ div([
            input([id=run_cyajax,type=button,value='run cyajax']),
            div([id=host_cy],'host cy')
          ]),
          \css,
          \js
        ]).

css --> html(style('
	#host_cy {
	  height: 400px;
	  width: 400px;
	  background-color: lime;
	}
')).

it was natural to look for phrase/2,3 in the code. However phrase/2,3 is not used directly so in searching for what would be activating the DCG was thinking it was html//1, specifically

\ Term
Invoke the non-terminal Term in the calling module. This is the common mechanism to realise abstraction and modularisation in generating HTML.

but was not sure.


EDIT

After seeing the answer by jamesnvc and many months later stumbled upon

Rule definition facilities (html//1 rules)

which is part of a larger set of tutorials and thus gives a nice primer into understanding the practicality of using the concept.

Yup, exactly; reply_html_page/2 uses html//1, in which \Term invokes the DCG Term.

1 Like