this repo has no description
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3#
4# MiniZinc documentation build configuration file, created by
5# sphinx-quickstart on Sat Nov 26 18:22:59 2016.
6#
7# This file is execfile()d with the current directory set to its
8# containing dir.
9#
10# Note that not all possible configuration values are present in this
11# autogenerated file.
12#
13# All configuration values have a default; values that are commented out
14# serve to show the default.
15
16# If extensions (or modules to document with autodoc) are in another directory,
17# add these directories to sys.path here. If the directory is relative to the
18# documentation root, use os.path.abspath to make it absolute, like shown here.
19#
20import os
21import sys
22sys.path.insert(0, os.path.abspath('../utils'))
23
24# -- General configuration ------------------------------------------------
25
26# If your documentation needs a minimal Sphinx version, state it here.
27#
28# needs_sphinx = '1.0'
29
30import defblock
31import inlinesyntaxhighlight
32
33# Add any Sphinx extension module names here, as strings. They can be
34# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35# ones.
36extensions = [
37 'sphinx.ext.todo',
38 'sphinx.ext.mathjax',
39 'defblock','bugref',
40 'inlinesyntaxhighlight',
41 'sphinxtogithub'
42]
43
44inline_highlight_respect_highlight = False
45
46inline_highlight_literals = False
47
48# Add any paths that contain templates here, relative to this directory.
49templates_path = ['_templates']
50
51# The suffix(es) of source filenames.
52# You can specify multiple suffix as a list of string:
53#
54# source_suffix = ['.rst', '.md']
55source_suffix = '.rst'
56
57# The encoding of source files.
58#
59# source_encoding = 'utf-8-sig'
60
61# The master toctree document.
62master_doc = 'index'
63
64# General information about the project.
65project = 'The MiniZinc Handbook'
66copyright = '2016, 2017, 2018, 2019, 2020 Peter J. Stuckey, Kim Marriott, Guido Tack'
67author = 'Peter J. Stuckey, Kim Marriott, Guido Tack'
68
69# The version info for the project you're documenting, acts as replacement for
70# |version| and |release|, also used in various other places throughout the
71# built documents.
72#
73# The short X.Y version.
74version = '2.5'
75# The full version, including alpha/beta/rc tags.
76release = '2.5.4'
77
78# The language for content autogenerated by Sphinx. Refer to documentation
79# for a list of supported languages.
80#
81# This is also used if you do content translation via gettext catalogs.
82# Usually you set "language" from the command line for these cases.
83language = None
84
85# There are two options for replacing |today|: either, you set today to some
86# non-false value, then it is used:
87#
88# today = ''
89#
90# Else, today_fmt is used as the format for a strftime call.
91#
92# today_fmt = '%B %d, %Y'
93
94# List of patterns, relative to source directory, that match files and
95# directories to ignore when looking for source files.
96# This patterns also effect to html_static_path and html_extra_path
97exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'api_interfacing.rst']
98
99# The reST default role (used for this markup: `text`) to use for all
100# documents.
101#
102# default_role = None
103
104# If true, '()' will be appended to :func: etc. cross-reference text.
105#
106# add_function_parentheses = True
107
108# If true, the current module name will be prepended to all description
109# unit titles (such as .. function::).
110#
111# add_module_names = True
112
113# If true, sectionauthor and moduleauthor directives will be shown in the
114# output. They are ignored by default.
115#
116# show_authors = False
117
118# The name of the Pygments (syntax highlighting) style to use.
119pygments_style = 'manni'
120
121# A list of ignored prefixes for module index sorting.
122# modindex_common_prefix = []
123
124# If true, keep warnings as "system message" paragraphs in the built documents.
125# keep_warnings = False
126
127# If true, `todo` and `todoList` produce output, else they produce nothing.
128todo_include_todos = True
129
130
131# -- Options for HTML output ----------------------------------------------
132
133import sphinx_rtd_theme
134
135# The theme to use for HTML and HTML Help pages. See the documentation for
136# a list of builtin themes.
137#
138# html_theme = 'alabaster'
139
140html_theme = 'sphinx_rtd_theme'
141html_theme_path = ["_themes", ]
142# html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
143
144# Theme options are theme-specific and customize the look and feel of a theme
145# further. For a list of options available for each theme, see the
146# documentation.
147#
148html_theme_options = {
149 'logo_only' : False,
150 'canonical_url' : 'http://www.minizinc.org/doc-latest/en/'
151}
152
153# Add any paths that contain custom themes here, relative to this directory.
154# html_theme_path = []
155
156# The name for this set of Sphinx documents.
157# "<project> v<release> documentation" by default.
158#
159html_title = project+" "+release
160
161# A shorter title for the navigation bar. Default is the same as html_title.
162#
163# html_short_title = None
164
165# The name of an image file (relative to this directory) to place at the top
166# of the sidebar.
167#
168html_logo = 'figures/MiniZn_logo_2.svg'
169
170# The name of an image file (relative to this directory) to use as a favicon of
171# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
172# pixels large.
173#
174# html_favicon = None
175
176# Add any paths that contain custom static files (such as style sheets) here,
177# relative to this directory. They are copied after the builtin static files,
178# so a file named "default.css" will overwrite the builtin "default.css".
179html_static_path = ['_static']
180
181html_js_files = ['js/doc-links.js']
182
183# Add any extra paths that contain custom files (such as robots.txt or
184# .htaccess) here, relative to this directory. These files are copied
185# directly to the root of the documentation.
186#
187# html_extra_path = []
188
189# If not None, a 'Last updated on:' timestamp is inserted at every page
190# bottom, using the given strftime format.
191# The empty string is equivalent to '%b %d, %Y'.
192#
193# html_last_updated_fmt = None
194
195# If true, SmartyPants will be used to convert quotes and dashes to
196# typographically correct entities.
197#
198# html_use_smartypants = True
199
200# Custom sidebar templates, maps document names to template names.
201#
202# html_sidebars = {}
203
204# Additional templates that should be rendered to pages, maps page names to
205# template names.
206#
207# html_additional_pages = {}
208
209# If false, no module index is generated.
210#
211# html_domain_indices = True
212
213# If false, no index is generated.
214#
215# html_use_index = True
216
217# If true, the index is split into individual pages for each letter.
218#
219html_split_index = True
220
221# If true, links to the reST sources are added to the pages.
222#
223html_show_sourcelink = False
224html_copy_source = False
225
226# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
227#
228html_show_sphinx = False
229
230# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
231#
232# html_show_copyright = True
233
234# If true, an OpenSearch description file will be output, and all pages will
235# contain a <link> tag referring to it. The value of this option must be the
236# base URL from which the finished HTML is served.
237#
238# html_use_opensearch = ''
239
240# This is the file name suffix for HTML files (e.g. ".xhtml").
241# html_file_suffix = None
242
243# Language to be used for generating the HTML full-text search index.
244# Sphinx supports the following languages:
245# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
246# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
247#
248# html_search_language = 'en'
249
250# A dictionary with options for the search language support, empty by default.
251# 'ja' uses this config value.
252# 'zh' user can custom change `jieba` dictionary path.
253#
254# html_search_options = {'type': 'default'}
255
256# The name of a javascript file (relative to the configuration directory) that
257# implements a search results scorer. If empty, the default will be used.
258#
259# html_search_scorer = 'scorer.js'
260
261# Output file base name for HTML help builder.
262htmlhelp_basename = 'MiniZincdoc'
263
264# -- Options for LaTeX output ---------------------------------------------
265
266latex_engine = 'xelatex'
267
268latex_elements = {
269 # The paper size ('letterpaper' or 'a4paper').
270 #
271 'papersize': 'a4paper',
272'fontpkg': r'''
273\usepackage{fontspec}
274\setmainfont{Charter}
275\setsansfont{Lato}
276\setmonofont{Inconsolata}
277''',
278 # The font size ('10pt', '11pt' or '12pt').
279 #
280 'pointsize': '11pt',
281
282 # Additional stuff for the LaTeX preamble.
283 #
284 # 'preamble': '',
285 'preamble': r'\usepackage{../../../utils/mznstyle}',
286 # Latex figure (float) alignment
287 #
288 # 'figure_align': 'htbp',
289 'fncychap': r'\usepackage[Sonny]{fncychap}',
290}
291
292# Grouping the document tree into LaTeX files. List of tuples
293# (source start file, target name, title,
294# author, documentclass [howto, manual, or own class]).
295latex_documents = [
296 (master_doc, 'MiniZinc.tex', 'MiniZinc Handbook',
297 'Peter J. Stuckey, Kim Marriott, Guido Tack', 'manual'),
298]
299
300# The name of an image file (relative to this directory) to place at the top of
301# the title page.
302#
303latex_logo = 'figures/MiniZn_logo_2_small.pdf'
304
305# For "manual" documents, if this is true, then toplevel headings are parts,
306# not chapters.
307#
308latex_toplevel_sectioning = "part"
309
310# If true, show page references after internal links.
311#
312latex_show_pagerefs = True
313
314# If true, show URL addresses after external links.
315#
316latex_show_urls = "footnote"
317
318# Documents to append as an appendix to all manuals.
319#
320# latex_appendices = []
321
322# It false, will not define \strong, \code, itleref, \crossref ... but only
323# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
324# packages.
325#
326# latex_keep_old_macro_names = True
327
328# If false, no module index is generated.
329#
330# latex_domain_indices = True
331
332
333# -- Options for manual page output ---------------------------------------
334
335# One entry per manual page. List of tuples
336# (source start file, name, description, authors, manual section).
337man_pages = [
338 (master_doc, 'minizinc', 'MiniZinc Documentation',
339 [author], 1)
340]
341
342# If true, show URL addresses after external links.
343#
344# man_show_urls = False
345
346
347# -- Options for Texinfo output -------------------------------------------
348
349# Grouping the document tree into Texinfo files. List of tuples
350# (source start file, target name, title, author,
351# dir menu entry, description, category)
352texinfo_documents = [
353 (master_doc, 'MiniZinc', 'MiniZinc Documentation',
354 author, 'MiniZinc', 'One line description of project.',
355 'Miscellaneous'),
356]
357
358# Documents to append as an appendix to all manuals.
359#
360# texinfo_appendices = []
361
362# If false, no module index is generated.
363#
364# texinfo_domain_indices = True
365
366# How to display URL addresses: 'footnote', 'no', or 'inline'.
367#
368# texinfo_show_urls = 'footnote'
369
370# If true, do not generate a @detailmenu in the "Top" node's menu.
371#
372# texinfo_no_detailmenu = False
373
374
375# -- Options for Epub output ----------------------------------------------
376
377# Bibliographic Dublin Core info.
378epub_title = project
379epub_author = author
380epub_publisher = author
381epub_copyright = copyright
382
383# The basename for the epub file. It defaults to the project name.
384# epub_basename = project
385
386# The HTML theme for the epub output. Since the default themes are not
387# optimized for small screen space, using the same theme for HTML and epub
388# output is usually not wise. This defaults to 'epub', a theme designed to save
389# visual space.
390#
391# epub_theme = 'epub'
392
393# The language of the text. It defaults to the language option
394# or 'en' if the language is not set.
395#
396# epub_language = ''
397
398# The scheme of the identifier. Typical schemes are ISBN or URL.
399# epub_scheme = ''
400
401# The unique identifier of the text. This can be a ISBN number
402# or the project homepage.
403#
404# epub_identifier = ''
405
406# A unique identification for the text.
407#
408# epub_uid = ''
409
410# A tuple containing the cover image and cover page html template filenames.
411#
412# epub_cover = ()
413
414# A sequence of (type, uri, title) tuples for the guide element of content.opf.
415#
416# epub_guide = ()
417
418# HTML files that should be inserted before the pages created by sphinx.
419# The format is a list of tuples containing the path and title.
420#
421# epub_pre_files = []
422
423# HTML files that should be inserted after the pages created by sphinx.
424# The format is a list of tuples containing the path and title.
425#
426# epub_post_files = []
427
428# A list of files that should not be packed into the epub file.
429epub_exclude_files = ['search.html']
430
431# The depth of the table of contents in toc.ncx.
432#
433# epub_tocdepth = 3
434
435# Allow duplicate toc entries.
436#
437# epub_tocdup = True
438
439# Choose between 'default' and 'includehidden'.
440#
441# epub_tocscope = 'default'
442
443# Fix unsupported image types using the Pillow.
444#
445# epub_fix_images = False
446
447# Scale large images.
448#
449# epub_max_image_width = 0
450
451# How to display URL addresses: 'footnote', 'no', or 'inline'.
452#
453# epub_show_urls = 'inline'
454
455# If false, no index is generated.
456#
457# epub_use_index = True
458
459numfig = True
460numfig_secnum_depth = 2
461
462rst_prolog = """
463.. role:: mzn(code)
464 :language: minizinc
465
466.. role:: mzndef(code)
467 :language: minizincdef
468"""
469
470sphinx_to_github = True
471sphinx_to_github_verbose = True
472sphinx_to_github_encoding = "utf-8"
473
474def setup(sphinx):
475 import six
476 print('Six version: %s' % six.__version__)
477 from minizinc_lexer import MznLexer, MznDefLexer
478 sphinx.add_lexer("minizinc", MznLexer())
479 sphinx.add_lexer("minizincdef", MznDefLexer())
480 sphinx.add_stylesheet("style.css")