aboutsummaryrefslogtreecommitdiff
path: root/calculette_aoo/js/dune
blob: b2ece9c7b4b17d7fcbe649825d21579ad68d3128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(executable
 (name main)
 (libraries 
   brr
   note.brr
   zarith_stubs_js
   application
   aoo
   )
 (modes js)
 (preprocess (pps js_of_ocaml-ppx))
 (link_flags (:standard -no-check-prims))
 )

(rule
  (targets aoo.js)
  (deps main.bc.js)
  (action (copy %{deps} %{targets})))
background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/python

# $Id: rst2latex.py 5905 2009-04-16 12:04:49Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.

"""
A minimal front end to the Docutils Publisher, producing LaTeX.
"""

try:
    import locale
    locale.setlocale(locale.LC_ALL, '')
except:
    pass

import subprocess
import os.path

from docutils.core import publish_cmdline
from docutils.parsers.rst import directives
from docutils.parsers.rst.directives.images import Figure

description = ('Generates LaTeX documents from standalone reStructuredText '
               'sources. '
               'Reads from <source> (default is stdin) and writes to '
               '<destination> (default is stdout).  See '
               '<http://docutils.sourceforge.net/docs/user/latex.html> for '
               'the full reference.')

class Graphviz(Figure):
    """ Generate a graphviz image
    """
    required_arguments = 0
    optional_arguments = 1
    final_argument_whitespace = True

    has_content = True

    option_spec = Figure.option_spec.copy()

    def run(self):

        text = '\n'.join(self.content)
        extension = 'png'
        imageFile = "tmp/%s.%s" % (hash(text), extension)
        if not os.path.exists(imageFile):
            conversion = subprocess.Popen(['/usr/bin/dot',
                '-T', 'png',
                '-o', imageFile,
                ],
                stdin=subprocess.PIPE
                )
            conversion.communicate(text)
            conversion.wait()

        self.arguments = [imageFile]
        self.options['scale'] = 50
        self.content = None
        return Figure.run(self)

directives.register_directive('graphviz', Graphviz)

publish_cmdline(writer_name='latex', description=description)