View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017360 | Scribus | Scripter | public | 2025-01-01 11:00 | 2025-01-01 11:51 |
Reporter | ale | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | new | Resolution | open | ||
Product Version | 1.7.0.svn | ||||
Summary | 0017360: deprecate insertHtmlText() and replace it by one or several "better" functions with better arguments | ||||
Description | currently, insertHtmlText(): - can only insert content from files and not from strings - does not default to utf-8 as encoding - does not provide a way to set the encoding (and it's not clearly defined how the encoding is detected) - can insert content from any supported file format (i've tested it with a markdown file) - the type of the content depends on the extension of the file - in the UI the corresponding function is found under "import" and "get text", not "insert". i'd like to suggest to deprecate this function. in place of it, i'd like to propose a new function with several named optional arguments: insertFormattedText( source: the filename (path) or the content to be inserted [name=None]: the name of the target frame (by default the current selected frame) [encoding=None]: if not defined, the encoding is automatically detected from the content (if possible; the default should be utf-8) [format=None]: if not defined the format is guessed from the extension (default behavior is '.txt') [read_file=True]: if true, the source is a filename; otherwise, source contains the content to be inserted [style_prefix=None]: if None, the name of the frame is used; ) this having been said, if i recall correctly, some of the formats supported by scribus have a pop up asking for more settings. i still have to check if those differ between formats: if it's the case, it might be better to have one function per format... (if we need multiple functions, we might keep insertHtmlText() and complete it with the additional arguments) | ||||
Tags | No tags attached. | ||||
Patch | No | ||||