From 05fea49b8776d6e1a66c332f00734ada447ecf53 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Sun, 7 Feb 2021 10:35:20 -0700 Subject: [PATCH] [Doc] Skip youtube video when building pdf; Apply SVG2PDF converter so that svg images can be included in the pdf --- docs/requirements.txt | 3 +++ docs/source/conf.py | 6 ++++++ docs/source/overview/motivation.rst | 6 ++++-- docs/source/tutorials/compile.rst | 6 ++++-- docs/source/tutorials/design_flow/generate_fabric.rst | 6 ++++-- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index eb876e494..c66cd1334 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -11,6 +11,9 @@ sphinxcontrib-bibtex<2.0.0 # Package required to embed youtube video sphinxcontrib-yt +# Package required to convert svg for pdf builder +sphinxcontrib-svg2pdfconverter + #Work-around bug "AttributeError: 'Values' object has no attribute 'character_level_inline_markup'" with docutils 0.13.1 #See: # * https://github.com/sphinx-doc/sphinx/issues/3951 diff --git a/docs/source/conf.py b/docs/source/conf.py index 510e62c4b..55f4c8a26 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -37,6 +37,12 @@ try: except ImportError: have_sphinxcontrib_youtube = False +# Import sphinxcontrib.svg2pdfconverter +have_sphinxcontrib_svg2pdfconverter = True +try: + import sphinxcontrib.svg2pdfconverter +except ImportError: + have_sphinxcontrib_svg2pdfconverter = False # -- Project information ----------------------------------------------------- diff --git a/docs/source/overview/motivation.rst b/docs/source/overview/motivation.rst index 8575dd1f0..0fc4d58cb 100644 --- a/docs/source/overview/motivation.rst +++ b/docs/source/overview/motivation.rst @@ -1,9 +1,11 @@ Why OpenFPGA? ------------- -.. note:: If this is the first time you learn OpenFPGA, we strongly recommend you to watch the introduction video. +.. note:: If this is the first time you learn OpenFPGA, we strongly recommend you to watch the `introduction video `_ -.. youtube:: ocODUGcYGqo +.. only:: html + + .. youtube:: ocODUGcYGqo OpenFPGA aims to be an open-source framework that enables rapid prototyping of customizable FPGA architectures. As shown in :numref:`fig_openfpga_motivation`, a conventional approach will take a large group of experienced engineers more than one year to achieve production-ready layout and assoicated CAD tools. In fact, most of the engineering efforts are spent on manual layouts and developing ad-hoc CAD support. diff --git a/docs/source/tutorials/compile.rst b/docs/source/tutorials/compile.rst index 1b6266c18..1a5c5a216 100644 --- a/docs/source/tutorials/compile.rst +++ b/docs/source/tutorials/compile.rst @@ -3,9 +3,11 @@ How to Compile -------------- -.. note:: We recommend you to watch a tutorial video about how-to-compile before getting started +.. note:: We recommend you to watch a tutorial `video `_ about how-to-compile before getting started -.. youtube:: F9sMRmDewM0 +.. only:: html + + .. youtube:: F9sMRmDewM0 General Guidelines ~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/tutorials/design_flow/generate_fabric.rst b/docs/source/tutorials/design_flow/generate_fabric.rst index 7e4d57c7d..962274de9 100644 --- a/docs/source/tutorials/design_flow/generate_fabric.rst +++ b/docs/source/tutorials/design_flow/generate_fabric.rst @@ -3,9 +3,11 @@ Generate Fabric Netlists ------------------------ -.. note:: You may watch the video representation of this tutorial +.. note:: You may watch the `video `_ representation of this tutorial -.. youtube:: aJ0OkZ1uh68 +.. only:: html + + .. youtube:: aJ0OkZ1uh68 This tutorial will show an example how to - generate Verilog netlists for a FPGA fabric