174 Commits

Author SHA1 Message Date
Kovid Goyal
6553380eb1
Fix various docs ref bugs 2025-02-14 11:41:26 +05:30
Kovid Goyal
711edc6c7c
string changes 2025-02-12 22:00:25 +05:30
Charles Haley
5cbb284ada Document how templates can be used with the calibre:: URL scheme. 2025-02-12 13:56:27 +00:00
Kovid Goyal
a6fda5e749
String changes 2025-01-22 18:57:14 +05:30
Charles Haley
92078b53c8 Updates to the manual. NB: I used references like :ref:ff_func gui.rst. but don't know if they work. 2025-01-22 11:40:51 +00:00
Kovid Goyal
4e097f7e4b
Implement ffsum 2024-11-21 08:08:32 +05:30
Charles Haley
258f1ca250 Now use :ffsum: 2024-11-20 13:37:51 +00:00
Charles Haley
87d63a6d44 Various improvements 2024-11-20 13:36:16 +00:00
Kovid Goyal
c68620f7b0
string changes 2024-11-20 08:12:55 +05:30
Kovid Goyal
a87442b78c
Fix some refs 2024-11-19 08:29:00 +05:30
Charles Haley
bef0bf712a Changes to the template documentation.
I took out the inline documentation, changing it to reference the generated documentation. I also added a lot of :ref:.

I'm unable to verify that the changes work or that I didn't break something.
2024-11-18 17:55:45 +00:00
Charles Haley
45516e9803 Changes to/involving template_lang.rst
1. Alphabetize the function list in Single Function Mode
2. Add some text explaining why the documentation have 'value' as the first parameter but the calls don't.
3. Change the first parameter of some functions to 'value' and add them to the list of SFM functions.
2024-11-15 10:43:41 +00:00
Kovid Goyal
a70e028fb6
Use ffdoc in template_lang.rst
Also dont include :ffdoc: in .po file
2024-11-15 12:01:12 +05:30
Kovid Goyal
c55e66a40a
Check how :ffdoc: works for more complex functions
We need to add a parameter to set output indentation otherwise
sub lists and code blocks break the outer list.
2024-11-11 10:48:24 +05:30
Kovid Goyal
6458b10f4b
Add a new RST role :ffdoc: to insert the generated RST markup for a formatter function
Needs testing to ensure that it works when called in contexts likea
bulleted list, not sure how well the generated markup works when place
after a bullet.
2024-11-11 10:29:39 +05:30
Charles Haley
7998e6993d Enhancement #2086801: Add note about non-English dates to format_date() documentation. 2024-11-06 20:15:55 +00:00
Kovid Goyal
c74dd657d4
string changes 2024-10-29 05:29:54 +05:30
Charles Haley
3f53434867 Improvements to the has_notes() template function:
- Return the list of item values with notes if the empty string is passed as the value
- Add documentation to the template language page.
2024-10-28 13:15:32 +00:00
Charles Haley
8b756df123 Ooops -- forgot to change field_inlist to inlist_field in the template tester's highlighter and in a few places in the documentation. 2024-10-23 16:39:03 +01:00
Charles Haley
1e766f8843 Changes to use a suffix instead of a prefix for 'field' functions and operators. 2024-10-22 13:56:34 +01:00
Charles Haley
0e3f821cbb We're starting to get several functions and operators that directly operate on fields. I decided to use a naming convention where they begin with "field_". This commit changes the existing function format_date_field() to field_format_date(), adding an alias for the original name for compatibility. 2024-10-21 23:24:55 +01:00
Charles Haley
b938f2500f New template operator 'field_inlist'. It operates directly on data in a multi-valued field instead of converting the field to a string then splitting it. 2024-10-21 16:47:43 +01:00
Kovid Goyal
1440a49cda
string changes 2024-10-20 13:57:35 +05:30
Charles Haley
4f46ae4707 New formatter function 'field_list_count('lookup_name')': returns the length of the multi-valued field 'lookup_name' without first converting it to a string. This is much faster than the existing function list_count() 2024-10-18 18:17:15 +01:00
Charles Haley
903f08d50b Add is_dark_mode() template function 2024-09-24 19:27:57 +01:00
Charles Haley
8e3c936833 1) Fix plain_text not working in template get_note() function
2) Add documentation for get_note()
2024-09-12 11:24:55 +01:00
goodmost
77c1844256 chore: remove repetitive words
Signed-off-by: goodmost <zhaohaiyang@outlook.com>
2024-03-19 20:28:18 +08:00
Kovid Goyal
04adea1b10
string changes 2024-02-12 15:16:01 +05:30
Charles Haley
fa9061660e
Enhancement 2043330: Template function to fetch links
I put this in notes to avoid any hassle with collisions with the other new template functions.
2023-11-13 19:21:44 +05:30
Charles Haley
a27d0b93db New template function: format_date_field(). This function is much faster than format_date() because it avoids a round-trip conversion of date -> string -> date. 2023-09-16 12:41:27 +01:00
Charles Haley
1807998cc8
Follow the string change made in commit a1a8c92 2023-07-23 09:10:14 +05:30
Kovid Goyal
bb3bb53270
string changes 2023-05-30 19:35:12 +05:30
Charles Haley
942bceaa61 Improvements to template function identifier_in_list() 2023-05-09 18:29:30 +01:00
Charles Haley
6760f58385 Improvements to new formatter functions has_extra_files() and extra_file_names().
Provide the option of using a regular expression to filter the files before counting or returning the names.
2023-04-27 15:47:40 +01:00
Charles Haley
d0ba1ada16 Fix for the string changes fix for this file. Both the original and the changed file were incorrect. 2023-04-24 21:05:01 +01:00
Kovid Goyal
8a450c458a
String changes 2023-04-24 23:07:32 +05:30
Charles Haley
cdc4a0a4d3 The formatter functions to support extra book files. 2023-04-24 11:31:40 +01:00
chocolatechipcats
47d446f799
Plugboard section in template_lang
Moved the plugboard section up (just below the custom column section) and clarified that all modes can be used for it.
2023-04-07 17:13:40 -03:00
Kovid Goyal
d2158d75b9
string changes 2023-01-31 12:24:18 +05:30
Kovid Goyal
21994332d6
... 2023-01-18 07:40:39 +05:30
Charles Haley
21e8b06813 New template function: switch_if() 2023-01-06 15:38:29 +00:00
Charles Haley
f33f902a52 Small correction to the GPM language grammar. 2022-12-19 11:01:37 +00:00
Charles Haley
096579e13b Formatter: Quick pass over messages and documentation. 2022-10-17 16:51:51 +01:00
Kovid Goyal
dd8d3bfeef
Cleanup previous PR 2022-10-17 20:11:16 +05:30
un-pogaz
02b2811892 chaley recommandation 2022-10-17 14:22:19 +02:00
un-pogaz
e7cc30b3a9 add doc 2022-10-16 15:01:39 +02:00
Charles Haley
9b68f5c89a Three changes to template processing:
1) If the user presses ESC, ask "are you sure" if the template has changed.
2) Fix syntax highlighting of comments
3) Improve the python template example in the template docs, better using the new_api.
2022-10-12 11:24:49 +01:00
Charles Haley
594e152242 Changed python templates to use a context object. Updated the documentation and the tests. 2022-10-11 17:11:40 +01:00
Kovid Goyal
ffea14db35
cleanup previous PR 2022-10-11 20:13:02 +05:30
Charles Haley
42726c5e0f Python templates, as discussed at length in https://www.mobileread.com/forums/showthread.php?t=349525.
I think this is stable, usable, and very close to finished, but I will probably need to react fo feedback.
2022-10-10 16:54:21 +01:00