Top Description Fields Constructors Methods
org.python.indexer.demos

public Class HtmlDemo

extends Object
Class Inheritance
Imports
org.python.indexer.Indexer, .NBinding, .StyleRun, .Util, java.io.File, java.util.List

Simple proof-of-concept demo app for the indexer. Generates a static-html cross-referenced view of the code in a file or directory, using the index to create links and outlines.

The demo not attempt to show general cross references (declarations and uses of a symbol) from the index, nor does it display the inferred type information or generated error/warning diagnostics. It could be made to do these things, as well as be made more configurable and generally useful, with additional effort.

Run it from jython source tree root dir with; e.g., to index /usr/lib/python2.4/email

ant jar && java -classpath ./dist/jython.jar org.python.indexer.demos.HtmlDemo /usr/lib/python2.4 /usr/lib/python2.4/email
Fully indexing the Python standard library may require a more complete build to pick up all the dependencies:
rm -rf ./html/ && ant clean && ant jar && ant jar-complete && java -classpath ./dist/jython.jar org.python.indexer.demos.HtmlDemo /usr/lib/python2.4 /usr/lib/python2.4
You can alternately use Jython's version of the Python library. The following command will index the whole thing:
ant jar-complete && java -classpath ./dist/jython.jar org.python.indexer.demos.HtmlDemo ./CPythonLib ./CPythonLib

Field Summary

Modifier and TypeField and Description
private static final String
private Indexer
private Linker
private static final File
private File
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
private String
private static File
private void
private static void
info(Object msg)

public static void
main(String[] args)

private void
private String
markup(String path)

private void
start(File stdlib, File fileOrDir)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CSSback to summary
private static final String CSS
indexerback to summary
private Indexer indexer
linkerback to summary
private Linker linker
OUTPUT_DIRback to summary
private static final File OUTPUT_DIR
rootDirback to summary
private File rootDir
rootPathback to summary
private String rootPath

Constructor Detail

HtmlDemoback to summary
public HtmlDemo()

Method Detail

abortback to summary
private static void abort(String msg)
addLineNumbersback to summary
private String addLineNumbers(String source)
checkFileback to summary
private static File checkFile(String path)
generateHtmlback to summary
private void generateHtml() throws Exception
infoback to summary
private static void info(Object msg)
mainback to summary
public static void main(String[] args) throws Exception
makeOutputDirback to summary
private void makeOutputDir() throws Exception
markupback to summary
private String markup(String path) throws Exception
startback to summary
private void start(File stdlib, File fileOrDir) throws Exception
usageback to summary
private static void usage()