-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The subtitle is omitted when writing rST #4803
Comments
in case of input formats like ODT or DOCX this doesn't change the existing interface. this change will cause the subtitle not to be rendered within the `$title$` template variable in the case of input formats which parse the subtitle as a plain block
Making the pattern match less fragile is definitely a good
idea, unless we just decide to put title and subtitle in
the template.
As for putting it in the template: I believe the
reason I did it this way is that rST wants the number
of '=' or '-' characters underlining a title or
subtitle to match the length of the title or subtitle
text. There's no way to ensure this in the template.
For example, if the template has
$title$
=======
you'll always get 7 '=' signs, even if the title
is shorter or longer. I'm open to thoughts about
how we might do it differently.
|
The RST writer could populate the |
Mauro Bieg <notifications@github.com> writes:
The RST writer could populate the `title` variable with `mytitle\n=======`
That's true, but I think @danse wanted the subtitle
variable to be by itself (without dashes).
Maybe we could have a `titleblock` variable that gets
populated with
title
=====
subtitle
--------
but keep `title` and `subtitle` as they are. That
would give you a lot of options in a template.
|
aha! yes, now i get it. I would opt for a dedicated variable. I would call it |
In the markdown template we use `titleblock`, so I
think that's the best one to use:
$if(titleblock)$
$titleblock$
$endif$
Francesco Occhipinti <notifications@github.com>
writes:
… aha! yes, now i get it. I would opt for a dedicated variable. I would call it `$titlerst`, or `$title-rst`, or `$titleRST`, you know the style of meta variables better than me. This convention would be easy to use also in other formats when we want a smarter rendering of some metadata. I'd still keep `$title` and `$subtitle` available for the templates. If this solution works for you i will update the pull request tomorrow
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#4803 (comment)
|
after this commit use `$titleblock` in order to get what was contained in `$title` before, that is a title and subtitle rendered according to the official rST method http://docutils.sourceforge.net/docs/user/rst/quickstart.html#document-title-subtitle. from now on, the `$title` and `$subtitle` metadata are available and they simply carry the metadata values
In the case of rST the subtitle is rendered within the
$title
variable rather than being handled as a separate template field. Besides this, the rendering of the subtitle is fragile due to a pattern match which causes subtitles to be discarded in the many cases when the structure of the metadata field does not match the pattern. For instance given the following template and native document, no subtitle is rendered:I found that title and subtitle are enclosed in
MetaInlines
at least when coming from a.docx
like sottotitolo.docx, so i would at least add a pattern match forMetaInlines
and drop thePlain
container.I also found confusing not to be able to use
$subtitle$
in a template, and it's important for my team to render a subtitle within an highlight directive rather than as a bordered title like it's currently hardcoded in the rST writer, so i would change this logic in order to have$subtitle$
as a regular template variable.I'd be happy to learn about reasons which might have caused the choices above and could affect the way we are planning to address this
The text was updated successfully, but these errors were encountered: