themes: allow TODAY placeholder in `page_numbering_style`

This commit is contained in:
Sina Atalay 2024-06-20 15:56:09 +03:00
parent c8f33e9553
commit 93d2b3db4e
4 changed files with 11 additions and 7 deletions

View File

@ -242,10 +242,11 @@ class ThemeOptions(pydantic.BaseModel):
default="NAME - Page PAGE_NUMBER of TOTAL_PAGES", default="NAME - Page PAGE_NUMBER of TOTAL_PAGES",
title="Page Numbering Style", title="Page Numbering Style",
description=( description=(
"The style of the page numbering. The following placeholders can be used:" "The style of the page numbering. The following placeholders can be"
"\n- NAME: The name of the person\n- PAGE_NUMBER: The current page number" " used:\n- NAME: The name of the person\n- PAGE_NUMBER: The current page"
"\n- TOTAL_PAGES: The total number of pages\nThe default value is" " number\n- TOTAL_PAGES: The total number of pages\n- TODAY: Today's month"
" NAME - Page PAGE_NUMBER of TOTAL_PAGES." " and year (April 2024)\nThe default value is NAME - Page PAGE_NUMBER of"
" TOTAL_PAGES."
), ),
) )
disable_last_updated_date: bool = pydantic.Field( disable_last_updated_date: bool = pydantic.Field(

View File

@ -75,7 +75,8 @@
((* set page_numbering_style_placeholders = { ((* set page_numbering_style_placeholders = {
"NAME": cv.name, "NAME": cv.name,
"PAGE_NUMBER": "\\thepage{}", "PAGE_NUMBER": "\\thepage{}",
"TOTAL_PAGES": "\pageref*{LastPage}" "TOTAL_PAGES": "\pageref*{LastPage}",
"TODAY": today
} *)) } *))
\makeatletter \makeatletter
\let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle \let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle

View File

@ -75,7 +75,8 @@
((* set page_numbering_style_placeholders = { ((* set page_numbering_style_placeholders = {
"NAME": cv.name, "NAME": cv.name,
"PAGE_NUMBER": "\\thepage{}", "PAGE_NUMBER": "\\thepage{}",
"TOTAL_PAGES": "\pageref*{LastPage}" "TOTAL_PAGES": "\pageref*{LastPage}",
"TODAY": today
} *)) } *))
\makeatletter \makeatletter
\let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle \let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle

View File

@ -75,7 +75,8 @@
((* set page_numbering_style_placeholders = { ((* set page_numbering_style_placeholders = {
"NAME": cv.name, "NAME": cv.name,
"PAGE_NUMBER": "\\thepage{}", "PAGE_NUMBER": "\\thepage{}",
"TOTAL_PAGES": "\pageref*{LastPage}" "TOTAL_PAGES": "\pageref*{LastPage}",
"TODAY": today
} *)) } *))
\makeatletter \makeatletter
\let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle \let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle