60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | {%- endblock header-%}
68 |
69 | {% block codecell %}
70 | {% set html_class = cell['metadata'].get('html-class', {}) %}
71 |
72 | {{ super() }}
73 |
74 | {%- endblock codecell %}
75 |
76 | {% block input_group -%}
77 |
78 | {{ super() }}
79 |
80 | {% endblock input_group %}
81 |
82 | {% block output_group %}
83 |
84 |
85 | {{ super() }}
86 |
87 |
88 | {% endblock output_group %}
89 |
90 | {% block in_prompt -%}
91 |
92 | {%- if cell.execution_count is defined -%}
93 | In [{{ cell.execution_count|replace(None, " ") }}]:
94 | {%- else -%}
95 | In [ ]:
96 | {%- endif -%}
97 |
98 | {%- endblock in_prompt %}
99 |
100 | {% block empty_in_prompt -%}
101 |
102 |
103 | {%- endblock empty_in_prompt %}
104 |
105 | {#
106 | output_prompt doesn't do anything in HTML,
107 | because there is a prompt div in each output area (see output block)
108 | #}
109 | {% block output_prompt %}
110 | {% endblock output_prompt %}
111 |
112 | {% block input %}
113 |
114 |
115 | {{ cell.source | highlight_code(metadata=cell.metadata) }}
116 |
117 |
118 | {%- endblock input %}
119 |
120 | {% block output_area_prompt %}
121 | {%- if output.output_type == 'execute_result' -%}
122 |
123 | {%- if cell.execution_count is defined -%}
124 | Out[{{ cell.execution_count|replace(None, " ") }}]:
125 | {%- else -%}
126 | Out[ ]:
127 | {%- endif -%}
128 | {%- else -%}
129 |
130 | {%- endif -%}
131 |
132 | {% endblock output_area_prompt %}
133 |
134 | {% block output %}
135 |
136 | {% if resources.global_content_filter.include_output_prompt %}
137 | {{ self.output_area_prompt() }}
138 | {% endif %}
139 | {{ super() }}
140 |
141 | {% endblock output %}
142 |
143 | {% block markdowncell scoped %}
144 | {% set html_class = cell['metadata'].get('html-class', {}) %}
145 |
146 | {%- if resources.global_content_filter.include_input_prompt-%}
147 | {{ self.empty_in_prompt() }}
148 | {%- endif -%}
149 |
150 |
151 | {{ cell.source | markdown2html | strip_files_prefix }}
152 |
153 |
154 |
155 | {%- endblock markdowncell %}
156 |
157 | {% block unknowncell scoped %}
158 | unknown type {{ cell.type }}
159 | {% endblock unknowncell %}
160 |
161 | {% block execute_result -%}
162 | {%- set extra_class="output_execute_result" -%}
163 | {% block data_priority scoped %}
164 | {{ super() }}
165 | {% endblock data_priority %}
166 | {%- set extra_class="" -%}
167 | {%- endblock execute_result %}
168 |
169 | {% block stream_stdout -%}
170 |
171 |
172 | {{- output.text | ansi2html -}}
173 |
174 |
175 | {%- endblock stream_stdout %}
176 |
177 | {% block stream_stderr -%}
178 |
179 |
180 | {{- output.text | ansi2html -}}
181 |
182 |
183 | {%- endblock stream_stderr %}
184 |
185 | {% block data_svg scoped -%}
186 |
329 |
330 |
331 |
332 |
333 |
334 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 | {%- endblock footer-%}
350 |
--------------------------------------------------------------------------------
/jupinx/theme/minimal/templates/latex.tpl:
--------------------------------------------------------------------------------
1 | ((*- extends 'article.tplx' -*))
2 |
3 | % See http://blog.juliusschulz.de/blog/ultimate-ipython-notebook#templates
4 | % for some useful tips
5 |
6 | %===============================================================================
7 | % Document class
8 | %===============================================================================
9 |
10 | ((* block docclass *))
11 | \documentclass[11pt, twoside, a4paper]{article}
12 | ((* endblock docclass *))
13 |
14 | %===============================================================================
15 | % Packages
16 | %===============================================================================
17 |
18 | ((* block packages *))
19 | \usepackage[T1]{fontenc}
20 | \usepackage{graphicx}
21 | \usepackage[breakable]{tcolorbox}
22 | % We will generate all images so they have a width \maxwidth. This means
23 | % that they will get their normal width if they fit onto the page, but
24 | % are scaled down if they would overflow the margins.
25 | \makeatletter
26 | \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
27 | \else\Gin@nat@width\fi}
28 | \makeatother
29 | \let\Oldincludegraphics\includegraphics
30 |
31 | % propose delete%
32 | % Ensure that by default, figures have no caption (until we provide a
33 | % proper Figure object with a Caption API and a way to capture that
34 | % in the conversion process - todo).
35 | % \usepackage{caption}
36 | % \DeclareCaptionLabelFormat{empty}{}
37 | %\captionsetup{format=empty,aboveskip=0pt,belowskip=0pt}
38 | % end - propose delete%
39 |
40 | % float figure settings%
41 | \usepackage{float}
42 | \floatplacement{figure}{H} % used to force figures for placement in text
43 |
44 | \usepackage{adjustbox} % Used to constrain images to a maximum size
45 | \usepackage{xcolor} % Allow colors to be defined
46 | \usepackage{enumerate} % Needed for markdown enumerations to work
47 | \usepackage{geometry} % Used to adjust the document margins
48 | \usepackage{amsmath} % Equations
49 | \usepackage{amssymb} % Equations
50 | \usepackage{textcomp} % defines textquotesingle
51 | % Hack from http://tex.stackexchange.com/a/47451/13684:
52 | \AtBeginDocument{%
53 | \def\PYZsq{\textquotesingle}% Upright quotes in Pygmentized code
54 | }
55 | \usepackage{upquote} % Upright quotes for verbatim code
56 | \usepackage{eurosym} % defines \euro
57 | \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support
58 | \usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document
59 | \usepackage{fancyvrb} % verbatim replacement that allows latex
60 | \usepackage{grffile} % extends the file name processing of package graphics
61 | % to support a larger range
62 | % The hyperref package gives us a pdf with properly built
63 | % internal navigation ('pdf bookmarks' for the table of contents,
64 | % internal cross-reference links, web links for URLs, etc.)
65 | \usepackage{hyperref}
66 | \usepackage{longtable} % longtable support required by pandoc >1.10
67 | \usepackage{booktabs} % table support for pandoc > 1.12.2
68 | \usepackage[inline]{enumitem} % IRkernel/repr support (it uses the enumerate* environment)
69 | \usepackage[normalem]{ulem} % ulem is needed to support strikethroughs (\sout)
70 | % normalem makes italics be italics, not underlines
71 | \usepackage{braket}
72 | \usepackage{mathrsfs}
73 | \usepackage{natbib}
74 | \usepackage[document]{ragged2e}
75 | \usepackage{fontspec, unicode-math}
76 | \usepackage[greek,english]{babel}
77 | \usepackage{xunicode}
78 | \usepackage{letltxmacro}
79 | \setmonofont{LiberationMono}
80 | \newcommand{\argmax}{\operatornamewithlimits{argmax}}
81 | \newcommand{\argmin}{\operatornamewithlimits{argmin}}
82 | \DeclareMathOperator{\col}{col}
83 | \setlength{\parskip}{1.5ex plus0.5ex minus0.5ex}
84 | \setlength{\parindent}{0pt}
85 |
86 | \usepackage{letltxmacro}
87 | % https://tex.stackexchange.com/q/88001/5764
88 | \LetLtxMacro\oldttfamily\ttfamily
89 | \DeclareRobustCommand{\ttfamily}{\oldttfamily\csname ttsize\endcsname}
90 | \newcommand{\setttsize}[1]{\def\ttsize{#1}}%
91 |
92 | \DeclareTextFontCommand{\texttt}{\ttfamily}
93 |
94 | % renew commands %
95 | % Set max figure width to be 80% of text width, for now hardcoded.
96 | \renewcommand{\includegraphics}[1]{\begin{center}\Oldincludegraphics[width=.8\maxwidth]{#1}\end{center}}
97 | \renewcommand \caption [2][]{} % removes captions from all figures
98 | ((* endblock packages *))
99 |
100 | % Colors for the hyperref package
101 | \definecolor{urlcolor}{rgb}{0,.145,.698}
102 | \definecolor{linkcolor}{rgb}{.71,0.21,0.01}
103 | \definecolor{citecolor}{rgb}{.12,.54,.11}
104 |
105 | % ANSI colors
106 | \definecolor{ansi-black}{HTML}{3E424D}
107 | \definecolor{ansi-black-intense}{HTML}{282C36}
108 | \definecolor{ansi-red}{HTML}{E75C58}
109 | \definecolor{ansi-red-intense}{HTML}{B22B31}
110 | \definecolor{ansi-green}{HTML}{00A250}
111 | \definecolor{ansi-green-intense}{HTML}{007427}
112 | \definecolor{ansi-yellow}{HTML}{DDB62B}
113 | \definecolor{ansi-yellow-intense}{HTML}{B27D12}
114 | \definecolor{ansi-blue}{HTML}{208FFB}
115 | \definecolor{ansi-blue-intense}{HTML}{0065CA}
116 | \definecolor{ansi-magenta}{HTML}{D160C4}
117 | \definecolor{ansi-magenta-intense}{HTML}{A03196}
118 | \definecolor{ansi-cyan}{HTML}{60C6C8}
119 | \definecolor{ansi-cyan-intense}{HTML}{258F8F}
120 | \definecolor{ansi-white}{HTML}{C5C1B4}
121 | \definecolor{ansi-white-intense}{HTML}{A1A6B2}
122 | \definecolor{ansi-default-inverse-fg}{HTML}{FFFFFF}
123 | \definecolor{ansi-default-inverse-bg}{HTML}{000000}
124 |
125 |
126 | % commands and environments needed by pandoc snippets
127 | % extracted from the output of `pandoc -s`
128 | \providecommand{\tightlist}{%
129 | \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
130 | \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
131 | % Add ',fontsize=\small' for more characters per line
132 | \newenvironment{Shaded}{}{}
133 | \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
134 | \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}
135 | \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
136 | \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
137 | \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
138 | \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
139 | \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
140 | \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}
141 | \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}
142 | \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
143 | \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}
144 | \newcommand{\RegionMarkerTok}[1]{{#1}}
145 | \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
146 | \newcommand{\NormalTok}[1]{{#1}}
147 |
148 | % Additional commands for more recent versions of Pandoc
149 | \newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{{#1}}}
150 | \newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
151 | \newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
152 | \newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{{#1}}}
153 | \newcommand{\ImportTok}[1]{{#1}}
154 | \newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{{#1}}}}
155 | \newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
156 | \newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
157 | \newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{{#1}}}
158 | \newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
159 | \newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{{#1}}}
160 | \newcommand{\BuiltInTok}[1]{{#1}}
161 | \newcommand{\ExtensionTok}[1]{{#1}}
162 | \newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{{#1}}}
163 | \newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{{#1}}}
164 | \newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
165 | \newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
166 |
167 |
168 | % Define a nice break command that doesn't care if a line doesn't already
169 | % exist.
170 | \def\br{\hspace*{\fill} \\* }
171 | % Math Jax compatibility definitions
172 | \def\gt{>}
173 | \def\lt{<}
174 | \let\Oldtex\TeX
175 | \let\Oldlatex\LaTeX
176 | \renewcommand{\TeX}{\textrm{\Oldtex}}
177 | \renewcommand{\LaTeX}{\textrm{\Oldlatex}
178 |
179 | %===============================================================================
180 | % Title Page
181 | %===============================================================================
182 |
183 | ((* block maketitle *))
184 | \setttsize{\footnotesize}
185 |
186 | \title{((( nb.metadata.get("latex_metadata", {}).get("title", "") | escape_latex )))}
187 |
188 | ((*- if nb.metadata.get("latex_metadata", {}).get("author", ""): -*))
189 | \author{((( nb.metadata["latex_metadata"]["author"] )))}
190 | ((*- endif *))
191 |
192 | ((*- if nb.metadata.get("latex_metadata", {}).get("affiliation", ""): -*))
193 | \affiliation{((( nb.metadata["latex_metadata"]["affiliation"] )))}
194 | ((*- endif *))
195 |
196 | \date{\today}
197 | \maketitle
198 |
199 | ((*- if nb.metadata.get("latex_metadata", {}).get("logo", ""): -*))
200 | \begin{center}
201 | \adjustimage{max size={0.6\linewidth}{0.6\paperheight}}{((( nb.metadata["latex_metadata"]["logo"] )))}
202 | \end{center}
203 | ((*- endif -*))
204 |
205 | ((* endblock maketitle *))
206 |
207 |
208 | %===============================================================================
209 | % Input
210 | %===============================================================================
211 |
212 | % Input cells can be hidden using the "Hide input" and "Hide input all"
213 | % nbextensions (which set the hide_input metadata flags)
214 |
215 | ((* block input scoped *))
216 | ((( cell.metadata.get("hide_input", "") )))
217 | ((*- if cell.metadata.hide_input or nb.metadata.hide_input or cell.metadata.get("hide_input", ""): -*))
218 | ((*- else -*))
219 | ((( custom_add_prompt(cell.source | wrap_text(88) | highlight_code(strip_verbatim=True), cell, 'In ', 'incolor', 'plain') )))
220 | ((*- endif *))
221 | ((* endblock input *))
222 |
223 |
224 | %===============================================================================
225 | % Output
226 | %===============================================================================
227 |
228 | ((* block output_group -*))
229 | ((*- if cell.metadata.hide_output: -*))
230 | ((*- else -*))
231 | ((( super() )))
232 | ((*- endif -*))
233 | ((* endblock output_group *))
234 |
235 | ((* block execute_result scoped *))
236 | ((*- for type in output.data | filter_data_type -*))
237 | ((*- if type in ['text/plain']*))
238 | ((( custom_add_prompt(output.data['text/plain'] | wrap_text(88) | escape_latex | ansi2latex, cell, 'Out', 'outcolor', 'plain') )))
239 | ((*- elif type in ['text/latex']*))
240 | ((( custom_add_prompt(output.data['text/latex'] | wrap_text(88) | ansi2latex, cell, 'Out', 'outcolor', 'latex') )))
241 | ((* else -*))
242 | ((( " " )))
243 | ((( draw_prompt(cell, 'Out', 'outcolor','') )))((( super() )))
244 | ((*- endif -*))
245 | ((*- endfor -*))
246 | ((* endblock execute_result *))
247 |
248 | % Display stream ouput with coloring
249 | ((* block stream *))
250 | \begin{Verbatim}[commandchars=\\\{\}, fontsize=\footnotesize]
251 | ((( output.text | wrap_text(86) | escape_latex | ansi2latex )))
252 | \end{Verbatim}
253 | %((* endblock stream *))
254 |
255 | %==============================================================================
256 | % Define macro custom_add_prompt() (derived from add_prompt() macro in style_ipython.tplx)
257 | %==============================================================================
258 |
259 | ((* macro custom_add_prompt(text, cell, prompt, prompt_color, type) -*))
260 | ((*- if cell.execution_count is defined -*))
261 | ((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
262 | ((*- else -*))
263 | ((*- set execution_count = "" -*))
264 | ((*- endif -*))
265 | ((*- set indention = " " * (execution_count | length + 7) -*))
266 | \begin{Verbatim}[mathescape, commandchars=\\\{\}, fontsize=\small, xleftmargin=-3.9em]
267 | ((( text.replace('$$','').replace('$','') | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
268 | \end{Verbatim}
269 | ((*- endmacro *))
270 |
271 | %==============================================================================
272 | % Support Macros
273 | %==============================================================================
274 |
275 | % Name: draw_prompt
276 | % Purpose: Renders an output/input prompt
277 | ((* macro draw_prompt(cell, prompt, prompt_color, extra_space) -*))
278 | ((*- if cell.execution_count is defined -*))
279 | ((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
280 | ((*- else -*))((*- set execution_count = " " -*))((*- endif *))
281 |
282 | ((*- if (resources.global_content_filter.include_output_prompt and prompt == 'Out')
283 | or (resources.global_content_filter.include_input_prompt and prompt == 'In' ) *))
284 | \prompt{(((prompt)))}{(((prompt_color)))}{(((execution_count)))}{(((extra_space)))}
285 | ((*- endif -*))
286 | ((*- endmacro *))
287 |
288 |
289 | %==============================================================================
290 | % Bibliography
291 | %==============================================================================
292 |
293 | % Insert citations in markdown as e.g.
294 | %
[DevoretS2013]
295 | % requires file references.bib in current directory (or the file set as "bib" in the latex_metadata)
296 |
297 |
298 | ((* block bibliography *))
299 | ((*- if nb.metadata.get("latex_metadata", {}).get("bib_include", ""): -*))
300 | % Add a bibliography block to the postdoc
301 | \bibliographystyle{plain}
302 | \bibliography{((( nb.metadata.get("latex_metadata", {}).get("bib", "references") )))}
303 | ((*- endif -*))
304 | ((* endblock bibliography *))
305 |
--------------------------------------------------------------------------------
/jupinx/util/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | jupinx.util
3 | ~~~~~~~~~~~
4 |
5 | Utility functions for Jupinx.
6 | """
--------------------------------------------------------------------------------
/jupinx/util/template.py:
--------------------------------------------------------------------------------
1 | """
2 | jupinx.util.template
3 | ~~~~~~~~~~~~~~~~~~~~
4 |
5 | Templates utility functions for Jupinx.
6 |
7 | Adapted from Sphinx Template utility - sphinx.util.template
8 | """
9 |
10 | import os
11 | from typing import Dict, List, Union
12 |
13 | from jinja2.loaders import BaseLoader
14 | from jinja2.sandbox import SandboxedEnvironment
15 |
16 | from jupinx import package_dir
17 | from sphinx.jinja2glue import SphinxFileSystemLoader
18 | from sphinx.locale import get_translator
19 | from sphinx.util import rst, texescape
20 |
21 |
22 | class BaseRenderer:
23 | def __init__(self, loader: BaseLoader = None) -> None:
24 | self.env = SandboxedEnvironment(loader=loader, extensions=['jinja2.ext.i18n'])
25 | self.env.filters['repr'] = repr
26 | self.env.install_gettext_translations(get_translator()) # type: ignore
27 |
28 | def render(self, template_name: str, context: Dict) -> str:
29 | return self.env.get_template(template_name).render(context)
30 |
31 | def render_string(self, source: str, context: Dict) -> str:
32 | return self.env.from_string(source).render(context)
33 |
34 |
35 | class FileRenderer(BaseRenderer):
36 | def __init__(self, search_path: Union[str, List[str]]) -> None:
37 | if isinstance(search_path, str):
38 | search_path = [search_path]
39 | else:
40 | # filter "None" paths
41 | search_path = list(filter(None, search_path))
42 |
43 | loader = SphinxFileSystemLoader(search_path)
44 | super().__init__(loader)
45 |
46 | @classmethod
47 | def render_from_file(cls, filename: str, context: Dict) -> str:
48 | dirname = os.path.dirname(filename)
49 | basename = os.path.basename(filename)
50 | print(dirname, "dirname", basename, "basename -- ")
51 | return cls(dirname).render(basename, context)
52 |
53 |
54 | class SphinxRenderer(FileRenderer):
55 | def __init__(self, template_path: Union[str, List[str]] = None) -> None:
56 | if template_path is None:
57 | template_path = os.path.join(package_dir, 'templates')
58 | super().__init__(template_path)
59 |
60 | @classmethod
61 | def render_from_file(cls, filename: str, context: Dict) -> str:
62 | return FileRenderer.render_from_file(filename, context)
63 |
64 |
65 | class LaTeXRenderer(SphinxRenderer):
66 | def __init__(self, template_path: str = None) -> None:
67 | if template_path is None:
68 | template_path = os.path.join(package_dir, 'templates', 'latex')
69 | super().__init__(template_path)
70 |
71 | # use texescape as escape filter
72 | self.env.filters['e'] = texescape.escape
73 | self.env.filters['escape'] = texescape.escape
74 | self.env.filters['eabbr'] = texescape.escape_abbr
75 |
76 | # use JSP/eRuby like tagging instead because curly bracket; the default
77 | # tagging of jinja2 is not good for LaTeX sources.
78 | self.env.variable_start_string = '<%='
79 | self.env.variable_end_string = '%>'
80 | self.env.block_start_string = '<%'
81 | self.env.block_end_string = '%>'
82 |
83 |
84 | class ReSTRenderer(SphinxRenderer):
85 | def __init__(self, template_path: Union[str, List[str]] = None, language: str = None) -> None: # NOQA
86 | super().__init__(template_path)
87 |
88 | # add language to environment
89 | self.env.extend(language=language)
90 |
91 | # use texescape as escape filter
92 | self.env.filters['e'] = rst.escape
93 | self.env.filters['escape'] = rst.escape
94 | self.env.filters['heading'] = rst.heading
95 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | import jupinx
4 |
5 | from setuptools import setup, find_packages
6 |
7 | LONG_DESCRIPTION = '''
8 | This package contains the Jupinx cmd and quickstart utilities.
9 |
10 | Documentation and a tutorial can be found `here
`_.
11 |
12 | This project is maintained and supported by `QuantEcon
`_.
13 | '''
14 | VERSION = jupinx.__version__
15 |
16 | INSTALL_REQUIRES = [
17 | 'docutils',
18 | 'nbformat',
19 | 'sphinx>=1.8.5',
20 | 'dask',
21 | 'dask[distributed]',
22 | 'ipython',
23 | 'nbconvert',
24 | 'notebook',
25 | 'jupyter_client',
26 | 'pyzmq>=17.1.3',
27 | 'sphinxcontrib-bibtex',
28 | 'sphinxcontrib-jupyter>=0.5.6'
29 | ]
30 |
31 | setup(
32 | name='jupinx',
33 | version=VERSION,
34 | url='https://github.com/QuantEcon/jupinx',
35 | download_url='https://github.com/QuantEcon/jupinx/archive/{}.tar.gz'.format(VERSION),
36 | license='BSD',
37 | author='QuantEcon',
38 | author_email='admin@quantecon.org',
39 | description='Jupinx extension: Convert your RST files into into different formats like notebook, pdf, html.',
40 | long_description=LONG_DESCRIPTION,
41 | zip_safe=False,
42 | classifiers=[
43 | 'Development Status :: 4 - Beta',
44 | 'Environment :: Console',
45 | 'Environment :: Web Environment',
46 | 'Framework :: Sphinx',
47 | 'Intended Audience :: Developers',
48 | 'License :: OSI Approved :: BSD License',
49 | 'Operating System :: OS Independent',
50 | 'Programming Language :: Python :: 2',
51 | 'Programming Language :: Python :: 3',
52 | 'Framework :: Sphinx :: Extension',
53 | 'Topic :: Documentation',
54 | 'Topic :: Utilities',
55 | ],
56 | platforms='any',
57 | packages=find_packages(),
58 | include_package_data=True,
59 | entry_points={
60 | 'console_scripts': [
61 | 'jupinx-quickstart = jupinx.cmd.quickstart:main',
62 | 'jupinx = jupinx.cmd.build:main'
63 | ]
64 | },
65 | install_requires=INSTALL_REQUIRES
66 | )
67 |
--------------------------------------------------------------------------------