Skip to main content

ReStructuredText to XAML for WPF and Silverlight / Moonlight

Project description

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.

Current status

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

  • title and headings
  • paragraphs
  • bold
  • italics
  • superscript
  • literal blocks
  • inline literals
  • line blocks
  • bullet lists
  • enumerated lists
  • blockquotes
  • the raw:: xaml directive
  • the pygments code-block directive

The writer for Silverlight XAML, a subset of FlowDocument, can currently handle the following markup features:

  • paragraphs
  • bold
  • italics
  • blockquotes
  • the raw:: xaml directive
  • the pygments code-block directive

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

Project details


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page