comparison doc/reference.txt @ 7864:b080cdb8b199

fix: document/fix wrapped HtmlProperty method. The wrapped method was not documented in reference.txt. It is now documented in reference.txt. The docstring documented that it would not break up long words. Fixed by adding break_long_words=False to prevent breaking string longer than the wrap length. Wrapping was breaking the hyperlinking of long urls. Added columns argument to set the wrap length (default 80 columns).
author John Rouillard <rouilj@ieee.org>
date Sun, 07 Apr 2024 15:27:18 -0400
parents 5cf8a7027595
children ee586ff074ed
comparison
equal deleted inserted replaced
7863:bd126f890279 7864:b080cdb8b199
3314 3314
3315 hyperlinked The same as msg.content.plain(hyperlink=1), but nicer:: 3315 hyperlinked The same as msg.content.plain(hyperlink=1), but nicer::
3316 3316
3317 "structure msg/content/hyperlinked" 3317 "structure msg/content/hyperlinked"
3318 3318
3319 wrapped Wraps long lines on the nearest whitespace. Like
3320 plain(), it takes ``escape`` and ``hyperlink``
3321 arguments. However, the defaults are to enable both
3322 escape and hyperlinks. It also takes a ``columns``
3323 argument set by default to 80.
3324
3319 field render an appropriate form edit field for the property - for 3325 field render an appropriate form edit field for the property - for
3320 most types this is a text entry box, but for 3326 most types this is a text entry box, but for
3321 Booleans it is a 3327 Booleans it is a
3322 tri-state yes/no/neither selection. This method may take some 3328 tri-state yes/no/neither selection. This method may take some
3323 arguments: 3329 arguments:
3335 selection. Defaults to on. 3341 selection. Defaults to on.
3336 3342
3337 rst only on String properties - render the value of the property 3343 rst only on String properties - render the value of the property
3338 as ReStructuredText (requires the :ref:`Docutils 3344 as ReStructuredText (requires the :ref:`Docutils
3339 module to be installed separately<install/docutils>`). 3345 module to be installed separately<install/docutils>`).
3346
3340 stext only on String properties - render the value of the property 3347 stext only on String properties - render the value of the property
3341 as StructuredText (requires the StructureText module to be 3348 as StructuredText (requires the StructureText module to be
3342 installed separately) (depricated, to be removed 3349 installed separately) (depricated, to be removed
3343 use rst or markdown instead). 3350 use rst or markdown instead).
3344 markdown only on String properties - render the value of the property 3351 markdown only on String properties - render the value of the property
3345 as Markdown (requires a :ref:`Markdown module to be 3352 as Markdown (requires a :ref:`Markdown module to be
3346 installed separately<install/markdown>`). 3353 installed separately<install/markdown>`).
3347 3354
3348 multiline only on String properties - render a multiline form edit 3355 multiline only on String properties - render a multiline form edit
3349 field for the property 3356 field for the property
3357
3350 email only on String properties - render the value of the property 3358 email only on String properties - render the value of the property
3351 as an obscured email address 3359 as an obscured email address
3360
3352 url_quote only on String properties. It quotes any characters in the 3361 url_quote only on String properties. It quotes any characters in the
3353 string so it is safe to use in a url. E.G. a space is 3362 string so it is safe to use in a url. E.G. a space is
3354 replaced with %20. 3363 replaced with %20.
3364
3355 confirm only on Password properties - render a second form edit field 3365 confirm only on Password properties - render a second form edit field
3356 for the property, used for confirmation that the user typed 3366 for the property, used for confirmation that the user typed
3357 the password correctly. Generates a field with name 3367 the password correctly. Generates a field with name
3358 "name:confirm". 3368 "name:confirm".
3369
3359 now only on Date properties - return the current date as a new 3370 now only on Date properties - return the current date as a new
3360 property 3371 property
3372
3361 reldate only on Date properties - render the interval between the date 3373 reldate only on Date properties - render the interval between the date
3362 and now 3374 and now
3375
3363 local only on Date properties - return this date as a new property 3376 local only on Date properties - return this date as a new property
3364 with some timezone offset, for example:: 3377 with some timezone offset, for example::
3365 3378
3366 python:context.creation.local(10) 3379 python:context.creation.local(10)
3367 3380
3368 will render the date with a +10 hour offset. 3381 will render the date with a +10 hour offset.
3382
3369 pretty Date properties - render the date as "dd Mon YYYY" (eg. "19 3383 pretty Date properties - render the date as "dd Mon YYYY" (eg. "19
3370 Mar 2004"). Takes an optional format argument, for example:: 3384 Mar 2004"). Takes an optional format argument, for example::
3371 3385
3372 python:context.activity.pretty('%Y-%m-%d') 3386 python:context.activity.pretty('%Y-%m-%d')
3373 3387
3380 3394
3381 Number properties - takes a printf style format argument 3395 Number properties - takes a printf style format argument
3382 (default: '%0.3f') and formats the number accordingly. 3396 (default: '%0.3f') and formats the number accordingly.
3383 If the value can't be converted, '' is returned if the 3397 If the value can't be converted, '' is returned if the
3384 value is ``None`` otherwise it is converted to a string. 3398 value is ``None`` otherwise it is converted to a string.
3399
3385 popcal Generate a link to a popup calendar which may be used to 3400 popcal Generate a link to a popup calendar which may be used to
3386 edit the date field, for example:: 3401 edit the date field, for example::
3387 3402
3388 <span tal:replace="structure context/due/popcal" /> 3403 <span tal:replace="structure context/due/popcal" />
3389 3404
3444 by default. (Note creation date is never unset, but you 3459 by default. (Note creation date is never unset, but you
3445 get the idea.) If you combine NoneFirst with 3460 get the idea.) If you combine NoneFirst with
3446 ``reverse=True`` the meaning of NoneFirst is inverted: 3461 ``reverse=True`` the meaning of NoneFirst is inverted:
3447 True sorts None/unset at the end and False sorts at the 3462 True sorts None/unset at the end and False sorts at the
3448 beginning. 3463 beginning.
3464
3449 reverse only on Multilink properties - produce a list of the linked 3465 reverse only on Multilink properties - produce a list of the linked
3450 items in reverse order 3466 items in reverse order
3467
3451 isset returns True if the property has been set to a value 3468 isset returns True if the property has been set to a value
3452 =========== ================================================================ 3469 =========== ================================================================
3453 3470
3454 __ https://docs.python.org/2/library/time.html 3471 __ https://docs.python.org/2/library/time.html
3455 3472

Roundup Issue Tracker: http://roundup-tracker.org/