<commit_before>% style.pl: Styles the pages from the Web frontend: adds menus, containers and a CSS file
% This file is from Chemlogic, a logic programming computer chemistry system
% (C) Copyright 2012-2016 <NAME>



:- multifile [user:head//2,user:body//2].



% Checks to see if style files have been installed in the correct system-wide location (e.g /usr/share/chemlogic)
% If not, look for style files in the current directory.

find_style_dir :-
	catch(cf_prefix(Prefix),_,fail), % If the prefix is not configured, fail and assume that the files are not installed
	atom_concat(Prefix,'/share/chemlogic/',ChemlogicShare),
	exists_directory(ChemlogicShare) -> assertz(style_dir(ChemlogicShare));
	assertz(style_dir('')).

% This process must not be cached -- it is possible for Chemlogic to be moved.
:- volatile style_dir/1.
%  Locate style files once per start up
:- initialization(find_style_dir,now).


% This predicate will automatically register a HTTP handler for the style file, automatically calculating paths.
serve_style_file(File) :-
	style_dir(Dir),	
	atom_concat(Dir,File,FSPath),
	atom_concat('/chemlogic/',File,HTTPath),
	% The 'unsafe' option allows the HTTP server to serve a file above the directory from which Chemlogic was started.
	% This is necessary because style files may be installed in a system-wide location (e.g. /usr/share/chemlogic)
	% I think this is safe, because no user-provided input is used to determine which files to serve.
	http_handler(HTTPath,http_reply_file(FSPath,[unsafe(true)]),[]).

% Load the custom footer

:- [custom_footer].


% Serves stylesheet and font.
:- initialization serve_style_file('style/modern.css').
:- initialization serve_style_file('style/computer-modern.otf').
:- initialization serve_style_file('style/help.js').

% Injects stylesheet into every page.
user:head(chemlogic,Head) -->
	html(
	head([
	Head,
	link([rel(stylesheet),href('style/modern.css')]),
	link([rel(stylesheet),href('style/custom_footer.css')]),
	meta([name(viewport),content('width=device-width; initial-scale=1')])
	])
	).

% Injects menu into every page.
user:body(chemlogic,Body) -->
	html(
	body([<commit_msg>[M] Fix a HTML syntax error that was showing up in console<commit_after>% style.pl: Styles the pages from the Web frontend: adds menus, containers and a CSS file
% This file is from Chemlogic, a logic programming computer chemistry system
% (C) Copyright 2012-2016 <NAME>



:- multifile [user:head//2,user:body//2].



% Checks to see if style files have been installed in the correct system-wide location (e.g /usr/share/chemlogic)
% If not, look for style files in the current directory.

find_style_dir :-
	catch(cf_prefix(Prefix),_,fail), % If the prefix is not configured, fail and assume that the files are not installed
	atom_concat(Prefix,'/share/chemlogic/',ChemlogicShare),
	exists_directory(ChemlogicShare) -> assertz(style_dir(ChemlogicShare));
	assertz(style_dir('')).

% This process must not be cached -- it is possible for Chemlogic to be moved.
:- volatile style_dir/1.
%  Locate style files once per start up
:- initialization(find_style_dir,now).


% This predicate will automatically register a HTTP handler for the style file, automatically calculating paths.
serve_style_file(File) :-
	style_dir(Dir),	
	atom_concat(Dir,File,FSPath),
	atom_concat('/chemlogic/',File,HTTPath),
	% The 'unsafe' option allows the HTTP server to serve a file above the directory from which Chemlogic was started.
	% This is necessary because style files may be installed in a system-wide location (e.g. /usr/share/chemlogic)
	% I think this is safe, because no user-provided input is used to determine which files to serve.
	http_handler(HTTPath,http_reply_file(FSPath,[unsafe(true)]),[]).

% Load the custom footer

:- [custom_footer].


% Serves stylesheet and font.
:- initialization serve_style_file('style/modern.css').
:- initialization serve_style_file('style/computer-modern.otf').
:- initialization serve_style_file('style/help.js').

% Injects stylesheet into every page.
user:head(chemlogic,Head) -->
	html(
	head([
	Head,
	link([rel(stylesheet),href('style/modern.css')]),
	link([rel(stylesheet),href('style/custom_footer.css')]),
	meta([name(viewport),content('width=device-width, initial-scale=1')])
	])
	).

% Injects menu into every page.
user:body(chemlogic,Body) -->
	html(
	body([
{'fraction_non_alphanumeric': 0.11751204957539592, 'fraction_numerical': 0.005508377323846684, 'mean_word_length': 5.120786516853933, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2520901', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1350, 'n_words': 432}