GithubHelp home page GithubHelp logo

adfinis / adsy-sphinx-template Goto Github PK

View Code? Open in Web Editor NEW
5.0 14.0 1.0 905 KB

Sphinx and LaTeX templates for Adfinis SyGroup CI/CD

Makefile 15.84% Python 18.52% HTML 1.38% CSS 13.28% TeX 50.98%
sphinx-theme corporate-design corporate-identity

adsy-sphinx-template's Introduction

The Ad-Sy Sphinx templates

This repository contains templates for the Sphinx-Doc system, both for HTML and LaTeX output. To use it, you need a few steps to configure sphinx correctly.

Initializing

To initialize a new sphinx-doc documentation, just run the sphinx-quickstart command as usual. Alternatively, copy the files from the example folder into the project folder and start customizing the conf.py files.

The following examples assume that you have added the adsy-sphinx-template.src repository either as a submodule or as a regular checkout in the root directory. In other words, your directory layout should look like this:

  • conf.py
  • index.rst
  • Makefile
  • adsy-sphinx-template.src/

    • html/
    • latex/
    • README.rst (this file)

Configuring LaTeX

To enable the Ad-Sy LaTeX template, add the following to the conf.py file:

latex_additional_files = [
    'adsy-sphinx-template.src/latex/logo.png',
    'adsy-sphinx-template.src/latex/sphinx.sty',
    'adsy-sphinx-template.src/latex/adsy.sty'
]


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

    # The font size ('10pt', '11pt' or '12pt').
    'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    'preamble' : r"""

        \usepackage{adsy}


        \renewcommand{\subtitle}{%s}

    """ % (project)

}

Unfortunately, due to the way that Sphinx generates LaTeX, we need some additional hackery to get it to work with our template: Replace the latexpdf target in the Makefile with the following code to make it work correctly:

latexpdf:
    $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
    sed -i 's/pdflatex/xelatex/g' $(BUILDDIR)/latex/Makefile
    sed -i  '/^\\DeclareUnicodeCharacter/d' $(BUILDDIR)/latex/*.tex
    sed -i  '/\\usepackage{hyperref}/d' $(BUILDDIR)/latex/sphinxmanual.cls
    sed -i  '/\\usepackage\[Bjarne\]{fncychap}/d' $(BUILDDIR)/latex/*.tex

    @echo "Running LaTeX files through pdflatex..."
    $(MAKE) -C $(BUILDDIR)/latex all-pdf
    @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

Configuring HTML

To enable the Ad-Sy HTML template, add the following to the conf.py file:

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
html_theme = "adsy"
#html_theme_options = {
#    "rightsidebar": "true",
#}

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [ 'adsy-sphinx-template.src/html' ]

# Works with github and gitlab
html_context = {
    'source_url_prefix':
    "https://github.com/adfinis-sygroup/[project]/tree/master/doc/",
    'source_suffix': ".rst",
}

adsy-sphinx-template's People

Contributors

s3lph avatar schtibe avatar winged avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

greenpau

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.