Formatting text in <code> blocks

Mar 10, 2011 at 8:37 PM


Is it possible to format the code in a "<code>" block so that it looks a little more like the code presentation in Visual Studio? Specifically, I'm interested in the text of my object and data type declarations assuming a different color than the rest of the code. For example, when the help file is generated and in the example section of a method I have

Int32 SomeType;
SomeObjectType ob1 = new SomeObjectType();

I'd like "Int32" and "SomeObjectType" to be presented in a different color than the text that follows them. Is this possible?

As an aside, thank you for maintaining this great tool!


Mar 11, 2011 at 1:48 AM

The colorizer matches keywords based on a limited set of contexts so it knows "int" but it doesn't know about object types such as "Int32" or "SomeObjectType".  You could add the common types such as "Int32" to the keyword lists but it still wouldn't know about the custom types in any particular block of code since it doesn't parse the code based on the language syntax like a compiler does.



Mar 11, 2011 at 7:14 PM

Thanks for the reply Eric. Can I add my custom types to the keyword list as well to get around this?



Mar 11, 2011 at 7:35 PM

Yes, you'll just need to update it to keep it current with your projects and when a new release of SHFB comes out.