JairoDanielMT commited on
Commit
7710c1b
1 Parent(s): 93a6d76

redirige a /docs

Browse files
app/renderer.py CHANGED
@@ -62,16 +62,13 @@ def render_html(doc: Dict[str, Any]) -> str:
62
 
63
 
64
  def _wkhtml_options() -> Dict[str, str]:
65
- """
66
- Opciones por defecto para wkhtmltopdf.
67
- """
68
  return {
69
  "page-size": "A4",
70
  "encoding": "UTF-8",
71
- "margin-top": "20mm",
72
- "margin-right": "20mm",
73
- "margin-bottom": "20mm",
74
- "margin-left": "20mm",
75
  }
76
 
77
 
 
62
 
63
 
64
  def _wkhtml_options() -> Dict[str, str]:
 
 
 
65
  return {
66
  "page-size": "A4",
67
  "encoding": "UTF-8",
68
+ "margin-top": "25.4mm",
69
+ "margin-right": "25.4mm",
70
+ "margin-bottom": "25.4mm",
71
+ "margin-left": "25.4mm",
72
  }
73
 
74
 
app/templates/ClientScript.html.j2 CHANGED
@@ -2,8 +2,19 @@
2
  {% import "components.html.j2" as ui %}
3
 
4
  {% block content %}
5
- <h1>Client Script 路 {{ doc.metadata.description or doc.metadata.script_type }}</h1>
6
- <p class="muted">Eventos de cliente y validaciones en UI.</p>
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  {{ ui.metadata_block(doc.metadata) }}
9
  {{ ui.summary_block(doc.summary) }}
 
2
  {% import "components.html.j2" as ui %}
3
 
4
  {% block content %}
5
+
6
+ <header class="doc-header">
7
+ <h1>Client Script 路 {{ doc.metadata.description or doc.metadata.script_type }}</h1>
8
+
9
+ <p class="doc-header-meta">
10
+ SuiteScript {{ doc.metadata.suitescript_version or "N/D" }}
11
+ {% if doc.metadata.modules %}
12
+ 路 M贸dulos: {{ doc.metadata.modules | join(", ") }}
13
+ {% endif %}
14
+ </p>
15
+
16
+ <p class="muted">Eventos de cliente y validaciones en UI.</p>
17
+ </header>
18
 
19
  {{ ui.metadata_block(doc.metadata) }}
20
  {{ ui.summary_block(doc.summary) }}
app/templates/base.html.j2 CHANGED
@@ -4,78 +4,114 @@
4
  <meta charset="UTF-8" />
5
  <title>{{ doc.metadata.description or "Documentaci贸n de Script" }}</title>
6
 
 
 
 
 
 
 
 
 
7
  <style>
8
  /* ----------------------------------------
9
  CONFIGURACI脫N GLOBAL / A4 / M脕RGENES
10
  ----------------------------------------- */
11
  @page {
12
  size: A4;
13
- margin: 2.54cm; /* 1 pulgada = 2.54 cm */
14
  }
15
 
16
  body {
17
- font-family: "Segoe UI", Roboto, Arial, sans-serif;
18
- color: #1f2937;
19
- font-size: 14px;
20
- line-height: 1.65;
 
21
  margin: 0;
22
  background: #ffffff;
23
  }
24
 
25
  .page {
26
- /* contenedor para PDFKit */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
  /* ----------------------------------------
30
  TITULOS
31
  ----------------------------------------- */
32
- h1, h2, h3, h4 {
33
- font-family: "Segoe UI", Roboto, Arial, sans-serif;
34
- margin-bottom: 8px;
 
 
 
 
35
  font-weight: 600;
36
  }
37
 
38
  h1 {
39
- font-size: 26px;
40
- color: #b91c1c;
41
- letter-spacing: 0.04em;
42
  text-transform: uppercase;
43
  margin-top: 0;
44
- border-bottom: 2px solid #e5e7eb;
45
- padding-bottom: 8px;
46
  }
47
 
48
  h2 {
49
- font-size: 20px;
50
- color: #374151;
51
- border-left: 4px solid #9b1c1c;
52
  padding-left: 10px;
53
- margin-top: 28px;
 
54
  }
55
 
56
  h3 {
57
- font-size: 16px;
58
- color: #4b5563;
59
- margin-top: 20px;
 
60
  }
61
 
62
  h4 {
63
- font-size: 14px;
64
- color: #6b7280;
65
- margin-top: 14px;
 
66
  }
67
 
68
  p {
69
- margin: 6px 0 12px;
70
  }
71
 
72
  .muted {
73
- color: #9ca3af;
74
- font-size: 12px;
75
  }
76
 
77
  .section {
78
- margin-top: 22px;
79
  }
80
 
81
  /* ----------------------------------------
@@ -83,53 +119,79 @@
83
  ----------------------------------------- */
84
  .card-grid {
85
  display: grid;
86
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
87
- gap: 12px;
88
- margin: 16px 0;
89
  }
90
 
91
  .card {
92
  border: 1px solid #e5e7eb;
93
  border-radius: 6px;
94
- padding: 14px 16px;
95
  background: #f9fafb;
96
- box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.06);
 
 
 
 
 
 
 
 
97
  }
98
 
99
  /* ----------------------------------------
100
- TABLAS
101
  ----------------------------------------- */
102
  table {
103
  width: 100%;
104
  border-collapse: collapse;
105
- margin: 16px 0 20px;
106
- font-size: 13px;
 
 
 
 
 
 
 
 
107
  }
108
 
109
- th, td {
 
 
 
 
 
110
  border: 1px solid #e5e7eb;
111
- padding: 8px 10px;
112
  vertical-align: top;
113
  }
114
 
115
  th {
116
- background: #f3f4f6;
117
  font-weight: 600;
118
  text-transform: uppercase;
119
- font-size: 11px;
120
- letter-spacing: 0.05em;
 
121
  }
122
 
123
  tr:nth-child(even) td {
124
- background: #fafafa;
125
  }
126
 
127
  /* ----------------------------------------
128
  LISTAS
129
  ----------------------------------------- */
130
  ul {
131
- padding-left: 22px;
132
- margin: 8px 0 10px;
 
 
 
 
133
  }
134
 
135
  /* ----------------------------------------
@@ -137,10 +199,10 @@
137
  ----------------------------------------- */
138
  .pill {
139
  display: inline-block;
140
- padding: 4px 10px;
141
  border-radius: 999px;
142
  background: #e5e7eb;
143
- font-size: 11px;
144
  margin-right: 4px;
145
  text-transform: uppercase;
146
  letter-spacing: 0.05em;
@@ -151,12 +213,50 @@
151
  SUMMARY BOX
152
  ----------------------------------------- */
153
  .summary-box {
154
- border-left: 4px solid #0284c7;
155
  background: #eff6ff;
156
- padding: 12px 16px;
157
- border-radius: 6px;
158
- font-size: 13px;
159
- margin: 14px 0 18px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
  </style>
162
  </head>
@@ -165,7 +265,7 @@
165
  <div class="page">
166
  {% block content %}{% endblock %}
167
 
168
- <p class="muted" style="margin-top: 32px; text-align:right;">
169
  Generado autom谩ticamente {{ generated_at }}
170
  </p>
171
  </div>
 
4
  <meta charset="UTF-8" />
5
  <title>{{ doc.metadata.description or "Documentaci贸n de Script" }}</title>
6
 
7
+ <!-- Fuente corporativa desde Google Fonts -->
8
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
+ <link
11
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
12
+ rel="stylesheet"
13
+ />
14
+
15
  <style>
16
  /* ----------------------------------------
17
  CONFIGURACI脫N GLOBAL / A4 / M脕RGENES
18
  ----------------------------------------- */
19
  @page {
20
  size: A4;
21
+ margin: 2.54cm; /* 1 pulgada por cada lado */
22
  }
23
 
24
  body {
25
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
26
+ system-ui, sans-serif;
27
+ color: #111827;
28
+ font-size: 13px;
29
+ line-height: 1.7;
30
  margin: 0;
31
  background: #ffffff;
32
  }
33
 
34
  .page {
35
+ /* contenedor principal del documento */
36
+ }
37
+
38
+ /* ----------------------------------------
39
+ ENCABEZADO / FOOTER
40
+ ----------------------------------------- */
41
+ .doc-header {
42
+ margin-bottom: 16px;
43
+ padding-bottom: 10px;
44
+ border-bottom: 1px solid #e5e7eb;
45
+ }
46
+
47
+ .doc-header-meta {
48
+ font-size: 11px;
49
+ color: #6b7280;
50
+ margin-top: 4px;
51
+ }
52
+
53
+ .doc-footer {
54
+ margin-top: 32px;
55
+ font-size: 11px;
56
+ color: #9ca3af;
57
+ text-align: right;
58
  }
59
 
60
  /* ----------------------------------------
61
  TITULOS
62
  ----------------------------------------- */
63
+ h1,
64
+ h2,
65
+ h3,
66
+ h4 {
67
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
68
+ system-ui, sans-serif;
69
+ margin-bottom: 6px;
70
  font-weight: 600;
71
  }
72
 
73
  h1 {
74
+ font-size: 22px;
75
+ color: #0f172a;
76
+ letter-spacing: 0.03em;
77
  text-transform: uppercase;
78
  margin-top: 0;
 
 
79
  }
80
 
81
  h2 {
82
+ font-size: 16px;
83
+ color: #111827;
84
+ border-left: 3px solid #1d4ed8;
85
  padding-left: 10px;
86
+ margin-top: 24px;
87
+ margin-bottom: 8px;
88
  }
89
 
90
  h3 {
91
+ font-size: 14px;
92
+ color: #111827;
93
+ margin-top: 18px;
94
+ margin-bottom: 4px;
95
  }
96
 
97
  h4 {
98
+ font-size: 13px;
99
+ color: #374151;
100
+ margin-top: 12px;
101
+ margin-bottom: 4px;
102
  }
103
 
104
  p {
105
+ margin: 4px 0 10px;
106
  }
107
 
108
  .muted {
109
+ color: #6b7280;
110
+ font-size: 11px;
111
  }
112
 
113
  .section {
114
+ margin-top: 16px;
115
  }
116
 
117
  /* ----------------------------------------
 
119
  ----------------------------------------- */
120
  .card-grid {
121
  display: grid;
122
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
123
+ gap: 10px;
124
+ margin: 14px 0;
125
  }
126
 
127
  .card {
128
  border: 1px solid #e5e7eb;
129
  border-radius: 6px;
130
+ padding: 12px 14px;
131
  background: #f9fafb;
132
+ }
133
+
134
+ .card-title {
135
+ font-size: 12px;
136
+ font-weight: 600;
137
+ text-transform: uppercase;
138
+ letter-spacing: 0.04em;
139
+ color: #4b5563;
140
+ margin-bottom: 6px;
141
  }
142
 
143
  /* ----------------------------------------
144
+ TABLAS (pensadas para PDF)
145
  ----------------------------------------- */
146
  table {
147
  width: 100%;
148
  border-collapse: collapse;
149
+ margin: 12px 0 16px;
150
+ font-size: 12px;
151
+ }
152
+
153
+ thead {
154
+ display: table-header-group; /* Repite encabezados en cada p谩gina */
155
+ }
156
+
157
+ tfoot {
158
+ display: table-footer-group;
159
  }
160
 
161
+ tr {
162
+ page-break-inside: avoid; /* Evita cortar filas a la mitad */
163
+ }
164
+
165
+ th,
166
+ td {
167
  border: 1px solid #e5e7eb;
168
+ padding: 6px 8px;
169
  vertical-align: top;
170
  }
171
 
172
  th {
173
+ background: #eff2f7;
174
  font-weight: 600;
175
  text-transform: uppercase;
176
+ font-size: 10px;
177
+ letter-spacing: 0.06em;
178
+ color: #4b5563;
179
  }
180
 
181
  tr:nth-child(even) td {
182
+ background: #f9fafb;
183
  }
184
 
185
  /* ----------------------------------------
186
  LISTAS
187
  ----------------------------------------- */
188
  ul {
189
+ padding-left: 20px;
190
+ margin: 6px 0 8px;
191
+ }
192
+
193
+ ul li {
194
+ margin-bottom: 3px;
195
  }
196
 
197
  /* ----------------------------------------
 
199
  ----------------------------------------- */
200
  .pill {
201
  display: inline-block;
202
+ padding: 3px 8px;
203
  border-radius: 999px;
204
  background: #e5e7eb;
205
+ font-size: 10px;
206
  margin-right: 4px;
207
  text-transform: uppercase;
208
  letter-spacing: 0.05em;
 
213
  SUMMARY BOX
214
  ----------------------------------------- */
215
  .summary-box {
216
+ border-left: 3px solid #2563eb;
217
  background: #eff6ff;
218
+ padding: 10px 12px;
219
+ border-radius: 4px;
220
+ font-size: 12px;
221
+ margin: 10px 0 14px;
222
+ }
223
+
224
+ .summary-title {
225
+ font-size: 11px;
226
+ font-weight: 600;
227
+ text-transform: uppercase;
228
+ letter-spacing: 0.05em;
229
+ color: #1d4ed8;
230
+ margin-bottom: 4px;
231
+ }
232
+
233
+ /* ----------------------------------------
234
+ UTILIDADES
235
+ ----------------------------------------- */
236
+ .flex {
237
+ display: flex;
238
+ }
239
+
240
+ .justify-between {
241
+ justify-content: space-between;
242
+ }
243
+
244
+ .items-center {
245
+ align-items: center;
246
+ }
247
+
248
+ .text-right {
249
+ text-align: right;
250
+ }
251
+
252
+ .badge {
253
+ display: inline-block;
254
+ padding: 2px 8px;
255
+ border-radius: 999px;
256
+ font-size: 10px;
257
+ border: 1px solid #d1d5db;
258
+ color: #4b5563;
259
+ background: #f9fafb;
260
  }
261
  </style>
262
  </head>
 
265
  <div class="page">
266
  {% block content %}{% endblock %}
267
 
268
+ <p class="doc-footer">
269
  Generado autom谩ticamente {{ generated_at }}
270
  </p>
271
  </div>