Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
009ae3f
Cria a pasta v3.0 contendo XSL que incluem o arquivo XSL corresponden…
robertatakenaka Dec 12, 2022
9ca7a0d
Reescreve os templates para trocar H1 por H3
robertatakenaka Dec 12, 2022
79c2a0c
Altera templates que apresentam autores
robertatakenaka Dec 12, 2022
eb000a4
Troca h1 por h3
robertatakenaka Dec 12, 2022
8364333
Modifica atributos dos links que abrem um modal
robertatakenaka Dec 12, 2022
3e7f98d
Altera os atributos do link que faz cópia do DOI do artigo
robertatakenaka Dec 13, 2022
4172e9f
Troca h1 para h3, h2 para h4, h3 para h5
robertatakenaka Dec 13, 2022
bb9daa7
Modifica atributos de links presentes em modal
robertatakenaka Dec 13, 2022
4a8e89d
Aplicação de design system em elementos a, ul, logo acesso aberto, etc
robertatakenaka Dec 13, 2022
bc7439d
Adiciona novos parâmetros:
robertatakenaka Dec 13, 2022
7664212
Troca h1 por h3
robertatakenaka Dec 13, 2022
70fbf60
Troca h4 por h5 e corrige botão 'close'
robertatakenaka Dec 13, 2022
1cf0719
XSL root para a versão 3.0
robertatakenaka Dec 13, 2022
05dd994
Aplica Design System aos modais
robertatakenaka Jan 16, 2023
6902b33
Garante a existência de um espaço após doi
robertatakenaka Jan 16, 2023
a39dfe9
Modifica os atributos do elemento a (link) que há no thumbnail de fig…
robertatakenaka Jan 16, 2023
f218788
Adiciona `<meta name="viewport" content="width=device-width, initial-…
robertatakenaka Jan 16, 2023
6fd50a0
Modifica os links entre as menções de notas e referências bibliográfi…
robertatakenaka Jan 16, 2023
a1bf1fb
Modifica htmlgenerator para gerar os htmls com a versão 3.0
robertatakenaka Jan 16, 2023
cf2bfa1
voltar à versão anterior, pois mudanças aplicadas deveriam ter sido f…
robertatakenaka Jan 17, 2023
1bd7472
Faz correções na aplicação do design system
robertatakenaka Jan 17, 2023
b47255b
Adiciona html v3.0 (design system)
robertatakenaka Jan 18, 2023
379295d
Evita que conteúdo de xref fique com `sup` excedente
robertatakenaka Jan 18, 2023
4cc1512
Adiciona os HTML gerados pela versão 3.0
robertatakenaka Feb 1, 2023
49efeee
Atualiza a versão do Design System
robertatakenaka Feb 1, 2023
9a9ee21
Remove link de retorno para a menção da nota
robertatakenaka Feb 1, 2023
ee9d8ee
Ajusta a apresentação de xref e elementos associados (fn, author-note…
robertatakenaka Feb 1, 2023
2de0754
Ajustes no código / testes para corrigir testes quebrados
robertatakenaka Feb 1, 2023
c206fbe
Corrige o link para a versão "original" de graphic
robertatakenaka Feb 16, 2023
047cf32
Ajusta o path dos arquivos html de controle de mudança
robertatakenaka Feb 16, 2023
97ddbe2
Adiciona dados de afiliação ocultos no html para adicionar link para …
robertatakenaka Feb 16, 2023
a2aa22d
Adiciona dados de afiliação ocultos no html para adicionar link para …
robertatakenaka Feb 16, 2023
89520a3
Corrige o nome do módulo que contém a classe para manipular os dados …
robertatakenaka Feb 16, 2023
2418b5e
Remove item duplicado
robertatakenaka Feb 16, 2023
10cd701
Altera versão para 3.1.0
robertatakenaka Feb 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packtools/catalogs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
'HTML_GEN_XSLTS': {
'root-html-1.2.xslt': os.path.join(_CWD, 'htmlgenerator/root-html-1.2.xslt'),
'root-html-2.0.xslt': os.path.join(_CWD, 'htmlgenerator/root-html-2.0.xslt'),
'root-html-3.0.xslt': os.path.join(_CWD, 'htmlgenerator/root-html-3.0.xslt'),
},
'HTML_GEN_BOOTSTRAP_CSS_PATH': os.path.join(_CWD,
'htmlgenerator/v3.0/scielo.parati.design/aberto-ds-scielo/dist/version/1.1.3/css/bootstrap.css'),
'HTML_GEN_ARTICLE_CSS_PATH': os.path.join(_CWD,
'htmlgenerator/v3.0/scielo.parati.design/aberto-ds-scielo/dist/version/1.1.3/css/article.css'),
'HTML_GEN_DEFAULT_PRINT_CSS_PATH': os.path.join(_CWD,
'htmlgenerator/static/scielo-bundle-print.css'),
'HTML_GEN_DEFAULT_CSS_PATH': os.path.join(_CWD,
Expand Down
10 changes: 10 additions & 0 deletions packtools/catalogs/htmlgenerator/root-html-3.0.xslt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="v3.0/article.xsl"/>

</xsl:stylesheet>
15 changes: 5 additions & 10 deletions packtools/catalogs/htmlgenerator/v2.0/article-text-xref.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
</span>
</xsl:template>

<xsl:template match="text()" mode="xref">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="*" mode="xref">
<xsl:apply-templates select="*|text()" mode="xref"/>
</xsl:template>
Expand All @@ -144,7 +148,7 @@
<xsl:template match="fn/label" mode="xref">
<strong class="fn-title"><xsl:apply-templates select="*|text()" mode="xref"/></strong>
</xsl:template>

<xsl:template match="ref" mode="xref">
<xsl:variable name="url"><xsl:apply-templates select="." mode="url"></xsl:apply-templates></xsl:variable>
<xsl:if test="label">
Expand All @@ -159,16 +163,7 @@
</xsl:if>

</xsl:template>

<xsl:template match="mixed-citation" mode="xref">

<xsl:apply-templates select="*|text()" mode="xref"/>
</xsl:template>

<xsl:template match="mixed-citation//*" mode="xref">
<xsl:apply-templates select="*|text()" mode="xref"/>
</xsl:template>

<xsl:template match="fn//ext-link" mode="xref">
<xsl:apply-templates select="."></xsl:apply-templates>
</xsl:template>
Expand Down
2 changes: 1 addition & 1 deletion packtools/catalogs/htmlgenerator/v2.0/article.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,4 @@
<a id="shorten" href="#" class="short-link"><span class="sci-ico-link"/></a>
</h1>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>
1 change: 1 addition & 0 deletions packtools/catalogs/htmlgenerator/v2.0/generic-history.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name="related_preprint" select="//related-article[@related-article-type='preprint']"/>

<xsl:template match="article-meta | sub-article | response" mode="generic-history">
<xsl:if test=".//history">
<div class="articleSection">
Expand Down
22 changes: 13 additions & 9 deletions packtools/catalogs/htmlgenerator/v2.0/html-modals.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
<xsl:apply-templates select="p | sec | body/p | body/sec" mode="graphic-modal"/>
</xsl:template>

<xsl:template match="article" mode="modal-header-content">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&#xd7;</span>
<span class="sr-only">
<xsl:apply-templates select="." mode="interface">
<xsl:with-param name="text">Close</xsl:with-param>
</xsl:apply-templates>
</span>
</button>
<h4 class="modal-title"><xsl:value-of select="$graphic_elements_title"/></h4>
</xsl:template>

<xsl:template match="article" mode="modal-grouped-figs-tables-schemes">
<!--
Modal que apresenta juntos figuras, tabelas e fórmulas presentes
Expand All @@ -63,15 +75,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&#xd7;</span>
<span class="sr-only">
<xsl:apply-templates select="." mode="interface">
<xsl:with-param name="text">Close</xsl:with-param>
</xsl:apply-templates>
</span>
</button>
<h4 class="modal-title"><xsl:value-of select="$graphic_elements_title"/></h4>
<xsl:apply-templates select="." mode="modal-header-content"/>
</div>
<div class="modal-body">
<ul class="nav nav-tabs md-tabs" role="tablist">
Expand Down
52 changes: 52 additions & 0 deletions packtools/catalogs/htmlgenerator/v3.0/article-meta-abstract.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="../v2.0/article-meta-abstract.xsl"/>

<xsl:template match="article" mode="create-anchor-and-title-for-abstracts-without-title">
<xsl:variable name="q_titles" select="count(.//abstract[title])+count(.//trans-abstract[title])"/>
<xsl:if test="$q_titles = 0">
<xsl:variable name="q_abstracts" select="count(.//abstract[.//text()])+count(.//trans-abstract[.//text()])"/>

<!-- obtém o título traduzido para Abstracts ou Abstract -->
<xsl:variable name="title">
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">
<xsl:choose>
<xsl:when test="$q_abstracts=1">Abstract</xsl:when>
<xsl:otherwise>Abstracts</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:variable>

<!-- insere a âncora e o título -->
<div class="articleSection" data-anchor="{$title}">
<h3 class="articleSectionTitle"><xsl:value-of select="$title"/></h3>
</div>
</xsl:if>
</xsl:template>

<xsl:template match="abstract/sec/title | trans-abstract/sec/title">
<h4><xsl:apply-templates select="*|text()"/></h4>
</xsl:template>

<xsl:template match="abstract[title] | trans-abstract[title]" mode="anchor-and-title">
<!-- Apresenta a âncora e o título, ou seja, Abstract, Resumo, ou Resumen -->

<!-- âncora -->
<xsl:attribute name="class">articleSection</xsl:attribute>
<xsl:attribute name="data-anchor"><xsl:apply-templates select="." mode="title"/></xsl:attribute>
<xsl:if test="@xml:lang='ar'">
<xsl:attribute name="dir">rtl</xsl:attribute>
</xsl:if>

<!-- título -->
<h3>
<xsl:attribute name="class">articleSectionTitle</xsl:attribute>
<xsl:apply-templates select="." mode="title"></xsl:apply-templates>
</h3>
</xsl:template>
</xsl:stylesheet>
105 changes: 105 additions & 0 deletions packtools/catalogs/htmlgenerator/v3.0/article-meta-contrib.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="../v2.0/article-meta-contrib.xsl"/>

<xsl:template match="article" mode="contrib-group">
<div>
<xsl:attribute name="class">scielo__contribGroup</xsl:attribute>
<xsl:apply-templates select="front/article-meta//contrib-group"/>
</div>
</xsl:template>

<xsl:template match="sub-article" mode="contrib-group">
<div>
<xsl:attribute name="class">scielo__contribGroup</xsl:attribute>
<xsl:apply-templates select="front-stub/contrib-group | front/contrib-group"></xsl:apply-templates>
<xsl:if test="not(.//contrib) and ../@article-type='translation'">
<xsl:apply-templates select="$article//article-meta//contrib"></xsl:apply-templates>
</xsl:if>
</div>
</xsl:template>

<xsl:template match="article-meta/contrib-group | front/contrib-group | front-stub/contrib-group">
<xsl:variable name="id"><xsl:apply-templates select="." mode="modal-id"></xsl:apply-templates></xsl:variable>
<xsl:apply-templates select="contrib[@contrib-type='author']" mode="article-meta-contrib"/>
<xsl:if test="contrib/*[name()!='name' and name()!='collab']">
<a href="" class="btn btn-secondary btn-sm outlineFadeLink" data-bs-toggle="modal"
data-bs-target="#ModalTutors{$id}">
<xsl:apply-templates select="." mode="interface">
<xsl:with-param name="text">About the author<xsl:if test="count(contrib[@contrib-type='author'])&gt;1">s</xsl:if></xsl:with-param>
</xsl:apply-templates>
</a>
</xsl:if>
</xsl:template>

<xsl:template match="contrib" mode="article-meta-contrib">
<xsl:variable name="id">
<xsl:value-of select="position()"/>
</xsl:variable>
<div class="dropdown">
<button id="contribGroupTutor{$id}">
<xsl:attribute name="class">btn btn-secondary dropdown-toggle</xsl:attribute>
<xsl:attribute name="type">button</xsl:attribute>
<xsl:attribute name="data-bs-toggle">dropdown</xsl:attribute>
<xsl:attribute name="aria-expanded">false</xsl:attribute>
<xsl:choose>
<xsl:when test="$ABBR_CONTRIB='true'">
<xsl:apply-templates select="name|collab|on-behalf-of" mode="abbrev"/>
</xsl:when>
<xsl:otherwise><xsl:apply-templates select="name|collab|on-behalf-of"/></xsl:otherwise>
</xsl:choose>
</button>
<xsl:apply-templates select="." mode="contrib-dropdown-menu">
<xsl:with-param name="id">
<xsl:value-of select="$id"/>
</xsl:with-param>
</xsl:apply-templates>
</div>
</xsl:template>


<xsl:template match="contrib" mode="contrib-dropdown-menu">
<xsl:param name="id"/>
<xsl:if test="role or xref or contrib-id or bio">
<ul class="dropdown-menu" role="menu" aria-labelledby="contribGrupoTutor{$id}">
<xsl:apply-templates select="." mode="contrib-dropdown-menu-general"/>
<xsl:apply-templates select="xref[@ref-type='corresp']" mode="contrib-dropdown-menu-corresp"/>
</ul>
</xsl:if>
</xsl:template>

<xsl:template match="contrib" mode="contrib-dropdown-menu-general">
<xsl:if test="role or xref[@ref-type!='corresp'] or contrib-id or bio">
<li>
<xsl:apply-templates select="role | bio"/>
<xsl:apply-templates select="xref[@ref-type!='corresp']" mode="contrib-dropdown-menu"/>
<xsl:apply-templates select="contrib-id"/>
</li>
</xsl:if>
</xsl:template>

<xsl:template match="*" mode="contrib-dropdown-menu-corresp">
<xsl:apply-templates select="*|text()"/>
</xsl:template>

<xsl:template match="xref[@ref-type='corresp']" mode="contrib-dropdown-menu-corresp">
<xsl:variable name="rid"><xsl:value-of select="@rid"/></xsl:variable>
<!--
<li><div class="corresp"> <h3><sup>4</sup></h3> Autor para correspondência: <a href="mailto:author@gmail.com">author@gmail.com</a> </div></li>
-->

<li>
<xsl:apply-templates select="$article//*[@id=$rid]" mode="contrib-dropdown-menu-corresp"/>
</li>
</xsl:template>

<xsl:template match="author-notes/corresp" mode="contrib-dropdown-menu-corresp">
<div class="corresp">
<xsl:apply-templates select="*|text()"/>
</div>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="../v2.0/article-meta-permissions.xsl"/>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="../v2.0/article-meta-product.xsl"/>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="../v2.0/article-meta-related-article.xsl"/>

</xsl:stylesheet>
22 changes: 22 additions & 0 deletions packtools/catalogs/htmlgenerator/v3.0/article-meta.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="../v2.0/article-meta.xsl"/>

<xsl:template match="article-id[@pub-id-type='doi']" mode="display">
<xsl:variable name="link">https://doi.org/<xsl:value-of select="."/></xsl:variable>
<a href="{$link}" class="_doi" target="_blank"><xsl:value-of select="$link"/></a>
<xsl:text> <!-- espaço --></xsl:text>
<a
href="javascript:;"
class="btn btn-secondary btn-sm scielo__btn-with-icon--left copyLink"
data-clipboard-text="{$link}">
<span class="material-icons-outlined">link</span>
<xsl:apply-templates select="." mode="interface">
<xsl:with-param name="text">copy</xsl:with-param>
</xsl:apply-templates>
</a>
</xsl:template>
</xsl:stylesheet>
62 changes: 62 additions & 0 deletions packtools/catalogs/htmlgenerator/v3.0/article-text-back.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:include href="../v2.0/article-text-back.xsl"/>

<xsl:template match="fn-group" mode="back-section">
<!--
Insere o "título" da seção de notas de rodapé
-->
<div class="articleSection">
<div class="row">
<div class="col">
<ul class="refList articleFootnotes">
<xsl:apply-templates select="*|text()" mode="back-section-content"/>
</ul>
</div>
</div>
</div>
</xsl:template>

<xsl:template match="back/fn" mode="back-section">
<!--
Insere o "título" da seção de notas de rodapé
-->
<div>
<xsl:attribute name="class">articleSection</xsl:attribute>
<div class="row">
<div class="col">
<ul class="refList articleFootnotes">
<xsl:apply-templates select="."/>
</ul>
</div>
</div>
</div>
</xsl:template>

<xsl:template match="*[title] | *[label]" mode="back-section">
<div>
<xsl:attribute name="class">articleSection</xsl:attribute>
<xsl:attribute name="data-anchor"><xsl:apply-templates select="." mode="title"/></xsl:attribute>
<h3>
<xsl:attribute name="class">articleSectionTitle</xsl:attribute>
<xsl:apply-templates select="." mode="title"/>
</h3>
<xsl:apply-templates select="*|text()" mode="back-section-content"/>
</div>
</xsl:template>

<xsl:template match="text()" mode="back-section-content">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="*" mode="back-section-content">
<xsl:apply-templates select="."/>
</xsl:template>

<xsl:template match="title|label" mode="back-section-content">
<!-- do nothing -->
</xsl:template>
</xsl:stylesheet>
Loading