Skip to content

Commit

Permalink
agenda: create commmand to refactor agendas
Browse files Browse the repository at this point in the history
This commits adds commands to refactro the agendas. It adds respectively
commands to :
    - Define and show a specific section (lecture or lab)
    - Define and show a supported board
    - Show a specified part of a specified day

Signed-off-by: Thomas Bonnefille <[email protected]>
  • Loading branch information
Taumille committed Oct 30, 2024
1 parent e24fee4 commit f0a29d0
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions agenda/common.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
\newcommand\defagendaitem[6]{
\ifthenelse{\equal{\agendalanguage}{french}}{
\expandafter\def\csname #1@#2@title\endcsname {#5}
\expandafter\def\csname #1@#2@contents\endcsname {#6}
}{
\expandafter\def\csname #1@#2@title\endcsname {#3}
\expandafter\def\csname #1@#2@contents\endcsname {#4}
}
}

\newcommand\showagendaitem[2]{
\feagendaonecolumn{
\ifthenelse{\equal{\agendalanguage}{french}}{
\ifthenelse{\equal{#2}{lecture}}
{Cours -}
{
\ifthenelse{\equal{#2}{lab}}{
\ifthenelse{\equal{\trainingtype}{online}}{Démo -}{TP -}
}
{}
}
}{
\ifthenelse{\equal{#2}{lecture}}
{Lecture -}
{
\ifthenelse{\equal{#2}{lab}}{
\ifthenelse{\equal{\trainingtype}{online}}{Demo -}{Lab -}
}
{}
}
}
\csname #1@#2@title\endcsname
}{
\csname #1@#2@contents\endcsname
}
}

\newcommand\defboard[6]{
\ifthenelse{\equal{\agendalanguage}{french}}{
\expandafter\def\csname #1@title\endcsname {#4}
\expandafter\def\csname #1@contents\endcsname {#5}
}{
\expandafter\def\csname #1@title\endcsname {#2}
\expandafter\def\csname #1@contents\endcsname {#3}
}
\expandafter\def\csname #1@image\endcsname {#6}
}

\newcommand\showboarditem[1]{
\feagendatwocolumn{
\csname #1@title\endcsname
}{
\csname #1@contents\endcsname
}
{}
{
\csname #1@image\endcsname
}
}


\newcommand\showonlineagendaday[1]{
\ifthenelse{\equal{\agendalanguage}{french}}{
\section{#1 demi-journée}
}{
\section{Half day #1}
}
}

\newcommand\showonsiteagendaday[2]{
\ifthenelse{\equal{\agendalanguage}{french}}{
\ifthenelse{\equal{#2}{morning}}{
\section{Jour #1 - Matin}
}{
\section{Jour #1 - Après-midi}
}
}{
\ifthenelse{\equal{#2}{morning}}{
\section{Day #1 - Morning}
}{
\section{Day #1 - Afternoon}
}
}
}

0 comments on commit f0a29d0

Please sign in to comment.