Skip to content

Commit

Permalink
Reformat for pdf generation
Browse files Browse the repository at this point in the history
  • Loading branch information
uvidyadharan committed Jul 18, 2023
1 parent a84902c commit 1c05e5f
Show file tree
Hide file tree
Showing 45 changed files with 576 additions and 598 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ autobuild:

booklets:
BOOKLETS_BUILD="true" $(SPHINXBUILD) -M latexpdf $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS) $(O)
xargs -d '\n' --arg-file=$(BOOKLETSBUILDDIR)/booklets.txt printf -- '$(LATEXBUILDDIR)%s\n' | xargs cp -f -t $(BOOKLETSBUILDDIR)
cp $(addsuffix .pdf, $(basename $(wildcard $(LATEXBUILDDIR)*.tex))) $(BOOKLETSBUILDDIR)

local-full:
DOCS_BUILD="true" $(SPHINXBUILD) -b html $(SOURCEDIR) $(HTMLBUILDDIR) $(SPHINXOPTS) $(O)
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ git+https://github.com/FIRST-Tech-Challenge/ftcdocs-helper@main#subdirectory=jav
sphinx_design==0.2.0
git+https://github.com/FIRST-Tech-Challenge/ftcdocs-helper@main#subdirectory=googleanalytics
git+https://github.com/FIRST-Tech-Challenge/ftcdocs-helper@main#subdirectory=cookiebanner
sphinx-sitemap==2.3.0
sphinx-sitemap==2.3.0
python-git-info==0.8.3
30 changes: 30 additions & 0 deletions docs/source/booklets/advanced.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
:orphan:

.. only:: latex

Advanced Topics, Progrmming Resources
======================================

.. toctree::
:maxdepth: 1
:titlesonly:

/programming_resources/vision/vision_overview/vision-overview
/programming_resources/vision/tensorflow_pp_2022/tensorflow_pp_2022
/programming_resources/vision/blocks_tfod_opmode/blocks-tfod-opmode
/programming_resources/vision/java_tfod_opmode/java-tfod-opmode
/programming_resources/vision/tensorflow_ff_2021/tensorflow-ff-2021
/programming_resources/vision/webcam_controls/webcam-controls
Camera Calibration </programming_resources/vision/camera_calibration/camera-calibration>

.. toctree::
:maxdepth: 1
:titlesonly:

/programming_resources/shared/pid_coefficients/pid-coefficients
/programming_resources/shared/pidf_coefficients/pidf-coefficients
/programming_resources/shared/auto_load_opmode/auto-load-opmode
/programming_resources/shared/myblocks/index
/programming_resources/shared/external_libraries_blocks/external-libraries-blocks.rst
/programming_resources/imu/imu.rst
/programming_resources/shared/installing_kotlin/Installing-Kotlin
15 changes: 15 additions & 0 deletions docs/source/booklets/apriltags.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:orphan:

.. only:: latex

April Tags in *FIRST* Tech Challenge
====================================

.. toctree::

AprilTag Introduction </apriltag/vision_portal/apriltag_intro/apriltag-intro>
VisionPortal Overview </apriltag/vision_portal/visionportal_overview/visionportal-overview>
Understanding AprilTag Values </apriltag/understanding_apriltag_detection_values/understanding-apriltag-detection-values>
AprilTag Test Images </apriltag/opmode_test_images/opmode-test-images>


13 changes: 13 additions & 0 deletions docs/source/booklets/control_system.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:orphan:

.. only:: latex

*FIRST* Tech Challenge Control System
======================================

.. toctree::

/programming_resources/shared/control_system_intro/The-FTC-Control-System
/control_hard_compon/index
/hardware_and_software_configuration/index

14 changes: 14 additions & 0 deletions docs/source/booklets/sdk.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:orphan:

.. only:: latex

*FIRST* Tech Challenge SDK
====================================

.. toctree::

SDK Overview </ftc_sdk/overview/index>
Updating Components </ftc_sdk/updating/index>



102 changes: 84 additions & 18 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import os
import sys
import urllib.parse as urlparse
import gitinfo

project = 'FIRST Tech Challenge Docs'
copyright = 'FIRST'
author = 'FIRST Tech Challenge'
license = 'BSD 3-Clause'

release = '0.1'
version = '0.1.0'
release = '0.2'
version = '0.2.0'
# -- General configuration

extensions = [
Expand Down Expand Up @@ -92,6 +94,8 @@
# See: https://github.com/readthedocs/readthedocs.org/issues/5476
latex_use_xindy = False

gitInfo = gitinfo.get_git_info(dir="../../.")

latex_elements = {
"papersize": "letterpaper",

Expand All @@ -103,7 +107,10 @@
\setmonofont{DejaVu Sans Mono}
""",

'passoptionstopackages': r"""\PassOptionsToPackage{letterpaper,portrait,includehead=true,includefoot=true,left=0.5in,right=0.5in,top=0.9in,bottom=3in,footskip=12.4pt,headsep=25pt,}{geometry}""",
'passoptionstopackages': r"""
\PassOptionsToPackage{letterpaper,portrait,includehead=true,includefoot=true,left=0.5in,right=0.5in,top=0.9in,bottom=3in,footskip=12.4pt,headsep=25pt,}{geometry}
\usepackage{titling}
""",

"preamble": r"""
\usepackage{fancyhdr}
Expand All @@ -114,6 +121,8 @@
\usepackage{titlesec}
\usepackage[datesep=/,style=ddmmyyyy]{datetime2}
\titleformat
{\chapter} % command
[display] % shape
Expand All @@ -127,6 +136,9 @@
} % before-code
[
] % after-code
\addtolength{\topmargin}{-23.80643pt}
\setlength{\footskip}{36pt}
\makeatletter
\fancypagestyle{normal}{
Expand All @@ -137,10 +149,31 @@
}}
\fancyfoot[RE]{
\vspace{-10mm}
\py@HeaderFamily \py@release
\py@HeaderFamily \py@release \hspace{4mm} \today
}
\fancyfoot[LO]{\vspace{-15mm} \py@HeaderFamily \textbf{Gracious Professionalism®} - \textcolor[rgb]{.96, .49, .15}{“Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”}}
\fancyhead[R]{{\vspace{5mm} \py@HeaderFamily \@title, \thepage}}
\fancyhead[L]{{\vspace{5mm} FTC Docs}}
\fancyhead[C]{{\vspace{5mm} \begin{center}\py@HeaderFamily \thechapter \end{center}}}
}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[LE]{{
\includegraphics[scale=0.75]{Latex_Footer_FTC.png}
\vspace{10mm}
}}
\fancyfoot[RE]{
\vspace{-10mm}
\py@HeaderFamily \py@release \hspace{4mm} \today
}
\fancyfoot[LO]{\py@HeaderFamily \textbf{Gracious Professionalism®} - \textcolor[rgb]{.96, .49, .15}{“Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”}}
\fancyhead[R]{{\vspace{5mm} \py@HeaderFamily \@title, \thepage \headrule}}
\fancyfoot[LO]{\vspace{-15mm} \py@HeaderFamily \textbf{Gracious Professionalism®} - \textcolor[rgb]{.96, .49, .15}{“Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”}}
\fancyhead[R]{{\vspace{5mm} \py@HeaderFamily \@title, \thepage}}
\fancyhead[L]{{\vspace{5mm} FTC Docs}}
\fancyhead[C]{{\vspace{5mm} \begin{center}\py@HeaderFamily \thechapter \end{center}}}
}
\makeatother
Expand All @@ -157,7 +190,7 @@
\begin{titlepage}
\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{FTC_Center_Stage_Title.pdf}};
\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{FTC_Center_Stage_Title.pdf}}
\vspace*{113mm}
Expand All @@ -166,7 +199,10 @@
\textbf{\Large {2023-2024 \emph{FIRST} Tech Challenge}}
\\
\vspace{4mm}
\textbf{\Huge {FTC Docs}}
\textbf{\Huge {\thetitle}}
\\
\vspace*{\fill}
\textbf{\Large {\emph{FIRST} Tech Challenge Documentation}}
\end{center}
\end{flushright}
Expand All @@ -187,10 +223,39 @@
\includegraphics[scale=0.8]{RTX.png}
\end{center}
\end{figure}
""",

'atendofbody': rf"""
\newpage
\chapter{{Version Information}}
\section{{Document Information}}
\large \textbf{{Author:}} \theauthor
\\
\large \textbf{{Version:}} {release}
\\
\large \textbf{{Release Date:}} \today
\\
\section{{Git Information}}
\large \textbf{{Git Hash: }} {gitInfo['commit']}
\\
\large \textbf{{Git Branch: }} {gitInfo['refs']}
\\
\large \textbf{{Git Commit Date: }} {gitInfo['author_date']}
\\
\large \textbf{{Git Commit Author:}} {gitInfo['author']}
\section{{Document License}}
\large \textbf{{License:}} {license}
""",

"printindex": r"\footnotesize\raggedright\printindex",
}

Expand Down Expand Up @@ -245,16 +310,17 @@
if(os.environ.get("BOOKLETS_BUILD") == "true"):
print('Building booklets')
latex_documents = [
(master_doc, output_name + '.tex', project, author, "manual"),
('ftc_ml/index', "ftc_ml.tex", "FTC Machine Learning", author, "manual"),
('programming_resources/index', "prgrm_res.tex", "FTC Programming Resources", author, "manual"),
(master_doc, output_name + '.tex', project, author, "manual"), # Main, Questionable if it should be built with booklets
('ftc_ml/index', "ftc_ml.tex", "FTC Machine Learning", author, "manual"), # FTC ML
('programming_resources/index', "prgrm_res.tex", "FTC Programming Resources", author, "manual"), # Programming Resources
('programming_resources/android_studio_java/Android-Studio-Tutorial', 'android_studios.tex', 'Android Studio Guide', author, "manual"), # Android Studio
('programming_resources/onbot_java/OnBot-Java-Tutorial', "onbot_java.tex", 'OnBot Java Guide', author, "manual"), # OnBot Java
('programming_resources/blocks/Blocks-Tutorial', "blocks.tex", 'Blocks Guide', author, "manual"), # Blocks
('booklets/apriltags', "april_tags.tex", 'April Tags Guide', author, "manual"), # April Tags
('booklets/control_system', "control_system.tex", 'Control System Guide', author, "manual"), # Control System
('booklets/sdk', "sdk.tex", 'SDK Guide', author, "manual"), # SDK
('booklets/advanced', "advanced.tex", 'Advanced Topics, Progrmming Resources', author, "manual"), # Advanced Topics
]

if not os.path.exists('../build/booklets'):
os.makedirs('../build/booklets')
with open('../build/booklets/booklets.txt', 'w') as file:
for doc in latex_documents:
file.write(doc[1].replace(".tex", ".pdf") + '\n')


def setup(app):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ need the following items:

.. list-table::
:header-rows: 1
:widths: auto
:widths: 50 50
:class: longtable

* - Required Item(s)
- Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Android Studio Programming Tutorial

<h3>Introduction</h3>


This tutorial will take you step-by-step through the process of
configuring, programming, and operating your Control System. This
tutorial uses Android Studio to help you get started programming your
Expand All @@ -20,56 +21,12 @@ Android app developers use. Android Studio is only recommended for

|
.. raw:: html

<h3>Table of Contents</h3>

#. Introduction

- :doc:`The Control System <../shared/control_system_intro/The-FTC-Control-System>`
- :doc:`Required Materials <../shared/required_materials/Required-Materials>`
- :doc:`Using Your Android Device <../shared/using_android_device/Using-Your-Android-Device>`

#. Configuring Your Hardware

- :doc:`Configuring Your Android
Devices <../shared/configuring_android/Configuring-Your-Android-Devices>`
- :doc:`Connecting Devices to a Control or Expansion Hub </hardware_and_software_configuration/connecting_devices/index>`
- :doc:`Configuring Your Hardware </hardware_and_software_configuration/connecting_devices/index>`

#. Installing Android Studio

- :doc:`Downloading and Installing Android Studio <../tutorial_specific/android_studio/installing_android_studio/Installing-Android-Studio>`
- :doc:`Downloading the Android Studio Project <../tutorial_specific/android_studio/downloading_as_project_folder/Downloading-the-Android-Studio-Project-Folder>`
- :bdg-warning:`Legacy` :doc:`Disabling Android Studio Instant Run <../tutorial_specific/android_studio/disable_instant_run/disable-instant-run>`

#. Managing an Android Studio Project

- :bdg-warning:`Legacy` :doc:`Downloading an FTC Android Studio Project <../tutorial_specific/android_studio/downloading_as_project_folder/Downloading-the-Android-Studio-Project-Folder>`
- :doc:`Forking/Cloning an FTC Android Studio Project from GitHub <../tutorial_specific/android_studio/fork_and_clone_github_repository/Fork-and-Clone-From-GitHub>`

#. Writing an Op Mode

- :doc:`Enabling Developer Options <../tutorial_specific/android_studio/enabling_developer_options/Enabling-Developer-Options>`
- :doc:`Creating & Running an Op Mode <../tutorial_specific/android_studio/creating_op_modes/Creating-and-Running-an-Op-Mode-(Android-Studio)>`
- :doc:`Controlling a Servo <../tutorial_specific/android_studio/controlling_a_servo/Controlling-a-Servo-(Android-Studio)>`
- :doc:`Using Sensors <../tutorial_specific/android_studio/using_sensors/Using-Sensors-(Android-Studio)>`

.. Only placing tutorial-specific items in the tutorial toc
.. toctree::
:caption: Tutorials
:maxdepth: 1
:titlesonly:
:hidden:

../tutorial_specific/android_studio/installing_android_studio/Installing-Android-Studio
../tutorial_specific/android_studio/disable_instant_run/disable-instant-run
../tutorial_specific/android_studio/downloading_as_project_folder/Downloading-the-Android-Studio-Project-Folder
../tutorial_specific/android_studio/fork_and_clone_github_repository/Fork-and-Clone-From-GitHub
../tutorial_specific/android_studio/enabling_developer_options/Enabling-Developer-Options
../tutorial_specific/android_studio/creating_op_modes/Creating-and-Running-an-Op-Mode-(Android-Studio)
../tutorial_specific/android_studio/controlling_a_servo/Controlling-a-Servo-(Android-Studio)
../tutorial_specific/android_studio/using_sensors/Using-Sensors-(Android-Studio)
:maxdepth: 2

intro/intro
config/config
install/install
manage/manage
opmode/opmode

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Configuring your Hardware :bdg-success:`AS`
===========================================

.. toctree::
:maxdepth: 1

../../shared/configuring_android/Configuring-Your-Android-Devices
/hardware_and_software_configuration/connecting_devices/index
/hardware_and_software_configuration/configuring/index
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Installing Android Studio :bdg-success:`AS`
===========================================

.. toctree::
../../tutorial_specific/android_studio/installing_android_studio/Installing-Android-Studio
../../tutorial_specific/android_studio/downloading_as_project_folder/Downloading-the-Android-Studio-Project-Folder
../../tutorial_specific/android_studio/disable_instant_run/disable-instant-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Introduction :bdg-success:`AS`
=====================================

.. toctree::
:maxdepth: 1

The Control System <../../shared/control_system_intro/The-FTC-Control-System>
Required Materials <../../shared/required_materials/Required-Materials>
Using Your Android Device <../../shared/using_android_device/Using-Your-Android-Device>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Managing an Android Studio Project :bdg-success:`AS`
=====================================================

.. toctree::
../../tutorial_specific/android_studio/fork_and_clone_github_repository/Fork-and-Clone-From-GitHub
Loading

0 comments on commit 1c05e5f

Please sign in to comment.