Skip to content

Commit abfa81f

Browse files
authored
feat: rendering of checkboxes in markdown (#381)
* added support for rendering checkboxes * DCO Remediation Commit for Erik <[email protected]> Signed-off-by: Erik <[email protected]> * DCO Remediation Commit for Erik <[email protected]> I, Erik <[email protected]>, hereby add my Signed-off-by to this commit: 7af4704 Signed-off-by: Erik <[email protected]> * added code suggestions for better checkboxes * updated test data * fixed formatting * DCO Remediation Commit for Erik <[email protected]> I, Erik <[email protected]>, hereby add my Signed-off-by to this commit: fc7a57e I, Erik <[email protected]>, hereby add my Signed-off-by to this commit: 7ea737e I, Erik <[email protected]>, hereby add my Signed-off-by to this commit: 5c431b5 Signed-off-by: Erik <[email protected]> --------- Signed-off-by: Erik <[email protected]>
1 parent c52605d commit abfa81f

19 files changed

+5868
-27
lines changed

docling_core/transforms/serializer/markdown.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
ContentLayer,
4141
DescriptionAnnotation,
4242
DocItem,
43+
DocItemLabel,
4344
DoclingDocument,
4445
FloatingItem,
4546
Formatting,
@@ -140,6 +141,10 @@ def serialize(
140141
text = item.text
141142
processing_pending = True
142143

144+
if item.label == DocItemLabel.CHECKBOX_SELECTED:
145+
text = f"- [x] {text}"
146+
if item.label == DocItemLabel.CHECKBOX_UNSELECTED:
147+
text = f"- [ ] {text}"
143148
if isinstance(item, (ListItem, TitleItem, SectionHeaderItem)):
144149
if not has_inline_repr:
145150
# case where processing/formatting should be applied first (in inner scope)

test/data/doc/2408.09869v3_enriched.out.dt.json

Lines changed: 22 additions & 22 deletions
Large diffs are not rendered by default.

test/data/doc/checkboxes.gt.md

Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
Security Classification / Classification de sécurité
2+
3+
Contract Number / Numéro du contrat
4+
5+
UNCLASSIFIED
6+
7+
Gouvernement du Canada
8+
9+
SECURITY REQUIREMENTS CHECK LIST (SRCL)
10+
11+
LISTE DE VÉRIFICATION DES EXIGENCES RELATIVES À LA SÉCURITÉ (LVERS)
12+
13+
4. Brief Description of Work - Brève description du travail
14+
15+
5. a) Will the supplier require access to Controlled Goods? Le fournisseur aura-t-il accès à des marchandises contrôlées?
16+
17+
- [x] Yes Oui
18+
19+
- [ ] No Non
20+
21+
5. b) Will the supplier require access to unclassified military technical data subject to the provisions of the Technical Data Control Regulations?
22+
23+
- Le fournisseur aura-t-il accès à des données techniques militaires non classifiées qui sont assujetties aux dispositions du Règlement sur le contrôle des données techniques?
24+
25+
- [ ] Yes Oui
26+
27+
- [x] No Non
28+
29+
6. Indicate the type of access required - Indiquer le type d'accès requis
30+
31+
1. Originating Government Department or Organization Ministère ou organisme gouvernemental d'origine
32+
33+
## PART A - CONTRACT INFORMATION / PARTIE A - INFORMATION CONTRACTUELLE
34+
35+
2. Branch or Directorate / Direction générale ou Direction
36+
37+
3. a) Subcontract Number / Numéro du contrat de sous-traitance
38+
39+
3. b) Name and Address of Subcontractor / Nom et adresse du sous-traitant
40+
41+
6. c) Is this a commercial courier or delivery requirement with no overnight storage? S'agit-il d'un contrat de messagerie ou de livraison commerciales sans entreposage de nuit?
42+
43+
- [ ] Yes Oui
44+
45+
- [x] No Non
46+
47+
7. a) Indicate the type of information that the supplier will be required to access / Indiquer le type d'information auquel le fournisseur devra avoir accès
48+
49+
Canada
50+
51+
7. b) Release restrictions / Restrictions relatives à la diffusion
52+
53+
Foreign / Étranger
54+
55+
- [ ] NATO / OTAN
56+
57+
No release restrictions
58+
59+
- [ ] Aucune restriction relative à la diffusion
60+
61+
Not releasable À ne pas diffuser
62+
63+
- [ ] Restricted to: / Limité à :
64+
65+
Specify country(ies): / Préciser le(s) pays :
66+
67+
All NATO countries Tous les pays de l'OTAN
68+
69+
Specify country(ies): / Préciser le(s) pays :
70+
71+
- [ ] No release restrictions Aucune restriction relative à la diffusion
72+
73+
Restricted to: / Limité à :
74+
75+
Specify country(ies): / Préciser le(s) pays :
76+
77+
Restricted to: / Limité à :
78+
79+
7. c) Level of information / Niveau d'information
80+
81+
PROTECTED A PROTÉGÉ A
82+
83+
PROTECTED B PROTÉGÉ B
84+
85+
- [ ] PROTECTED C PROTÉGÉ C
86+
87+
CONFIDENTIAL
88+
89+
CONFIDENTIEL
90+
91+
SECRET SECRET
92+
93+
- [ ] TOP SECRET TRÈS SECRET
94+
95+
- [ ] TOP SECRET (SIGINT) TRÈS SECRET (SIGINT)
96+
97+
NATO UNCLASSIFIED
98+
99+
- [ ] NATO NON CLASSIFIÉ
100+
101+
- [ ] NATO RESTRICTED NATO DIFFUSION RESTREINTE
102+
103+
NATO CONFIDENTIAL
104+
105+
- [ ] NATO CONFIDENTIEL
106+
107+
PROTECTED A
108+
109+
- [ ] PROTÉGÉ A
110+
111+
- [ ] PROTECTED B
112+
113+
PROTÉGÉ B
114+
115+
PROTECTED C
116+
117+
- [ ] PROTÉGÉ C
118+
119+
CONFIDENTIAL CONFIDENTIEL
120+
121+
SECRET SECRET
122+
123+
TOP SECRET
124+
125+
- [ ] TRÈS SECRET
126+
127+
TOP SECRET (SIGINT)
128+
129+
- [ ] TRÈS SECRET (SIGINT)
130+
131+
NATO SECRET
132+
133+
- [ ] NATO SECRET
134+
135+
COSMIC TOP SECRET
136+
137+
- [ ] COSMIC TRÈS SECRET
138+
139+
6. a) Will the supplier and its employees require access to PROTECTED and/or CLASSIFIED information or assets? Le fournisseur ainsi que les employés auront-ils accès à des renseignements ou à des biens PROTÉGÉS et/ou CLASSIFIÉS? (Specify the level of access using the chart in Question 7. c)
140+
141+
- (Préciser le niveau d'accès en utilisant le tableau qui se trouve à la question 7. c)
142+
143+
- [x] Yes Oui
144+
145+
- [ ] No Non
146+
147+
6. b) Will the supplier and its employees (e.g. cleaners, maintenance personnel) require access to restricted access areas? No access to PROTECTED and/or CLASSIFIED information or assets is permitted. Le fournisseur et ses employés (p.ex. nettoyeurs, personnel d'entretien) auront-ils accès à des zones d'accès restreintes? L'accès à des renseignements ou à des biens PROTÉGÉS et/ou CLASSIFIÉS n'est pas autorisé.
148+
149+
- [ ] Yes Oui
150+
151+
- [x] No Non
152+
153+
- [ ] not applicable
154+
155+
The Contractor will perform tasks applicable to the Land Intelligence, Surveillance, Reconnaissance Modernization (LISRM) Project.
156+
157+
Security Classification / Classification de sécurité
158+
159+
TBS/SCT 350-103 (2004/12)
160+
161+
UNCLASSIFIED
162+
163+
<!-- page break -->
164+
165+
Security Classification / Classification de sécurité
166+
167+
Contract Number / Numéro du contrat
168+
169+
## PART A (continued) / PARTIE A (suite)
170+
171+
8. Will the supplier require access to PROTECTED and/or CLASSIFIED COMSEC information or assets? Le fournisseur aura-t-il accès à des renseignements ou à des biens COMSEC désignés PROTÉGÉS et/ou CLASSIFIÉS? If Yes, indicate the level of sensitivity:
172+
173+
Dans l'affirmative, indiquer le niveau de sensibilité :
174+
175+
- [ ] Yes Oui
176+
177+
- [x] No Non
178+
179+
11. d) Will the supplier be required to use its IT systems to electronically process, produce or store PROTECTED and/or CLASSIFIED information or data?
180+
181+
- Le fournisseur sera-t-il tenu d'utiliser ses propres systèmes informatiques pour traiter, produire ou stocker électroniquement des renseignements ou des données PROTÉGÉS et/ou CLASSIFIÉS?
182+
183+
11. e) Will there be an electronic link between the supplier's IT systems and the government department or agency? Disposera-t-on d'un lien électronique entre le système informatique du fournisseur et celui du ministère ou de l'agence gouvernementale?
184+
185+
## INFORMATION TECHNOLOGY (IT) MEDIA / SUPPORT RELATIF À LA TECHNOLOGIE DE L'INFORMATION (TI)
186+
187+
- [ ] Yes Oui
188+
189+
- [x] No Non
190+
191+
- [ ] Yes Oui
192+
193+
- [x] No Non
194+
195+
11. c) Will the production (manufacture, and/or repair and/or modification) of PROTECTED and/or CLASSIFIED material or equipment occur at the supplier's site or premises?
196+
197+
- Les installations du fournisseur serviront-elles à la production (fabrication et/ou réparation et/ou modification) de matérial
198+
199+
PROTÉGÉ et/ou CLASSIFIÉ?
200+
201+
## PRODUCTION
202+
203+
- [ ] Yes Oui
204+
205+
- [x] No Non
206+
207+
## PART C - SAFEGUARDS (SUPPLIER) / PARTIE C - MESURES DE PROTECTION (FOURNISSEUR)
208+
209+
11. a) Will the supplier be required to receive and store PROTECTED and/or CLASSIFIED information or assets on its site or premises?
210+
211+
- Le fournisseur sera-t-il tenu de recevoir et d'entreposer sur place des renseignements ou des biens PROTÉGÉS et/ou CLASSIFIÉS?
212+
213+
11. b) Will the supplier be required to safeguard COMSEC information or assets?
214+
215+
Le fournisseur sera-t-il tenu de protéger des renseignements ou des biens COMSEC?
216+
217+
INFORMATION / ASSETS / RENSEIGNEMENTS / BIENS
218+
219+
- [ ] Yes Oui
220+
221+
- [x] No Non
222+
223+
- [ ] Yes Oui
224+
225+
- [x] No Non
226+
227+
10. b) May unscreened personnel be used for portions of the work?
228+
229+
Du personnel sans autorisation sécuritaire peut-il se voir confier des parties du travail?
230+
231+
If Yes, will unscreened personnel be escorted:
232+
233+
Dans l'affirmative, le personnel en question sera-t-il escorté?
234+
235+
- [ ] Yes Oui
236+
237+
- [x] No Non
238+
239+
- [ ] Yes Oui
240+
241+
- [x] No Non
242+
243+
## PART B - PERSONNEL (SUPPLIER) / PARTIE B - PERSONNEL (FOURNISSEUR)
244+
245+
10. a) Personnel security screening level required / Niveau de contrôle de la sécurité du personnel requis
246+
247+
- [x] RELIABILITY STATUS COTE DE FIABILITÉ
248+
249+
- [ ] CONFIDENTIAL CONFIDENTIEL
250+
251+
- [ ] SECRET SECRET
252+
253+
- [ ] TOP SECRET TRÈS SECRET
254+
255+
- [ ] NATO CONFIDENTIAL NATO CONFIDENTIEL
256+
257+
- [ ] NATO SECRET NATO SECRET
258+
259+
- [ ] COSMIC TOP SECRET COSMIC TRÈS SECRET
260+
261+
- [ ] SITE ACCESS ACCÈS AUX EMPLACEMENTS
262+
263+
- [ ] TOP SECRET - SIGINT TRÈS SECRET - SIGINT
264+
265+
- 9.
266+
267+
- Will the supplier require access to extremely sensitive INFOSEC information or assets: Le fournisseur aura-t-il accès à des renseignements ou à des biens INFOSEC de nature extrêmement délicate?
268+
269+
Short Title(s) of material / Titre(s) abrégé(s) du matériel :
270+
271+
Document Number / Numéro du document :
272+
273+
- [ ] Yes Oui
274+
275+
- [x] No Non
276+
277+
Special comments:
278+
279+
Commentaires spéciaux :
280+
281+
NOTE: If multiple levels of screening are identified, a Security Classification Guide must be provided.
282+
283+
REMARQUE : Si plusieurs niveaux de contrôle de sécurité sont requis, un guide de classification de la sécurité doit être fourni.
284+
285+
- [ ] Not applicable
286+
287+
Security Classification / Classification de sécurité
288+
289+
UNCLASSIFIED

0 commit comments

Comments
 (0)