Skip to content

Commit

Permalink
Merge pull request #2 from giupal/master
Browse files Browse the repository at this point in the history
Nuovo Tema Docs Italia
  • Loading branch information
ruphy committed Mar 7, 2018
2 parents a3051e6 + bf76f41 commit 0cb9db6
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 31 deletions.
3 changes: 0 additions & 3 deletions build.sh

This file was deleted.

1 change: 1 addition & 0 deletions requirements.txt
@@ -0,0 +1 @@
git+https://github.com/italia/docs-italia-theme@v1.0-beta
105 changes: 77 additions & 28 deletions rst/conf.py
@@ -1,35 +1,64 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys, os
docs_italia_theme = __import__("docs-italia-theme")
from recommonmark.transform import AutoStructify
from recommonmark.parser import CommonMarkParser

# -- PROJECT Variables ----------------------------------------------------
settings_project_name = u"PagoPA Architettura"
settings_copyright_year = '2017'
settings_copyright_name = ''
settings_project_name = 'PagoPA Architettura'
settings_copyright_copyleft = 'AgID - Team Digitale'
settings_editor_name = 'AgID - Team Digitale'
settings_doc_version = 'version: latest'
settings_doc_release = 'version: latest'
settings_basename = 'cad'
settings_file_name = 'index'
settings_basename = 'pagopa-architettura'
settings_file_name = 'pagopa-architettura'


# -- RTD configuration ------------------------------------------------

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

# This is used for linking and such so we link to the thing we're building
rtd_version = os.environ.get('READTHEDOCS_VERSION', 'latest')
if rtd_version not in ['stable', 'latest']:
rtd_version = 'stable'

rtd_project = os.environ.get('READTHEDOCS_PROJECT', '')

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

import sys
import os
# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'docs-italia-theme',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'
source_parsers = {
'.md': CommonMarkParser,
}

source_suffix = ['.rst', '.md']

# The encoding of source files.
#source_encoding = 'utf-8-sig'
Expand All @@ -40,7 +69,10 @@

# General information about the project.
project = settings_project_name
copyright = settings_copyright_year + ', ' + settings_copyright_name
copyright = settings_copyright_copyleft

# URL of Discourse instance used by sphinxcontrib.discourse extension
# discourse_url = settings_discourse_url

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -53,7 +85,6 @@

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
language = 'it'

# There are two options for replacing |today|: either, you set today to some
Expand All @@ -64,45 +95,62 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['.DS_Store', ]
exclude_patterns = ['.DS_Store', 'README', 'README.md', '.venv*']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# -- AutoStructify --------------------------------------------------------
def setup(app):
app.add_config_value('recommonmark_config', {
'auto_toc_tree_section': 'Contents',
'enable_eval_rst': True,
'enable_auto_doc_ref': True
}, True)
app.add_transform(AutoStructify)


# -- Options for HTML output ----------------------------------------------
html_theme = 'sphinx_italia_theme'
html_theme = 'docs-italia-theme'

html_theme_path = ["_themes", ]
html_theme_path = [docs_italia_theme.get_html_theme_path()]

# 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 = {
# This option can be used with docs-italia-theme to customise how the versions "badge" is shown:
# 'False': default (alabaster) badge | 'True': custom (italia) badge
'custom_versions_badge': 'True',
}
# -- ReadTheDoc requirements and local template generation---------------------

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
html_theme = 'sphinx_italia_theme'
html_theme_path = ["_themes", ]
html_theme = 'docs-italia-theme'
#html_theme_path = ["themes", ]
else:
# Override default css to get a larger width for ReadTheDoc build
html_context = {
'css_files': [
'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
'_static/css/theme.css',
'_static/css/badge_only.css',
],
}


# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
#html_title = settings_project_name

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "_images/governo.png"
# html_logo = "images/logo.png"

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand All @@ -112,8 +160,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
html_static_path = ['_themes/sphinx_italia_theme/static']
html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -151,7 +198,7 @@
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = False
# html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
Expand Down Expand Up @@ -183,12 +230,12 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', settings_file_name + '.tex', settings_project_name,
settings_copyright_year + ', ' + settings_copyright_name, 'manual'),
settings_copyright_copyleft, 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "_images/governo.png"
#latex_logo = "images/..."

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand All @@ -213,7 +260,7 @@
# (source start file, name, description, authors, manual section).
man_pages = [
('index', settings_file_name, settings_project_name,
[settings_copyright_name], 1)
[settings_editor_name], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -227,6 +274,8 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', settings_file_name, settings_project_name,
settings_copyright_year + ', ' + settings_copyright_name, settings_project_name, settings_project_name,
settings_copyright_copyleft, settings_project_name, settings_project_name,
'Miscellaneous'),
]

numfig = True

0 comments on commit 0cb9db6

Please sign in to comment.