<commit_before>module namespace template="http://cefn.com/readinglog/template";

import module namespace notes="http://cefn.com/readinglog/notes" at "/home/cefn/Documents/highwire/participatory firmware design/readinglog/scripts/server/xquery/lib/notes.xq";
import module namespace file = "http://expath.org/ns/file";

declare default element namespace "http://www.w3.org/1999/xhtml";

declare namespace ann = "http://www.zorba-xquery.com/annotations";

(: templates a webpage, including the nodes specified :)
declare function template:webpage($nodes){
	<html>
		<head>
		    <meta content="text/html; charset=utf-16" http-equiv="content-type"></meta>
			<link href="style.css" rel="stylesheet" type="text/css"></link>
		</head>
		<body>
			<table>
				<tr>
					<td>
						<div id="menu">
								{template:menu()}
						</div>
					</td>
					<td>
						<div id="content">
								{$nodes}
						</div>
					</td>
				</tr>
			</table>
		</body>
	</html>
};

(: Returns all the document nodes of well-formed XHTML files in a given directory :)
declare %ann:nondeterministic function template:loadhtml($dirpath) {
	for $file in file:list($dirpath) where matches($file,'.+\.html$')
	let $absfile := file:resolve-path(concat($dirpath,$file))
	return doc($absfile)
};

(: Returns all the document nodes of the XHTML note files :)
declare function template:menu(){
	<ul>
		{
			for $item in $notes:headings return 
			<li><a href="heading.xq?match={$item}">{$item}</a></li>
		}
	</ul>
};
<commit_msg>Added table id for CSS<commit_after>module namespace template="http://cefn.com/readinglog/template";

import module namespace notes="http://cefn.com/readinglog/notes" at "/home/cefn/Documents/highwire/participatory firmware design/readinglog/scripts/server/xquery/lib/notes.xq";
import module namespace file = "http://expath.org/ns/file";

declare default element namespace "http://www.w3.org/1999/xhtml";

declare namespace ann = "http://www.zorba-xquery.com/annotations";

(: templates a webpage, including the nodes specified :)
declare function template:webpage($nodes){
	<html>
		<head>
		    <meta content="text/html; charset=utf-16" http-equiv="content-type"></meta>
			<link href="style.css" rel="stylesheet" type="text/css"></link>
		</head>
		<body>
			<table id="layout">
				<tr>
					<td>
						<div id="menu">
								{template:menu()}
						</div>
					</td>
					<td>
						<div id="content">
								{$nodes}
						</div>
					</td>
				</tr>
			</table>
		</body>
	</html>
};

(: Returns all the document nodes of well-formed XHTML files in a given directory :)
declare %ann:nondeterministic function template:loadhtml($dirpath) {
	for $file in file:list($dirpath) where matches($file,'.+\.html$')
	let $absfile := file:resolve-path(concat($dirpath,$file))
	return doc($absfile)
};

(: Returns all the document nodes of the XHTML note files :)
declare function template:menu(){
	<ul>
		{
			for $item in $notes:headings return 
			<li><a href="heading.xq?match={$item}">{$item}</a></li>
		}
	</ul>
};

{'fraction_non_alphanumeric': 0.1726881007623467, 'fraction_numerical': 0.004640371229698376, 'mean_word_length': 3.8210862619808306, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1543136', 'n_tokens_mistral': 1176, 'n_tokens_neox': 991, 'n_words': 235}