Skip to main content

ReStructuredText to XAML for WPF and Silverlight / Moonlight

Project description

A XAML writer from reStructured Text source.

The goal is to be able to write out FlowDocument XAML from ReST documents for use in WPF and Silverlight / Moonlight projects.

It includes a Pygments formatter for outputting a syntax highlighted XAML representation of source code.

rst2xaml itself runs under CPython, but the generated XAML is intended for use from IronPython (or any other .NET language). There is an example IronPython script for displaying the generated XAML using a WPF FlowDocumentReader.

Requirements

rst2xaml depends on:

Tested with Python 2.5 and 2.6, but probably works fine under Python 2.4.

The Silverlight output is intended to work with Moonlight (the equivalent of Silverlight 2) and Silverlight 3. Let me know if there are any problems.

Current status

The docutils writer for both FlowDocument and Silverlight XAML can currently handle the following markup features:

  • title and headings

  • paragraphs

  • bold

  • italics

  • literal blocks

  • inline literals

  • line blocks

  • bullet lists

  • enumerated lists

  • blockquotes

  • the raw:: xaml directive

  • the pygments code-block directive

In addition the FlowDocument output can handle superscript, although that only works for fonts that support it.

Nested enumerated lists don’t yet work correctly for either FlowDocument or Silverlight output.

Scripts

There are three scripts that come with rst2xaml:

python rst2xaml.py source.txt output.xaml
python rst2xamlsl.py silverlight-source.txt silverlight-output.xaml
ipy.exe display_xaml.py output.xaml

If display_xaml.py is run without a command line argument it will open a file dialog for you to choose a xaml file to display.

Tests

The tests use the discover module, which is included in the repository for convenience. You run the tests with:

python discover.py

Development

The development version of rst2xaml is hosted on a google project page:

CHANGELOG

2009/08/20 Version 0.1.0

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

rst2xaml-0.1.0.zip (24.3 kB view details)

Uploaded Source

rst2xaml-0.1.0.tar.gz (19.2 kB view details)

Uploaded Source

File details

Details for the file rst2xaml-0.1.0.zip.

File metadata

  • Download URL: rst2xaml-0.1.0.zip
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rst2xaml-0.1.0.zip
Algorithm Hash digest
SHA256 60b734a9d47376a7005bf4e1641347ae2d4847239efbe2265badcacdcc82fe81
MD5 825153e768400105201abe98b1f1ec91
BLAKE2b-256 22f9e45f7ebaf58ff60ee70abe25a3b96543818cf146d210f417ddaf1c35b0d1

See more details on using hashes here.

File details

Details for the file rst2xaml-0.1.0.tar.gz.

File metadata

  • Download URL: rst2xaml-0.1.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rst2xaml-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69dd82046cec2b00caf7aa35caba94fc4f4de85fc0349559eb81282e5d8dbd45
MD5 8348ca1ac262c19ae4e772e90685ca30
BLAKE2b-256 853317959b3091bb16e25787d22a690c89ec53f5970a0e8d0d8a134aeac6e548

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page