Skip to content

Commit

Permalink
update: Travis CI building pipeline
Browse files Browse the repository at this point in the history
* Update the pipeline to also build the LaTeX-based PDF

* Some small updates in `rules.adoc`

Signed-off-by: mr.Shu <[email protected]>
  • Loading branch information
mrshu committed Sep 21, 2019
1 parent 93cfc09 commit 46489e8
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ services:

before_install:
- docker pull asciidoctor/docker-asciidoctor
- docker pull dxjoke/tectonic-docker
- pip install dblatex

script:
- cp rules.adoc _rules.adoc
- python .ci/criticmarkup_to_adoc.py _rules.adoc > rules.adoc
- docker run -v $TRAVIS_BUILD_DIR:/documents/ asciidoctor/docker-asciidoctor asciidoctor rules.adoc
- docker run -v $TRAVIS_BUILD_DIR:/documents/ asciidoctor/docker-asciidoctor asciidoctor-pdf rules.adoc
- docker run -v $TRAVIS_BUILD_DIR:/documents/ asciidoctor/docker-asciidoctor asciidoctor -b docbook rules.adoc
- dblatex -T db2latex rules.xml -t tex --texstyle=./manual.sty -p custom.xsl
- cat rules.tex | awk 'f;/\\mainmatter/{f=1}' > rules_without_preamble.tex
- cat preamble.tex rules_without_preamble.tex > rules.tex
- docker run --mount src=$TRAVIS_BUILD_DIR/src,target=/usr/src/tex,type=bind dxjoke/tectonic-docker /bin/sh -c "tectonic rules.tex"

after_error:
- docker logs asciidoc-to-html
- docker logs asciidoc-to-pdf

after_failure:
- docker logs asciidoc-to-html
- docker logs asciidoc-to-pdf

after_script:
- ./.ci/after_script.sh
26 changes: 26 additions & 0 deletions custom.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version='1.0' encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:template match="phrase[@role='red']">
<xsl:text>
\textcolor{red}{
</xsl:text>
<xsl:apply-templates/>
<xsl:text>
}
</xsl:text>
</xsl:template>

<xsl:param name="xref.with.number.and.title" select="1"></xsl:param>

<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en">
<l:context name="xref-number-and-title">
<l:template name="section" text="Rule %n, %t"/>
</l:context>
</l:l10n>
</l:i18n>

</xsl:stylesheet>


73 changes: 73 additions & 0 deletions manual.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
%%
%% This style is derivated from the db2latex one
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{manual}


% The defined options
\DeclareOption{hyperlink}{ \def\DBKhyperlink{yes} }
\DeclareOption{nohyperlink}{ \def\DBKhyperlink{no} }

% Default values
\ExecuteOptions{hyperlink}

% If defined, process the options
\ProcessOptions\relax

%% Just use the original package and pass the options
\RequirePackageWithOptions{db2latex}

\renewcommand{\maketitle}{

\begin{center}
{\LARGE \@title \par}
\vskip 8em
\end{center}

% \pagestyle{empty}

% \noindent
% \textbf{\DBKtitle \\}
% \ifx\DBKauthor\empty\else{by \DBKauthor \\}\fi
% \hspace{0pt}\\
% \ifthenelse{\equal{\DBKedition}{}}{}{Edition \DBKedition \\}
% \ifthenelse{\equal{\DBKpubdate}{}}{}{Published \DBKpubdate \\}
% \ifthenelse{\equal{\DBKcopyright}{}}{}{\DBKcopyright \\}
% \hspace{0pt}\\
% Now the legalnotice block
% \DBKlegalblock
% Ahoj
% \newpage
}

\renewenvironment{DBKadmonition}[2] {
% this code corresponds to the \begin{admonition} command
\hspace{0mm}\newline\hspace*\fill\newline
\noindent
\setlength{\fboxsep}{5pt}
\setlength{\admlength}{\linewidth}
\addtolength{\admlength}{-2\fboxsep}
\addtolength{\admlength}{-10\fboxrule}
\admminipage{\admlength}
~\\[1mm]
\ifthenelse{\equal{#1}{}}{
\def\admgraph{false}
}{
\def\admgraph{true}
\includegraphics[width=1cm]{icons/#1}
\addtolength{\admlength}{-1cm}
\addtolength{\admlength}{-20pt}
\begin{minipage}[lt]{\admlength}
}
\parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt
} %done
{ % this code corresponds to the \end{admonition} command
\vspace{5mm}
\ifthenelse{\equal{\admgraph}{false}}{}{
\end{minipage}
}
\endadmminipage
\vspace{.5em}
\par
}
127 changes: 127 additions & 0 deletions preamble.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
%% Preamble %%
%% A minimal LaTeX preamble
%% Some packates are needed to implement
%% Asciidoc features

\documentclass{article}


\usepackage{graphicx}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsxtra}
\usepackage{amsfonts}
\usepackage{wasysym}
\usepackage{isomath}
\usepackage{mathtools}
\usepackage{txfonts}
\usepackage{upgreek}
\usepackage{enumerate}
\usepackage{tensor}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{changes}
\usepackage{etoolbox}
\usepackage{titlesec}
\let\openbox\relax


\usepackage[letterpaper, margin=1in, headheight=47pt]{geometry}
\usepackage[hyperlink]{manual}

% No paragraph indent
\setlength{\parindent}{0cm}
% Bigger paragraph skips
\setlength{\parskip}{0.25cm}

% TEX Gyre Adventor font (looks pretty nice)
\renewcommand*\rmdefault{qag}

% Set paragraph numbers correctly (skip susubsection)
\setcounter{secnumdepth}{4}
\renewcommand\thesubsection{\arabic{section}.\arabic{subsection}}
\renewcommand\thesubsubsection{
\ifnum \value{subsubsection}=0
\thesubsection
\else
\thesubsection.\Alph{subsubsection}\relax
\fi}

\newcommand*{\p}{\paragraph{}}

\newlength\titleindent
\setlength\titleindent{1.2cm}

\definecolor{mygray}{gray}{0.55}
\titleformat{\paragraph}[runin]
{\normalfont\footnotesize}{\llap{\parbox{\titleindent}{\textcolor{mygray}{\theparagraph}\hfill}}}{0em}{}

\titlespacing{\paragraph}{0pt}{0em}{0em}

% End of paragraph numbers setting

\pagestyle{fancy}

\lhead{}
\chead{}
\rhead{\includegraphics[width=8cm]{media/image15.png}}
\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\topmargin}{-20pt}

\rfoot{Page \textbf{\thepage} of \textbf{\pageref{LastPage}}}
\lfoot{\textit{Draft Rules as of \today}}
\cfoot{}

% First page
\fancypagestyle{firststyle}{%
\fancyhf{}
\fancyfoot[L]{\textit{Draft Rules as of \today}}
\fancyfoot[R]{Page \textbf{\thepage} of \textbf{\pageref{LastPage}}}
}

\title{\vspace{-5ex}RoboCupJunior Soccer Rules 2020\vspace{-5ex}}
\date{\vspace{-2ex}}

\definecolor{color-1}{rgb}{1,1,1}
\definecolor{color-2}{rgb}{0,0,0.5}
\definecolor{color-3}{rgb}{0.07,0.33,0.8}
\definecolor{color-4}{rgb}{0.13,0.13,0.13}
\definecolor{red}{rgb}{1,0,0}
\definecolor{color-6}{rgb}{0,0,1}



\begin{document}
\maketitle
\thispagestyle{firststyle}

\begin{tabular}{rl}
\resizebox{0.50\textwidth}{!}{
\begin{tabular}{lr}
\multicolumn{2}{l}{\textbf{Soccer Technical Committee 2019:}}\\
Tairo Nomura & Japan\\
James Riley & Australia\\
Mikail S. Arani & Canada\\
Javier E. Delgado Moreno & Mexico \\
Felipe Nascimento Martins & Netherlands\\
Marek \v{S}uppa & Slovakia (CHAIR)\\
\end{tabular}}
&

\resizebox{0.50\textwidth}{!}{
\begin{tabular}{lr}
\multicolumn{2}{l}{\textbf{Soccer Technical Committee 2018:}}\\
Sarit Salzman & Israel\\
James Riley & Australia\\
Michael Sloan Warren & USA\\
Javier E. Delgado Moreno & Mexico \\
Felipe Nascimento Martins & Netherlands\\
Marek \v{S}uppa & Slovakia (CHAIR)\\
\end{tabular}}

\end{tabular}

\vspace{20pt}
9 changes: 6 additions & 3 deletions rules.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ https://junior.forum.robocup.org/ for OC (Organizational Committee) procedures
and requirements for the international competition. Each team is responsible
for verifying the latest version of the rules prior to competition.

NOTE: These are the Draft rules. Although they are still subject to change, the
TC expects the changes to be minimal and at mostly cosmetic.

[discrete]
== Preface

Expand Down Expand Up @@ -204,10 +207,10 @@ as well.++}
{++If an attacking and a defending robot touch each other while at least one of
them is at least partially inside the penalty area, and at least one of them
has physical contact with the ball, this is called "pushing" and the ball will
be moved to the *furthest* unoccupied neutral spot immediately.++}
be moved to the _furthest unoccupied neutral spot_ immediately.++}

{++If two robots from the same team are at least partially in the penalty area,
one of these robots will be moved to the *furthest* unoccupied neutral spot
one of these robots will be moved to the _furthest unoccupied neutral spot_
immediately. If this happens repeatedly, a robot may be deemed damaged
(<<damaged-robots>>) at referee's discretion.++}

Expand Down Expand Up @@ -739,7 +742,7 @@ According to rule 3.8 of the RoboCupJunior Soccer Rules, each league has its
own additional regulations. They become a part of the rules.

For RoboCupJunior 2020, there are two sub-leagues as follows
footnote:[biggest differences are described in 8.2.1 Dimensions]:
footnote:[biggest differences are described in <<dimensions>>]:

* Soccer Lightweight
* Soccer Open
Expand Down

0 comments on commit 46489e8

Please sign in to comment.