Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display in/out contracts #32

Open
zopsicle opened this issue Jun 16, 2019 · 5 comments
Open

Display in/out contracts #32

zopsicle opened this issue Jun 16, 2019 · 5 comments

Comments

@zopsicle
Copy link

doc2 inserts the in/out contracts in HTML. However, CSS causes them to be hidden. Is there a reason for this? I think it would be nice to show the contracts since they are part of the API.

adrdox/style.css

Lines 581 to 585 in e1c1c72

.function-prototype .in-contract,
.function-prototype .out-contract {
display: none;
white-space: pre;
}

@adamdruppe
Copy link
Owner

adamdruppe commented Jun 16, 2019 via email

@zopsicle
Copy link
Author

Perhaps display: none; could be removed, and the person that invokes doc2 could give a command-line flag if they want contracts to be included?

@adamdruppe
Copy link
Owner

adamdruppe commented Jun 16, 2019 via email

@zopsicle
Copy link
Author

I'm indifferent. I suppose listing them under headers Preconditions and Postconditions headers would be nice.

Perhaps the programmer could further clarify them if they write their own Preconditions and Postconditions headers (make them special like Throws, See_Also, etc).

/**
 * Does a foo.
 *
 * Preconditions:
 *
 * x must not be negative because bla.
 */
void foo(int x)
in (x >= 0)
{ ... }

Does a foo.

void foo(int x)

Preconditions

x must not be negative because bla.

in (x >= 0)

@adamdruppe
Copy link
Owner

adamdruppe commented Jun 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants