Skip to content

add support for checking examples in rst documentations#1

Merged
K-Phoen merged 1 commit intoK-Phoen:masterfrom
agallou:rst
May 29, 2016
Merged

add support for checking examples in rst documentations#1
K-Phoen merged 1 commit intoK-Phoen:masterfrom
agallou:rst

Conversation

@agallou
Copy link
Copy Markdown
Contributor

@agallou agallou commented May 25, 2016

tested on atoum/atoum-documentation#209
Rusty allowed us to find some errors. Thanks.

Comment thread src/Extractor/Rst.php
{
$parser = new Parser();

$parser->getEnvironment()->setErrorManager(new class() extends ErrorManager {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to do that? Is it going to silence parse errors in the document?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because some directives are not supported by the parser (we only need the code example directives). And when it appends an ugly echo is made : https://github.com/Gregwar/RST/blob/master/ErrorManager.php#L19. This anonymous class prevents that.

@K-Phoen
Copy link
Copy Markdown
Owner

K-Phoen commented May 26, 2016

Awesome, thanks for this PR! 👍

@K-Phoen K-Phoen merged commit d466089 into K-Phoen:master May 29, 2016
@K-Phoen
Copy link
Copy Markdown
Owner

K-Phoen commented May 29, 2016

Merged, thanks :)

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

Successfully merging this pull request may close these issues.

2 participants