@rip-lang/print 0.1.7 → 0.1.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/print.rip +12 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/print",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Syntax-highlighted source code printer — Shiki-powered, serves once, auto-opens browser",
5
5
  "type": "module",
6
6
  "main": "print.rip",
package/print.rip CHANGED
@@ -23,6 +23,10 @@ hljs.registerLanguage 'rip', ripLanguage
23
23
 
24
24
  args = process.argv.slice(2)
25
25
 
26
+ if args.includes('-v') or args.includes('--version')
27
+ console.log "rip-print 0.1.8"
28
+ process.exit(0)
29
+
26
30
  if args.includes('-h') or args.includes('--help')
27
31
  console.log """
28
32
  usage: rip-print [options] <paths ...>
@@ -31,6 +35,7 @@ if args.includes('-h') or args.includes('--help')
31
35
  -b, --bypass Strip leading comment blocks from files
32
36
  -d, --dark Use dark theme (default: light)
33
37
  -h, --help Show this help message
38
+ -v, --version Show version and quit
34
39
  -x <exts> Comma list of extensions to exclude
35
40
 
36
41
  Examples:
@@ -372,12 +377,6 @@ html = """
372
377
  var themes = {
373
378
  #{themeData}
374
379
  };
375
- // Restore saved theme
376
- var saved = localStorage.getItem('rip-print-theme');
377
- if (saved && themes[saved]) {
378
- document.getElementById('theme-picker').value = saved;
379
- document.getElementById('theme-picker').dispatchEvent(new Event('change'));
380
- }
381
380
  document.getElementById('theme-picker').addEventListener('change', function(e) {
382
381
  var id = e.target.value;
383
382
  localStorage.setItem('rip-print-theme', id);
@@ -400,6 +399,12 @@ html = """
400
399
  document.querySelectorAll('.code-container').forEach(function(e) { e.style.borderColor = brd; });
401
400
  document.querySelectorAll('.toc a').forEach(function(e) { e.style.color = fg; });
402
401
  });
402
+ // Restore saved theme
403
+ var saved = localStorage.getItem('rip-print-theme');
404
+ if (saved && themes[saved]) {
405
+ document.getElementById('theme-picker').value = saved;
406
+ document.getElementById('theme-picker').dispatchEvent(new Event('change'));
407
+ }
403
408
  </script>
404
409
  </body>
405
410
  </html>
@@ -412,7 +417,7 @@ html = """
412
417
  served = false
413
418
 
414
419
  server = Bun.serve
415
- port: 0
420
+ port: 9111
416
421
  fetch: (req) ->
417
422
  served = true
418
423
  new Response html, headers: { 'Content-Type': 'text/html; charset=utf-8' }