eyeling 1.24.14 → 1.24.15

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/HANDBOOK.md CHANGED
@@ -3733,6 +3733,8 @@ The output behavior also adapts to the kind of N3 program being run. In some cas
3733
3733
 
3734
3734
  For Markdown-oriented `log:outputString` examples, the output pane has two views: a rendered Markdown view and a Markdown source view. The rendered view is selected by default when the output is text intended for presentation, while the source view keeps the exact generated Markdown available for copying, inspection, or comparison.
3735
3735
 
3736
+ Repository example reports often contain relative source links that are written for the checked-in files under `examples/output/*.md`. When such an example is loaded into the playground from a raw URL, the rendered Markdown view resolves those relative links against the corresponding static output page rather than against `/playground`, so links like `../name.n3` and `../input/name.trig` continue to point to the intended example files.
3737
+
3736
3738
  ### I.4 Error handling and explainability
3737
3739
 
3738
3740
  For an interactive reasoning environment, error behavior matters almost as much as successful output. The playground therefore gives particular attention to syntax and runtime feedback.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyeling",
3
- "version": "1.24.14",
3
+ "version": "1.24.15",
4
4
  "description": "A minimal Notation3 (N3) reasoner in JavaScript.",
5
5
  "main": "./index.js",
6
6
  "keywords": [
@@ -535,6 +535,8 @@ async function main() {
535
535
  // Intercept CodeMirror + remote GitHub raw URLs (keep test deterministic).
536
536
  const localPkg = fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8');
537
537
  const localEyeling = fs.readFileSync(path.join(ROOT, 'eyeling.js'), 'utf8');
538
+ const localSmokeArithmetic = fs.readFileSync(path.join(ROOT, 'examples', 'smoke-arithmetic.n3'), 'utf8');
539
+ const localSmokeArithmeticTrig = fs.readFileSync(path.join(ROOT, 'examples', 'input', 'smoke-arithmetic.trig'), 'utf8');
538
540
  const localSudoku = fs.readFileSync(path.join(ROOT, 'examples', 'sudoku.n3'), 'utf8');
539
541
  const localSudokuBuiltin = fs.readFileSync(path.join(ROOT, 'examples', 'builtin', 'sudoku.js'), 'utf8');
540
542
 
@@ -566,6 +568,14 @@ async function main() {
566
568
  'https://raw.githubusercontent.com/eyereasoner/eyeling/refs/heads/main/eyeling.js',
567
569
  { ct: 'application/javascript', body: localEyeling },
568
570
  ],
571
+ [
572
+ 'https://raw.githubusercontent.com/eyereasoner/eyeling/refs/heads/main/examples/smoke-arithmetic.n3',
573
+ { ct: 'text/plain', body: localSmokeArithmetic },
574
+ ],
575
+ [
576
+ 'https://raw.githubusercontent.com/eyereasoner/eyeling/refs/heads/main/examples/input/smoke-arithmetic.trig',
577
+ { ct: 'text/plain', body: localSmokeArithmeticTrig },
578
+ ],
569
579
  [
570
580
  'https://raw.githubusercontent.com/eyereasoner/eyeling/refs/heads/main/examples/sudoku.n3',
571
581
  { ct: 'text/plain', body: localSudoku },
@@ -909,7 +919,7 @@ ${JSON.stringify(last, null, 2)}`);
909
919
 
910
920
  // 6) URL-loaded examples should auto-load matching examples/input/<stem>.trig and run in RDF/TriG mode.
911
921
  beginTest('playground auto-loads companion TriG sidecars and uses RDF/TriG mode');
912
- await loadUrlIntoEditor(`${started.baseUrl}/examples/smoke-arithmetic.n3`);
922
+ await loadUrlIntoEditor('https://raw.githubusercontent.com/eyereasoner/eyeling/refs/heads/main/examples/smoke-arithmetic.n3');
913
923
  const smokeLoaded = await waitForState(
914
924
  'smoke-arithmetic URL loaded with companion TriG input',
915
925
  (st) => /companion RDF\/TriG input/i.test(String(st.status || '')) && /input\/smoke-arithmetic\.trig/i.test(String(st.backgroundStatus || '')),
@@ -926,6 +936,16 @@ ${JSON.stringify(last, null, 2)}`);
926
936
  30000,
927
937
  );
928
938
  assert.match(smoke.output, /product = 42/i, 'Expected result derived from companion TriG evidence');
939
+ assert.match(
940
+ smoke.renderedHtml,
941
+ new RegExp('href="' + started.baseUrl.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '/examples/smoke-arithmetic\\.n3"'),
942
+ 'Expected relative Markdown source links to resolve against the static output page, not /playground',
943
+ );
944
+ assert.match(
945
+ smoke.renderedHtml,
946
+ new RegExp('href="' + started.baseUrl.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '/examples/input/smoke-arithmetic\\.trig"'),
947
+ 'Expected relative Markdown TriG links to resolve against the static output page, not /playground',
948
+ );
929
949
  endTest();
930
950
 
931
951
  // 7) URL-loaded repository examples should auto-load matching examples/builtin/<stem>.js.