@rip-lang/print 0.1.3 → 0.1.4
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/package.json +1 -1
- package/print.rip +8 -9
package/package.json
CHANGED
package/print.rip
CHANGED
|
@@ -200,11 +200,10 @@ def highlightCode(code, lang)
|
|
|
200
200
|
# fall through
|
|
201
201
|
highlighted ?= escapeHtml code
|
|
202
202
|
|
|
203
|
-
# Add line numbers
|
|
203
|
+
# Add line numbers (fixed 4-digit width for consistent gutter)
|
|
204
204
|
lines = highlighted.split('\n')
|
|
205
|
-
width = String(lines.length).length
|
|
206
205
|
numbered = lines.map (line, i) ->
|
|
207
|
-
num = String(i + 1).padStart(
|
|
206
|
+
num = String(i + 1).padStart(4)
|
|
208
207
|
"<span class=\"line-num\">#{num}</span> #{line}"
|
|
209
208
|
numbered.join('\n')
|
|
210
209
|
|
|
@@ -300,17 +299,17 @@ html = """
|
|
|
300
299
|
.toc a:hover { text-decoration: underline; }
|
|
301
300
|
.meta { color: #888; font-size: 12px; }
|
|
302
301
|
|
|
303
|
-
.file-section { margin-bottom: 0; }
|
|
302
|
+
.file-section { margin-bottom: 0; margin-top: -1px; }
|
|
304
303
|
.file-header {
|
|
305
|
-
background: #{headerBg}; padding:
|
|
306
|
-
border-top: 1px solid #{borderColor}; border-bottom: 1px solid #{borderColor};
|
|
304
|
+
background: #{headerBg}; padding: 10px 16px 10px 5.85em; font-size: 13px; font-weight: 600;
|
|
305
|
+
border-top: 1px solid #{borderColor}; border-bottom: 1px solid #{borderColor};
|
|
307
306
|
display: flex; justify-content: space-between; align-items: center;
|
|
308
307
|
}
|
|
309
308
|
.nav { font-weight: normal; font-size: 12px; }
|
|
310
|
-
.nav a { color: #888; text-decoration: none;
|
|
311
|
-
.nav a:hover { color: #{textColor}; }
|
|
309
|
+
.nav a { color: #888; text-decoration: none; padding: 6px 10px; border-radius: 3px; }
|
|
310
|
+
.nav a:hover { color: #{textColor}; background: #{if dark then '#30363d' else '#e0e0e0'}; }
|
|
312
311
|
|
|
313
|
-
.code-container { overflow-x: auto; }
|
|
312
|
+
.code-container { overflow-x: auto; border-bottom: 1px solid #{borderColor}; }
|
|
314
313
|
.code-container pre { margin: 0; border-radius: 0; }
|
|
315
314
|
.code-container code { font-size: 13px; line-height: 1.5; padding: 0 !important; display: block; }
|
|
316
315
|
.line-num { color: #aaa; background: #{if dark then '#161b22' else '#f4f4f4'}; user-select: none; display: inline-block; min-width: 2em; text-align: right; padding: 0 0.7em; margin-right: 0.7em; border-right: 1px solid #{borderColor}; }
|