Skip to content

Commit

Permalink
Add Agility PDF template
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHiteshPatel committed Jul 11, 2017
1 parent 66e017e commit d5307ad
Show file tree
Hide file tree
Showing 12 changed files with 121 additions and 20 deletions.
Empty file modified containthedocs-bash.sh
100644 → 100755
Empty file.
Empty file modified containthedocs-build.sh
100644 → 100755
Empty file.
Empty file modified containthedocs-clean.sh
100644 → 100755
Empty file.
Empty file modified containthedocs-cleanbuild.sh
100644 → 100755
Empty file.
Empty file modified containthedocs-convert.sh
100644 → 100755
Empty file.
Empty file modified containthedocs-image
100644 → 100755
Empty file.
Empty file modified containthedocs-pdf.sh
100644 → 100755
Empty file.
Binary file added docs/_static/back_cover.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/front_cover.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 53 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# ------------
#
# REQUIRED: Your class/lab name
classname = "F5 Architectures for Private Cloud Infrastructures - OpenStack - Class 164"
classname = "F5 Private Cloud Solutions - OpenStack"

# OPTIONAL: The URL to the GitHub Repository for this class
github_repo = "https://github.com/f5devcentral/f5-training-labs"
github_repo = "https://github.com/f5devcentral/f5-agility-labs-openstack"

# OPTIONAL: Google Analytics
# googleanalytics_id = 'UA-85156643-4'
Expand All @@ -21,9 +21,14 @@
import sys
import time
import re
import pkgutil
import string
sys.path.insert(0, os.path.abspath('.'))
import f5_sphinx_theme

year = time.strftime("%Y")
eventname = "Agility %s Hands-on Lab Guide" % (year)

rst_prolog = """
.. |classname| replace:: %s
.. |classbold| replace:: **%s**
Expand All @@ -50,12 +55,12 @@
""" % (classname,
classname,
classname,
time.strftime("%Y"))
year)

if 'github_repo' in locals() and len(github_repo) > 0:
rst_prolog += """
.. |repoinfo| replace:: The content contained here leverages a full DevOps CI/CD
pipieline and is sourced from the GitHub repository at %s.
pipeline and is sourced from the GitHub repository at %s.
Bugs and Requests for enhancements can be made using by
opening an Issue within the repository.
""" % (github_repo)
Expand Down Expand Up @@ -87,6 +92,21 @@
extensions += ['sphinxcontrib.googleanalytics']
googleanalytics_enabled = True

eggs_loader = pkgutil.find_loader('sphinxcontrib.spelling')
found = eggs_loader is not None

if found:
extensions += ['sphinxcontrib.spelling']
spelling_lang='en_US'
spelling_word_list_filename='../wordlist'
spelling_show_suggestions=True
spelling_ignore_pypi_package_names=False
spelling_ignore_wiki_words=True
spelling_ignore_acronyms=True
spelling_ignore_python_builtins=True
spelling_ignore_importable_modules=True
spelling_filters=[]

source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
}
Expand Down Expand Up @@ -135,7 +155,6 @@
todo_emit_warnings = True
todo_include_todos = True


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -176,33 +195,47 @@ def setup(app):

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
front_cover_image = 'front_cover'
back_cover_image = 'back_cover'

front_cover_image_path = os.path.join('_static', front_cover_image + '.png')
back_cover_image_path = os.path.join('_static', back_cover_image + '.png')

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
latex_additional_files = [front_cover_image_path, back_cover_image_path]

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
template = string.Template(open('preamble.tex').read())

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
latex_contents = r"""
\frontcoverpage
\contentspage
"""

backcover_latex_contents = r"""
\backcoverpage
"""

latex_elements = {
'papersize': 'letterpaper',
'pointsize': '10pt',
'fncychap': r'\usepackage[Bjornstrup]{fncychap}',
'preamble': template.substitute(eventname=eventname,
project=project,
author=author,
frontcoverimage=front_cover_image,
backcoverimage=back_cover_image),

'tableofcontents': latex_contents,
'printindex': backcover_latex_contents
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, '%s.tex' % cleanname, u'%s Documentation' % classname,
u'F5 Networks, Inc.', 'manual'),
u'F5 Networks, Inc.', 'manual', True),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
Expand Down
68 changes: 68 additions & 0 deletions docs/preamble.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
%% LaTeX preamble.

\usepackage{type1cm}
\usepackage{helvet}
\usepackage{wallpaper}

% Bypass unicode character not supported errors
\usepackage[utf8]{inputenc}

\makeatletter
\def\UTFviii@defined#1{%
\ifx#1\relax
?%
\else\expandafter
#1%
\fi
}
\makeatother

\pagestyle{plain}
\pagenumbering{arabic}

\renewcommand{\familydefault}{\sfdefault}

\definecolor{f5red}{RGB}{235, 28, 35}

\def\frontcoverpage{
\begin{titlepage}
\ThisURCornerWallPaper{1.0}{${frontcoverimage}}
\vspace*{2.5cm}
\hspace{4.5cm}
{\color{f5red} \text{\Large ${eventname}}\par}
\vspace{.5cm}
\hspace{4.5cm}
{\color{white} \text{\huge ${project}}\par}
\vspace{0.5cm}
\hspace{4.5cm}
{\color{white} \text{\large ${author}}\par}
\vfill
\end{titlepage}
\newpage
}
\def\backcoverpage{
\newpage
\thispagestyle{empty}
\phantom{100}
\ThisURCornerWallPaper{1.0}{${backcoverimage}}
}
\def\contentspage{
\tableofcontents
}
%% Disable standard title (but keep PDF info).
\renewcommand{\maketitle}{
\begingroup
% These \defs are required to deal with multi-line authors; it
% changes \\ to ', ' (comma-space), making it pass muster for
% generating document info in the PDF file.
\def\\{, }
\def\and{and }
\pdfinfo{
/Title (${project})
/Author (${author})
}
\endgroup
}
Empty file modified scripts/convertdocx.sh
100644 → 100755
Empty file.

0 comments on commit d5307ad

Please sign in to comment.