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

feat: Add DACS SW template #40

Merged
merged 3 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion .github/workflows/compile-latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ jobs:
root_file: main.tex
work_in_root_file_dir: true

- name: Compile LaTeX template document
uses: xu-cheng/latex-action@v3
with:
working_directory: src/dacs-sw/template/
root_file: main.tex
work_in_root_file_dir: true

- name: Rename files and move to single release folder
run: |
mkdir release
mv src/dacs-sw/control-station-installation/main.pdf release/sw-control-station-installation.pdf
mv src/dacs-sw/template/main.pdf release/template.pdf

- name: Upload PDF file
uses: actions/upload-artifact@v4
with:
name: artifacts
path: release/sw-control-station-installation.pdf
path: release/*
10 changes: 9 additions & 1 deletion .github/workflows/tagpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
root_file: main.tex
work_in_root_file_dir: true

- name: Compile LaTeX template document
if: ${{ steps.tagpr.outputs.tag != '' }}
uses: xu-cheng/latex-action@v3
with:
working_directory: src/dacs-sw/template/
root_file: main.tex
work_in_root_file_dir: true

- name: Rename files and move to single release folder
if: ${{ steps.tagpr.outputs.tag != '' }}
run: |
Expand All @@ -39,4 +47,4 @@ jobs:
with:
tag_name: ${{ steps.tagpr.outputs.tag }}
files: |
release/sw-control-station-installation.pdf
release/*
3 changes: 3 additions & 0 deletions src/dacs-sw/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# template

Use this as a template for other procedures.
91 changes: 91 additions & 0 deletions src/dacs-sw/template/main.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
\documentclass{article}

\input{../../common/lib/header}

% Define a counter for the item numbers
\newcounter{rowCounter}
% Initialize counter
\setcounter{rowCounter}{0}

% Command for row in checklist
% First argument is amount
% Second argument is description
\newcommand{\checklistItem}[2]{
\checkbox & #1 & #2 \\ \hline
}

% Command for row in procedure list
\newcommand{\procedureItem}[1]{
\stepcounter{rowCounter} % Increment counter
1.\arabic{rowCounter}
&
\checkbox
&
\checkbox
&
\checkbox
&
\begin{minipage}[t]{\linewidth}
#1
\vspace{1mm} % Just slightly add vspace to prevent clipping into table border
\end{minipage}
\\ \hline
}

% Command for row in note list
\newcommand{\noteItem}[1]{
\begin{minipage}[t]{\linewidth}
#1
\vspace{1mm} % Just slightly add vspace to prevent clipping into table border
\end{minipage}
\\ \hline
}


\title{REPLACE ME}
\author{Operating Procedure}
\date{Version: \isodate\today}

\begin{document}

\maketitle

% Set the page style for the title page
\thispagestyle{fancy}

%%%%%% Prefix section
% Change section numbering to A, B, C...
\renewcommand{\thesection}{\Alph{section}}

\section{Operation Description}
\input{sections/operation-description.tex}

\section{Required Documents}
\input{sections/required-documents.tex}

\section{Required Tools}
\input{sections/required-tools.tex}

\section{Required Materials}
\input{sections/required-materials.tex}

\newpage

%%%%%% Main section
% Change section numbering to 1, 2, 3...
\renewcommand{\thesection}{\arabic{section}}

% Reset section counter to start from 1 again
\setcounter{section}{0}

\section{Installation}
\input{sections/installation.tex}

\newpage

%%%%%% Notes
\setcounter{section}{0}
\section*{Notes}
\input{sections/notes.tex}

\end{document}
12 changes: 12 additions & 0 deletions src/dacs-sw/template/sections/installation.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
% Procedure for installation

\setcounter{rowCounter}{0} % Reset counter
\begin{tabularx}{\textwidth}{|>{\columncolor{tableColumnColor}}c|>{\columncolor{tableColumnColor}}c|>{\columncolor{tableColumnColor}}c|>{\columncolor{tableColumnColor}}c|X|}
\hline
\rowcolor{tableHeaderColor}
ID & CK 1 & CK 2 & CK 3 & Description \\ \hline

\procedureItem{
REPLACE ME
}
\end{tabularx}
10 changes: 10 additions & 0 deletions src/dacs-sw/template/sections/notes.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
% Notes

\rowcolors{1}{notesColor}{notesColor}
\begin{tabularx}{\textwidth}{X}
\hline

\noteItem{
\textbf{REPLACE ME}
}
\end{tabularx}
2 changes: 2 additions & 0 deletions src/dacs-sw/template/sections/operation-description.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
% Operation description
\textbf{REPLACE ME}
2 changes: 2 additions & 0 deletions src/dacs-sw/template/sections/required-documents.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
% Required documents
\textbf{REPLACE ME}
2 changes: 2 additions & 0 deletions src/dacs-sw/template/sections/required-materials.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
% Required materials
\textbf{REPLACE ME}
8 changes: 8 additions & 0 deletions src/dacs-sw/template/sections/required-tools.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
% Table of required tools

\begin{tabularx}{0.9\textwidth}{|>{\columncolor{tableColumnColor}}c|c|X|}
\hline
\rowcolor{tableHeaderColor}
Check & Amount & Description \\ \hline
\checklistItem{X}{Replace Me}
\end{tabularx}