Logo Search packages:      
Sourcecode: ndoc version File versions  Download package

NDoc::Documenter::LinearHtml::LinearHtmlDocumenter Class Reference

Inheritance diagram for NDoc::Documenter::LinearHtml::LinearHtmlDocumenter:

NDoc::Core::Reflection::BaseReflectionDocumenter NDoc::Core::BaseDocumenter NDoc::Core::IDocumenter

List of all members.


Detailed Description

This creates a linear (serial, more printable) html file from an ndoc xml file. This was designed and implemented with the intention that the html will be inserted into a Word document, but this could be useful for other scenarios.

	    The document produced is organized as follows:
	       Namespaces List: a section listing namespaces and which assembly 
	          they're from, and optionally their namespace summaries.
	       Namespace: a section for each namespace
	   			Types List: a list of classes, interfaces, etc in the 
	   			    namespace, with their summaries.
	   			Type: Classes
	   			Type: Interfaces
	   			Type: Enumerations
	   			Type: Structs
	   			Type: Delegates
	   	

This class uses C#'s xml processing capabilities rather than xslt. This was more or less an experiment, and I'm not sure whether this is better than an xslt implementation or not. The complexity might be similar, but I expect this implementation to be many times faster than an equivalent xslt implementation.

This class writes a single linear html file, but traverses the xml document pretty much just once. To do this, multiple XmlTextWriters are create such that they can be written to in any order. Then at the end the memory buffers written by each text writer are copied to the output file in the appropriate order.

This has a Main for easier and faster test runs outside of NDoc.

Definition at line 85 of file LinearHtmlDocumenter.cs.


Public Member Functions

override void Build (Project project)
 See IDocumenter.
virtual string CanBuild (Project project)
 See IDocumenter.CanBuild.
override string CanBuild (Project project, bool checkInputOnly)
 See IDocumenter.
override void Clear ()
 See IDocumenter.
int CompareTo (object obj)
 Compares the currrent document to another documenter.
 LinearHtmlDocumenter ()
 Default constructor.
bool Load (Stream s)
 Load the specified NDoc Xml into this object's memory. This is useful when this class is used outside of the context of NDoc.
bool Load (string fileName)
 Load the specified NDoc Xml file into this object's memory. This is useful when this class is used outside of the context of NDoc.
virtual void View ()
 See IDocumenter.View.

Static Public Member Functions

static void Main (string[] args)
 The main entry point for the application.
static string ToAccessDeclaration (string typeAccess)
 Convert an access string as in the xml (Public, Family, etc) to one like we want for declarations (public, protected, etc).
static string ToSimpleType (string s)
 Convert a full type name like System.Int32 to the more simple version "int".
static string TypeBaseName (string typeName)
 Return the base of the input type name. For example the base of System.String is String.

Protected Member Functions

string MakeXml (Project project)
 Returns reflected metadata combined with the /doc comments.
void MakeXmlFile (Project project, string fileName)
 Writes reflected metadata combined with the /doc comments to the specified file.
void OnDocBuildingProgress (int progress)
 Raises the DocBuildingProgress event.
void OnDocBuildingStep (int step, string label)
 Raises the DocBuildingStep event.

Properties

IDocumenterConfig Config [get, set]
 See IDocumenter.Config.
override
DocumenterDevelopmentStatus 
DevelopmentStatus [get]
 The development status (alpha, beta, stable) of this documenter. Documenters should override this if they aren't stable.
override string MainOutputFile [get]
 See IDocumenter.
LinearHtmlDocumenterConfig MyConfig [get]
 Cast to my type.
string Name [get]
 Gets the display name of this documenter.
string WorkingPath [get]

Events

DocBuildingEventHandler DocBuildingProgress
 See IDocumenter.DocBuildingProgress.
DocBuildingEventHandler DocBuildingStep
 See IDocumenter.DocBuildingStep.

Private Member Functions

void AddTableEntry (XmlTextWriter xtw, params object[] args)
 Write a table entry (one row) consisting of one or more columns of text.
void AddTableEntryRaw (XmlTextWriter xtw, params object[] args)
 Write a table entry (one row) consisting of one or more columns of text, written Raw.
bool DeleteWriters ()
 Close all writers. They need to be re-created for the next build.
void DumpNavTree (XPathNavigator nav, string prefix)
 For debugging, display the node local names starting from a particular node.
bool EmitHtml (string fileName)
 This writes the html corresponding to the xml we've already internalized.
void EndTable (XmlTextWriter xtw)
 End a table. This is provided for symmetry, and in case there's something else I have to write in tables in the future.
bool EndWriters ()
 Do whatever is neccesary to any writers before emitting html.
void FixCodeNodes (XPathNavigator nav)
 Fix code node such that it will be rendered correctly (using pre).
void FixCodeNodes (XmlNode topNode)
 Fix code node such that it will be rendered correctly (using pre).
XPathNavigator GetChildNodeWithName (XPathNavigator startNavigator, string nodeName)
 Return a new XPathNavigator pointing to the first child node of the specified name.
ArrayList GetChildren (XPathNavigator nav, string localName)
 Get the children of the current node which have the specified localName.
XPathNavigator GetDescendantNodeWithName (XPathNavigator startNavigator, string nodeName)
 Return a new XPathNavigator pointing to the first descendant node with the specified name.
ArrayList GetDescendants (XPathNavigator nav, string localName)
 Get the descendants of the current node which have the specified localName. This just provides a different iteration style from XPathNavigator.SelectDescendants().
string GetNamespaceHtmlId (string namespaceName)
 Turn a namespace name into an html id we can use for links.
string GetNodeXmlFixCode (XPathNavigator nav)
 Fix any code nodes under the specified navigator, and return the node's inner Xml.
SortedList GetSortedChildren (XPathNavigator nav, string localName, string attrName)
 Returns a SortedList which links each child node's attribute value (sorted, of course) to an XPathNavigator pointing to that node. This selects child nodes based on node local name. This just looks at immediate children, not all descendants.
void GetSummaryAndRemarks (XPathNavigator nav, out string summary, out string remarks)
string GetTypeHtmlId (string typeName)
 Turn a type name into an html id we can use for links.
string KeyWrap (string s)
 Create a string which wraps the input string with a span tag with a particular html class attribute.
bool MakeHtml (string outputFileName)
 Build and emit the html document from the loaded NDoc Xml document.
void MakeHtmlDetailsForMethod (string parentTypeName, string memberType, XPathNavigator nav, XmlTextWriter xtw)
 Write html for a single method.
void MakeHtmlForAssembly (XPathNavigator nav)
 Do the build operations given that the specified XPathNavigator is pointing to an assembly node.
void MakeHtmlForMethodParameterDetails (XPathNavigator nav, XmlTextWriter xtw)
 Write a parameter list to the specified writer.
void MakeHtmlForModule (XPathNavigator nav, string assemblyName, string assemblyVersion)
 Do the build operations given that the specified XPathNavigator is pointing to a module node.
void MakeHtmlForNamespace (XPathNavigator nav, string assemblyName, string assemblyVersion)
 Do the build operations given that the specified XPathNavigator is pointing to a namespace node.
void MakeHtmlForType (XPathNavigator nav, string namespaceName)
 Builds html for a Type. An Type here is a class, struct, interface, etc.
void MakeHtmlForTypeMember (string parentTypeName, string memberType, XPathNavigator nav, XmlTextWriter xtw)
 Make (and write) html for a Type (class, interface, ...) member, such as a property, field, etc.
void MakeHtmlForTypeUsingCs (XPathNavigator nav, XmlTextWriter xtw, string namespaceName)
 Document the current node's type using C#.
void MakeHtmlForTypeUsingXslt (XPathNavigator nav, XmlTextWriter xtw, string namespaceName)
 Use Xslt transform to document this type.
string MakeHtmlTypeDeclaration (XPathNavigator nav)
 Make a string for a Type declaration, such as "public class Foo : IComparable".
void MakeHtmlTypeList (XPathNavigator nav, string namespaceName)
 Write some html containing the list of types in this namespace.
string MakeMethodDeclaration (XPathNavigator nav, string parentTypeName)
 Make a string for a method (including constructor) declaration, such as "public bool Foo(int x, int y, string s)".
string MakeMethodParametersString (XPathNavigator nav)
 Make a string for a method's parameter list, such as "int x, int y, string s".
string NamespaceLinkReferenceWrap (string namespaceName)
 Create a string which wraps the input string to make it a link to the specified namespace.
void StartNamespaceSectionWriter (string namespaceName, string sectionName)
 Create a namespace section writer if one doesn't already exist for the specified namespace and section.
bool StartTable (XmlTextWriter xtw, string id, int width, string[] columnNames)
 Write the starting tags for a table to the specified writer.
bool StartWriters ()
 Setup any text writers.
string TypeLinkReferenceWrap (string typeName)
 Create a string which wraps the input string to make it a link to the specified type.
bool TypeMatchesIncludeRegexp (XPathNavigator nav)
 This checks whether the Type represented by the specified node matches the include type regexp.
string TypeRefWrap (string s)
 Create a string which wraps the input string with a span tag with a particular html class attribute.
void WriteNodeFixCode (XmlTextWriter xtw, XPathNavigator nav, string elemType)

Private Attributes

XmlTextWriter namespaceListWriter
 Writer for the first section, the namespace list.
Hashtable namespaceSections
 Hashtable from xml node name to section name. For example class to Classes.
Hashtable namespaceWriters
 A hashtable from namespace name to Hashtables which go from section name (Classes, Interfaces, etc) to XmlTextWriters for that section.
string[] orderedMemberTypes = { "constructor", "field", "property", "method" }
 A list of Type (class, interface) member types, to specify the order in which they should be rendered.
string[] orderedNamespaceSections
 The namespace sections in the order they will be emitted.
XslTransform typeTransform
 This transform can be used for each type. This is incomplete.
bool useXslt = false
Workspace workspace = null
XPathNavigator xPathNavigator
 The main navigator which keeps track of where we are in the document.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index