This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

mylit is a simple tool for literate programming in Python.

Literate Python programs are just regular Python source files with extensive comments. When mylit is run with a literate Python program as input, it creates an HTML file containing the comments and highlighted source code. You can use HTML markup in comments as you may see fit.

In addition to simple comments, the HTML compilation process can be customized by starting a comment line with ##. Anything that follows on such a line will be executed in the parser’s context. The code can, for example, set variables, manipulate the generated HTML, or generate debug output. Look at the mylit source code to see what it can do.

Lines starting with #! are ignored completely. This way, you can comment out things that are not meant to be included in the final HTML file.

Here’s a simple example of what a literate program might look like:

#!/usr/bin/env python
#! This line is ignored, as is the previous line.

#! Set the title variable of the parser:
## title = "mylit example"

# <h1>A simple mylit example</h1>
# This is a simple example of literate <a
# href="http://www.python.org/">Python</a> programming with <a
# href="http://pypi.python.org/pypi/mylit">mylit</a>.

# Here we define a function that checks whether a given pair of coordinates
# lies within a circle of radius <code>r</code>.
def in_circle(x, y, r):
    # We first square both <code>x</code> and <code>y</code>, and sum them up.
    s = x ** 2 + y ** 2

    # <p>Note how the above comment contains HTML markup. The indentation of
    # the highlighted Python code is unaffected by interspersed comments.</p>

    # Here we check whether the coordinates (<code>x</code>, <code>y</code>)
    # lie within a circle of radius <code>r</code>.
    if s < r ** 2:
        # Everything's okay, so we can return <code>True</code>:
        return True
    else:
        # We may have a problem here. Better print a warning.
        import warnings
        warnings.warn("Danger, Will Robinson!")
        return False

# When this program is run from the command line, it performs a simple test.
if __name__ == "__main__":
    assert in_circle(3, 4, 5.1) == True
    assert in_circle(3, 4, 4.9) == False

Of course, mylit itself is a literate Python program.

Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
mylit-0.1.2.tar.gz (5.8 kB) Copy SHA256 Checksum SHA256 Source Mar 14, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting