Skip to content
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

use ODT 'Author' style to specify author #327

Closed
wants to merge 18 commits into from
Closed

use ODT 'Author' style to specify author #327

wants to merge 18 commits into from

Conversation

petrul
Copy link

@petrul petrul commented Jun 20, 2018

this change allows the specification of the Author of the document also by using the 'Author' ODT Style (alternatively to the hard-to-access dc:initial-creator meta tag).

The 'Title' ODT Style is already used to allow the specification of the title of the document (alternatively to dc:title). This change extends the same logic for the Author.

(in libre office meta fields are either hard to access or downright missing in the GUI).

@petrul petrul changed the title merging release-7.44.0 to master use ODT 'Author' style to specify author Jun 20, 2018
@peterstadler
Copy link
Member

I fear something went wrong with this PR as there are no changes to the code? Or am I missing something?

@petrul
Copy link
Author

petrul commented Jun 20, 2018

yeap, sorry. A bit of a newcomer with github.

Just pushed the change, here is the commit in question:

d055cc6

Copy link
Member

@peterstadler peterstadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally without any errors! That's the good news ;)
The bad news is, it seems there is some dependent issue with multiple authors? I'm not familiar with the odt format, but my guess it we should be able to support this (or restrict to one)?

select="/office:document-content/office:body/office:text/text:p[@text:style-name='Author']"
/>
</xsl:when>
<xsl:when test="$META/office:meta/meta:initial-creator">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reproduce the old version you should probably only take the first text:p[@text:style-name='Title'] (see old line 116), hence this should be $META[1]/office:meta/meta:initial-creator

odt/odttotei.xsl Outdated
<xsl:when
test="/office:document-content/office:body/office:text/text:p[@text:style-name='Author']">
<xsl:value-of
select="/office:document-content/office:body/office:text/text:p[@text:style-name='Author']"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the odt format but I guess there might be several authors (see also next comment). So it's probably safest to pick only the first text:p[@text:style-name='Author']. Or we need to iterate over the authors when outputting these …

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed the old version only picked the first 'Title'-styled paragraph.

I see no reason for that. If the Title is streched on two lines, both should be taken.

Same rationale for the Author, especially given that one document might have several Authors

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but within the resulting TEI document there should be an <author> element for every author name (not several names within one <author> element).
Could you add (and push) the appropriate <xsl:for-each> loop to your branch (so the pull request will be updated)?

@petrul
Copy link
Author

petrul commented Feb 19, 2019

Hello again, sorry for the delay, I had completely forgotten XSLT.

As I had to dive again recently into this marvellous set of tags language, I could also fix your request to generate several elements inside the titleStmt, if there are several paragraphs in the .odt styled with 'Author'.

There are also a few additions, mainly taking care of special styles: Subtitle, Epigraph, Trailer etc which generate

HTML elements.

Petru Dimulescu and others added 7 commits February 19, 2019 22:21
… is already a symlink to convertei.

another fix should be proposed for peope who like having a generally available /usr/bin/odttotei symlink to wherever the stylesheets/bin is located.
some improvement over rendering epigraph, trailer...

also refactored so that the stylesheet play well with both fodt and odt office:document-content vs office:document
@hcayless
Copy link
Member

hcayless commented May 8, 2019

Council has reviewed this and we think the merge looks a bit messy because of subsequent commits, so Peter will look at implementing it. We agree with the request.

@martindholmes
Copy link
Contributor

@peterstadler to go ahead, but look carefully at each individual change; for example, <p class="subtitle"> seems a bit strange to me, unless I'm misunderstanding it.

@martinascholger
Copy link
Member

The Stylesheets group will have a look at it in the next meeting in October

@martindholmes
Copy link
Contributor

@sydb, @npcole and I looked at this today, and we believe that the original pull request has been severely muddied by additional commits to the same PR. It's also not clear whether @petrul did address @peterstadler's concerns about multiple authors, or the additional concern raised about multi-line titles. We suggest that each of these specific issues be raised as individual tickets and implemented.

odt/odttotei.xsl Outdated
@@ -877,7 +877,7 @@ of this software, even if advised of the possibility of such damage.
</xsl:template>

<xsl:template match="office:binary-data">
<binaryObject encoding="base64" mimeType="image/jpg">
<binaryObject id="{generate-id()}" encoding="base64" mimeType="image/jpg">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petrul — TEI does not have an @id attribute. You mean @xml:id, yes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for me it s a mystery why this commit ended up on this merge request, I just modified my own fork of tei-stylesheets and commited. I guess there's more to git than you can learn in a few years.

It these changes do not make sense for you, feel free to disregard this merge request.

@petrul
Copy link
Author

petrul commented Aug 22, 2022 via email

@raffazizzi
Copy link
Contributor

We couldn't merge this PR, but we plan to implement this later on, see #625

@raffazizzi raffazizzi closed this Sep 28, 2023
@raffazizzi raffazizzi added this to the Release 7.56.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants