Hi Jens,

I've attached the files for the updated DocTest and the generated HTML. The HTML has: "Vi mäter temperaturer i °C" instead of "Vi mäter temperaturer i °C".

Thanks,
Carl
Title: Thrift module: DocTest

Thrift module: DocTest

ModuleServicesData typesConstants
DocTestThriftTest
BigDog
CodeInComment
EmptyStruct
FirstAndLastLine
FirstLineIndent
Flush
IndentedDocstring
IndentedTitle
Insanity
Irregular1
Irregular2
LastLine
NoStars
Numberz
OneField
SorryNoGo
StandardMultiLine
TotallyDegenerate
TrailingWhitespace
TrivialMultiLine
UserId
Xception
Xception2
Xtruct
Xtruct2
INT16CONSTANT
INT32CONSTANT
MAPCONSTANT

Constants

ConstantTypeValue
INT32CONSTANTi329853
You can document constants now too. Yeehaw!
INT16CONSTANTi161616
MAPCONSTANTmap<string, string>{ "hello" = "world", "goodnight" = "moon" }
Everyone get in on the docu-action!

Enumerations

Enumeration: Numberz

Some doc text goes here. Wow I am [nesting these] (no more nesting.)

ONE1
TWO2
THREE3
FIVE5
SIX6
EIGHT8

Type declarations

Typedef: UserId

Base type: i64

This is how you would do a typedef doc

Typedef: SorryNoGo

Base type: i32

Typedef: TrivialMultiLine

Base type: i32

This is a trivial example of a multiline docstring.

Typedef: StandardMultiLine

Base type: i32

This is the cannonical example of a multiline docstring.

Typedef: LastLine

Base type: i32

The last line is non-blank. I said non-blank!

Typedef: FirstAndLastLine

Base type: i32

Both the first line are non blank. ;-) and the last line

Typedef: IndentedTitle

Base type: i32

INDENTED TITLE The text is less indented.

Typedef: FirstLineIndent

Base type: i32

First line indented. Unfortunately, this does not get indented.

Typedef: CodeInComment

Base type: i32

void code_in_comment() { printf("hooray code!"); }

Typedef: IndentedDocstring

Base type: i32

Indented Docstring. This whole docstring is indented. This line is indented further.

Typedef: Irregular1

Base type: i32

Irregular docstring. * We will have to punt * on this thing

Typedef: Irregular2

Base type: i32

* note the space * before these lines * but not this * one

Typedef: Flush

Base type: i32

Flush against the left.

Typedef: NoStars

Base type: i32

No stars in this one. It should still work fine, though. Including indenting.

Typedef: TrailingWhitespace

Base type: i32

Trailing whitespace Sloppy trailing whitespace is truncated.

Typedef: BigDog

Base type: i32

This is a big one.

We'll have some blank lines in it.

void as_well_as(some code) { puts("YEEHAW!"); }

Typedef: TotallyDegenerate

Base type: i32



Data structures

Struct: Xtruct

KeyFieldTypeDescriptionRequirednessDefault value
1string_thingstringAnd the members of a struct default
4byte_thingbytedoct text goes before a comma default
9i32_thingi32default
11i64_thingi64default

And this is where you would document a struct

Struct: Xtruct2

KeyFieldTypeDescriptionRequirednessDefault value
1byte_thingbytedefault
2struct_thingXtructdefault
3i32_thingi32default

Struct: Insanity

KeyFieldTypeDescriptionRequirednessDefault value
1userMapmap<Numberz, UserId>This is doc for field 1 default
2xtructslist<Xtruct>And this is doc for field 2 default

Struct insanity

Exception: Xception

KeyFieldTypeDescriptionRequirednessDefault value
1errorCodei32default
2messagestringdefault

Exception: Xception2

KeyFieldTypeDescriptionRequirednessDefault value
1errorCodei32default
2struct_thingXtructdefault

Struct: EmptyStruct

KeyFieldTypeDescriptionRequirednessDefault value

Doc

Struct: OneField

KeyFieldTypeDescriptionRequirednessDefault value
1fieldEmptyStructdefault


Services

Service: ThriftTest

This is where you would document a Service

Function: ThriftTest.testVoid

void testVoid()
And this is how you would document functions in a service

Function: ThriftTest.testString

string testString(string thing)

Function: ThriftTest.testByte

byte testByte(byte thing)

Function: ThriftTest.testI32

i32 testI32(i32 thing)

Function: ThriftTest.testI64

i64 testI64(i64 thing)
Like this one

Function: ThriftTest.testDouble

double testDouble(double thing)

Function: ThriftTest.testStruct

Xtruct testStruct(Xtruct thing)

Function: ThriftTest.testNest

Xtruct2 testNest(Xtruct2 thing)

Function: ThriftTest.testMap

map<i32, i32> testMap(map<i32, i32> thing)

Function: ThriftTest.testSet

set<i32> testSet(set<i32> thing)

Function: ThriftTest.testList

list<i32> testList(list<i32> thing)

Function: ThriftTest.testEnum

Numberz testEnum(Numberz thing)
This is an example of a function with params documented

Parameters

NameDescription
thingThis param is a thing

Function: ThriftTest.testTypedef

UserId testTypedef(UserId thing)

Function: ThriftTest.testMapMap

map<i32, map<i32, i32>> testMapMap(i32 hello)

Function: ThriftTest.testInsanity

map<UserId, map<Numberz, Insanity>> testInsanity(Insanity argument)

Function: ThriftTest.testUtf

void testUtf()
Vi mäter temperaturer i °C

Attachment: DocTest.thrift
Description: Binary data

On Dec 22, 2012, at 1:51 AM, Jens Geyer <[email protected]> wrote:

Hi Carl,

I just added some text like in the sentence mentioned at the beginning of all docstrings in DocTest.thrift to test it. I can provide such a file, but not right now. At this occasion I noticed that Thrift does not accept UTF-8 nor 16 as input.

What I'm more interested in is the output you got. Could you send me the generated HTML?

Thanks,
JensG

  • Thrift 1800 Jens Geyer
    • Re: Thrift 1800 Carl Yeksigian

Reply via email to