<commit_before># -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, <NAME>

# Import from lpod
from lpod.document import odf_new_document_from_type
from lpod.document import odf_create_paragraph, odf_create_heading
from lpod.document import odf_create_list, odf_create_list_item
from lpod.document import odf_create_note, odf_create_annotation

# Creation of the document
document = odf_new_document_from_type('text')
body = document.get_body()

# Add Heading
heading = odf_create_heading(level=1, u'Headings, Paragraph, Liste and Notes')
body.append_element(heading)

# Add Paragraph 
paragraph = odf_create_paragraph(text = u'lpOD generated Document')
body.append_element(paragraph)

# A list
my_list = odf_create_list([u'thé', u'café'])
item = odf_create_list_item(u'chocolat')
my_list.append_element(item)

# Footnote, endnote, annotations
footnote = odf_create_note(u'1', id='note1', body=u'A footnote')
paragraph = odf_create_paragraph(u'A paragraph with a footnote.')

##offset = len(u'A paragraph')
##paragraph.wrap_text(footnote, offset=offset)
##body.append_element(paragraph)

paragraph.add_footnote(footnote, place="xxx")
paragraph.add_endnote(footnote, place=34)
paragraph.add_annotation(footnote, place='')
paragraph.add_note(footnote, type="footnote", place="")

# Save
document.save('basic-text.odt', pretty=True)<commit_msg>start doc/cookbook/presentation.py<commit_after># -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, <NAME>

# Import from lpod
from lpod.document import odf_new_document_from_type
from lpod.document import odf_create_paragraph, odf_create_heading
from lpod.document import odf_create_list, odf_create_list_item
from lpod.document import odf_create_note, odf_create_annotation

# Creation of the document
document = odf_new_document_from_type('presentation')
body = document.get_body()

# DrawPage 1
page = odf_create_drawpage('page1')


# Add a frame with a draw_text-box 
heading = odf_create_heading(1, text=u'Headings, Paragraph, Liste and Notes')
body.append_element(heading)
text-element = odf_create_paragraph(text = u'First SlideShow')

draw_text-box1 = odf_create_text-box(text-elment, height, width=, x=, y=, image_style=)

draw_text-box1 = odf_create_text-box(text-elment, frame=frame)

draw_text-box1 = odf_create_text-box(text-elment, 
                                     frame_size=('5cm', '100mm'), 
                                     frame_position=('1cm', '0cm'),
                                     image_style=xxx)


page.append_element(draw_text-box)

# fill draw_text-box with a paragraph
text-element = odf_create_list([u'thé', u'café'])
text-frame = odf_create_text_frame(text-elment, height, width=, x=, y=)
page.append_element(text-frame)


#existe en mémoir n'a pas été sérialisé
image = odf_create_image(image_uri="toto.jpg", image_style=xxx, link=yes)

draw_image = odf_create_image_frame(image_uri="toto.jpg", 
                                    frame_size=('5cm', '100mm'), 
                                    frame_position=('1cm', '0cm'),
                                    image_style=xxx,
                                    link=yes)





draw_image = odf_create_image(uri, height, width=, x=, y=, image_style=)
page.append(draw_image)

# introspection
page.get_frames()

# DrawPage 2
page = body.()

# Add Heading
heading = odf_create_heading(level=1, u'Headings, Paragraph, Liste and Notes')
body.append_element(heading)

# Add Paragraph 
paragraph = odf_create_paragraph(text = u'lpOD generated Document')
body.append_element(paragraph)

# A list
my_list = odf_create_list([u'thé', u'café'])
item = odf_create_list_item(u'chocolat')
my_list.append_element(item)

# Save
document.save('presentation.odp', pretty=True)
{'fraction_non_alphanumeric': 0.11439312567132116, 'fraction_numerical': 0.009398496240601503, 'mean_word_length': 4.568011958146487, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5690039', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1269, 'n_words': 253}