Refactor data availability section: add doc-version mode, display-dat…#1145
Merged
robertatakenaka merged 1 commit intoscieloorg:masterfrom Mar 19, 2026
Conversation
…a-availability with anchor links, and fn rendering templates
b0b0222 to
ad15940
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors how the HTML generator v3.0 renders “data availability” content by introducing a new decision mode that can render either an anchor link (when an @id + heading is present) or fall back to the existing inline rendering, aiming to reduce duplicated content and improve navigation.
Changes:
- Added a
doc-version-data-availabilitytemplate to unify handling forarticleandsub-article. - Switched
body | backdata-availability rendering to a newdisplay-data-availabilitymode that can output an anchor link instead of inline content. - Added dedicated
fntemplates inmode="data-availability"to renderlabelandpwith specific formatting.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div class="row"> | ||
| <div class="col-md-12 col-sm-12"> | ||
| <p> | ||
| <a href="#{@id}"> |
Comment on lines
+47
to
+48
| <a href="#{@id}"> | ||
| <xsl:apply-templates select="label | title" /> |
Comment on lines
+48
to
+49
| <xsl:apply-templates select="label | title" /> | ||
| </a> |
|
|
||
| <xsl:template match="fn|sec" mode="display-data-availability"> | ||
| <xsl:choose> | ||
| <xsl:when test="@id and (.//label or .//title)"> |
Comment on lines
+41
to
+57
| <xsl:template match="fn|sec" mode="display-data-availability"> | ||
| <xsl:choose> | ||
| <xsl:when test="@id and (.//label or .//title)"> | ||
| <div class="row"> | ||
| <div class="col-md-12 col-sm-12"> | ||
| <p> | ||
| <a href="#{@id}"> | ||
| <xsl:apply-templates select="label | title" /> | ||
| </a> | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </xsl:when> | ||
| <xsl:otherwise> | ||
| <xsl:apply-templates select="." mode="data-availability"/> | ||
| </xsl:otherwise> | ||
| </xsl:choose> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que esse PR faz?
Refatora a renderização da seção de disponibilidade de dados no HTML generator v3.0, introduzindo:
doc-version-data-availabilityque permite processararticleesub-articlede forma unificada, delegando parabodyeback.display-data-availabilityque, quando o elemento (fnousec) possui@idelabeloutitle, exibe um link âncora (<a href="#{@id}">) em vez de renderizar o conteúdo completo inline. Caso contrário, delega para o mododata-availabilityexistente.fnno mododata-availability, tratandolabel(com<strong>) epseparadamente.Onde a revisão poderia começar?
No template
match="fn|sec" mode="display-data-availability", que contém a lógica principal de decisão entre exibir link âncora ou conteúdo completo.Como este poderia ser testado manualmente?
<fn fn-type="data-availability">com@id,labelep— verificar se aparece o link âncora apontando para a seção correspondente.<sec sec-type="data-availability">aninhado em outrosec— verificar o mesmo comportamento de link.fnde data availability sem@idou semlabel/title— verificar se o conteúdo é renderizado inline (fallback para mododata-availability).sub-articlepara validar que o novo mododoc-version-data-availabilityprocessa corretamente.Algum cenário de contexto que queira dar?
Anteriormente, os elementos de data availability eram sempre renderizados inline no modo
data-availability. Com essa mudança, elementos que possuem@ide heading (label/title) passam a exibir apenas um link âncora, evitando duplicação de conteúdo e melhorando a navegação no HTML gerado.Screenshots
N/A
Quais são tickets relevantes?
#1144
Referências