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

Colon missing from NOTE when rendered as HTML #472

Closed
ghobona opened this issue Dec 6, 2022 · 13 comments
Closed

Colon missing from NOTE when rendered as HTML #472

ghobona opened this issue Dec 6, 2022 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@ghobona
Copy link

ghobona commented Dec 6, 2022

The generated HTML documents do not include colons when rendering notes. See attached screenshot.

This confuses readers. The word "NOTE" should immediately be followed by a colon ":" .

Screenshot 2022-12-06 at 17 09 16

@opoudjis opoudjis self-assigned this Dec 14, 2022
@opoudjis opoudjis added the enhancement New feature or request label Dec 14, 2022
@opoudjis opoudjis moved this to 🆕 New in Metanorma Dec 14, 2022
@opoudjis opoudjis moved this from 🆕 New to 🌋 Urgent in Metanorma Dec 14, 2022
@opoudjis opoudjis moved this from 🌋 Urgent to 🏗 In progress in Metanorma Dec 14, 2022
@opoudjis
Copy link
Contributor

@Intelligent2013 I'm going to do this right after release, adding : to all /note/name in Presentation XML. I'll need you to confirm that you are taking : off, if you're adding it.

I'm assuming in all of this that we universally put space or tab between /{block}/name and /{block}/{text}, and that punctuation like : needs to get inserted at the end of /{block}/name .

@ronaldtse
Copy link
Contributor

@opoudjis this seems to be a purely HTML output presentation issue. I don’t understand why the Presentation XML is affected.

@Intelligent2013
Copy link
Contributor

Currently, XSLT puts these characters after note/name:

  • BIPM: 'space'
  • IEEE: '—' (em dash, 2014hex)
  • GB, IHO, M3AAWG, OGC, UNECE, Ribose: ':'
  • ITU, NIST: ' – ' (en dash with spaces around, 2013hex)

I'm going to do this right after release, adding : to all /note/name in Presentation XML. I'll need you to confirm that you are taking : off, if you're adding it.

@opoudjis would you like to put : for OGC only, or update Presentation XML for all flavors?

@opoudjis
Copy link
Contributor

@ronaldtse This is why; we've allowed Pdf and Html to diverge, and they should not.

Yes, @Intelligent2013 , I'd like the delimiter to be in the Presentation XML.

@ronaldtse
Copy link
Contributor

@ronaldtse This is why; we've allowed Pdf and Html to diverge, and they should not.

Completely disagree. PDF and HTML are different types of media.

@opoudjis
Copy link
Contributor

opoudjis commented Dec 22, 2022

After a lot of debate, we'll realise the delimiters between labels and contents as XSLT stylesheets that will be included in the Presentation XML header, and that can be specific to an output type.

This needs to be extended to the delimiters between biblio-tag and reference that are currently included within biblio-tag.

So labels (/name, /biblio-tag) are considered Presentation XML content, but delimiters between them and following content are considered Presentation XML styling ,and shall be kept separate from Presentation XML content.

@opoudjis
Copy link
Contributor

opoudjis commented Dec 24, 2022

This is going to be the initial test case for this mode of Presentation XML.

I'm going to also be migrating rendering-specific content from /misc-container to /render

/render will have children /render/preprocess-xslt, which will contain raw XSLT to be applied to the current document. /preprocess-xslt will have a comma-delimited "format" attribute; if it is not set, it is applied to all formats, and if it is set, it is applied to the given format, with legal values (for now) html, doc, pdf.

So this issue will be resolved with the following, and because it does not have @format, you and I both apply it:

<render>
  <preprocess-xslt>
    <xsl:template match="xmlns:note/xmlns:name">
    ....

which is equivalent to your

<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">

I see you have a generic and parameterised piece of XSLT that does this already:

<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">
		<xsl:param name="sfx"/>
		<xsl:variable name="suffix">
			<xsl:choose>
				<xsl:when test="$sfx != ''">
					<xsl:value-of select="$sfx"/>
				</xsl:when>
				<xsl:otherwise>

						<xsl:text>:</xsl:text>

				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:if test="normalize-space() != ''">
			<xsl:apply-templates/>
			<xsl:value-of select="$suffix"/>
		</xsl:if>
	</xsl:template>

In the case of OGC, you don't include a sfx parameter, so NOTE as ":" appended. In ITU, you have <xsl:text>–</xsl:text>.

So what I am doing is grabbing that piece of XSLT, and applying it preemptively to my output, and also asking you to apply it to yours.

My question now is, are there any circumstances when you are populating that sfx parameter, that I need to be aware of?

@opoudjis
Copy link
Contributor

I will need to add

<xsl:template match="node() | @*">
    <xsl:copy>
        <xsl:apply-templates select="node() | @*"/>
    </xsl:copy>
</xsl:template>

to my XSLT run, so that the Presentation XML passes through. I am leaving it out of the Presentation XML inclusion, so you pick only the rendering rules as a priority.

@opoudjis
Copy link
Contributor

a.presentation 2.xml.zip

@Intelligent2013 This is the trial version including XSLT preprocessing. Please confirm that you can use it.

@opoudjis
Copy link
Contributor

@ronaldtse

Extending this "refactoring" to the whole of Metanorma is a big task, and one I encourage you to delegate the task to another developer.

@Intelligent2013
Copy link
Contributor

a.presentation 2.xml.zip

@Intelligent2013 This is the trial version including XSLT preprocessing. Please confirm that you can use it.

@opoudjis Confirm, I can use it.

@Intelligent2013
Copy link
Contributor

My question now is, are there any circumstances when you are populating that sfx parameter, that I need to be aware of?

@opoudjis no, the sfx parameter isn't using anywhere. At one time I did refactoring and this parameter is out of date.

@opoudjis
Copy link
Contributor

OK

I am going to close this ticket once you have confirmed this as done, @Intelligent2013. I am writing a separate ticket to roll this out across all flavours and all block types, but it will have to wait, since it will take a long time to implement, and I have more urgent tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

4 participants