Skip to content

Commit ea3a463

Browse files
committed
Remove guides directory
There is no point in having build process copying files from one directory to another when there is only one target
1 parent 8b456a1 commit ea3a463

35 files changed

+17
-6309
lines changed

RoboFile.php

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -53,68 +53,13 @@ public function buildDocs()
5353
$this->taskComposerUpdate()->preferSource()->run();
5454
$this->buildDocsModules();
5555
$this->buildDocsUtils();
56-
$this->buildDocsGuides();
5756
$this->buildDocsCommands();
5857
$this->buildDocsStub();
5958
$this->buildDocsApi();
6059
$this->buildDocsExtensions();
6160
$this->changelog();
6261
}
6362

64-
public function buildDocsGuides() {
65-
$guides = Finder::create()
66-
->ignoreVCS(true)
67-
->depth('== 0')
68-
->name('*.md')
69-
->sortByName()
70-
->in('guides');
71-
72-
$guidesLinks = [];
73-
74-
foreach ($guides as $file) {
75-
$filename = $file->getBasename();
76-
$name = substr($filename, 0, -3);
77-
$titleName = preg_replace("(\d+-)", '', $name);
78-
79-
$link = "/docs/$titleName";
80-
81-
$editLink = 'https://github.com/Codeception/codeception.github.com/edit/master/guides/' . $filename;
82-
$title = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $titleName);
83-
$title = preg_replace('/([a-z\d])([A-Z])/', '\\1 \\2', $title);
84-
85-
$contents = file_get_contents($file->getPathname());
86-
if (file_exists("docs/4.x/$titleName.md" )) {
87-
$prevVersionLink = '<div class="alert alert-success">💡 <b>You are reading docs for latest Codeception 5</b>. <a href="/docs/4.x/' . $titleName . '">Read for 4.x</a></div>';
88-
} else {
89-
$prevVersionLink = '';
90-
}
91-
92-
$this->taskWriteToFile('docs/' . $titleName . '.md')
93-
->line('---')
94-
->line('layout: doc')
95-
->line("title: $title - Codeception Docs")
96-
->line('---')
97-
->line('')
98-
->line($prevVersionLink)
99-
->line('')
100-
->text($contents)
101-
->line('')
102-
->line('<div class="alert alert-warning"><a href="'.$editLink.'"><strong>Improve</strong> this guide</a></div>')
103-
->run();
104-
105-
$this->taskWriteToFile('docs/' . $filename)
106-
->line('<meta http-equiv="refresh" content="0;url=https://codeception.com/docs/' . $titleName. '">')
107-
->line('')
108-
->line('<div class="alert alert-warning">')
109-
->line(' See <a href="https://codeception.com/docs/' . $titleName . '">' . $title . '</a>')
110-
->line('</div>')
111-
->run();
112-
113-
$guidesLinks[] = "<li><a href=\"$link\">$title</a></li>";
114-
}
115-
file_put_contents('_includes/guides.html', implode("\n", $guidesLinks));
116-
}
117-
11863
public function buildDocsModules()
11964
{
12065
$this->taskCleanDir('docs/modules')->run();

docs/APITesting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,4 +383,4 @@ class Api extends \Codeception\Module {
383383
Codeception has two modules that will help you to test various web services. They need a new `api` suite to be created. Remember, you are not limited to test only response body. By including `Db` module you may check if a user has been created after the `CreateUser` call. You can improve testing scenarios by using REST or SOAP responses in your helper methods.
384384

385385

386-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/10-APITesting.md"><strong>Improve</strong> this guide</a></div>
386+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/APITesting.md"><strong>Improve</strong> this guide</a></div>

docs/AcceptanceTests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,4 +769,4 @@ You can easily test your Joomla, Drupal, WordPress sites, as well as those made
769769
Writing acceptance tests is like describing a tester's actions in PHP. They are quite readable and very easy to write.
770770
If you need to access the database, you can use the [Db Module](https://codeception.com/docs/modules/Db).
771771

772-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/03-AcceptanceTests.md"><strong>Improve</strong> this guide</a></div>
772+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/AcceptanceTests.md"><strong>Improve</strong> this guide</a></div>

docs/AdvancedUsage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,4 +730,4 @@ Of course, you are not allowed to have *cyclic dependencies*.
730730

731731

732732

733-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/07-AdvancedUsage.md"><strong>Improve</strong> this guide</a></div>
733+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/AdvancedUsage.md"><strong>Improve</strong> this guide</a></div>

docs/BDD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,4 +576,4 @@ Inside `@depends` block you should use test signature. Execute your feature with
576576
If you like the concept of Behavior Driven Development or prefer to keep test scenarios in human readable format, Codeception allows you to write and execute scenarios in Gherkin. Feature files is just another test format inside Codeception, so it can be combined with Cept and Cest files inside the same suite. Steps definitions of your scenarios can use all the power of Codeception modules, PageObjects, and StepObjects.
577577
578578
579-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/07-BDD.md"><strong>Improve</strong> this guide</a></div>
579+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/BDD.md"><strong>Improve</strong> this guide</a></div>

docs/Codecoverage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,4 @@ coverage:
202202

203203
Context stream options are [well documented at php.net](https://php.net/manual/en/context.php)
204204

205-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/11-Codecoverage.md"><strong>Improve</strong> this guide</a></div>
205+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/Codecoverage.md"><strong>Improve</strong> this guide</a></div>

docs/ContinuousIntegration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,4 @@ php vendor/bin/codecept run
204204

205205
Travis doesn't provide visualization for XML or HTML reports so you can't view reports in format any different than console output. However, Codeception produces nice console output with detailed error reports.
206206

207-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/12-ContinuousIntegration.md"><strong>Improve</strong> this guide</a></div>
207+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/ContinuousIntegration.md"><strong>Improve</strong> this guide</a></div>

docs/Customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,4 +549,4 @@ It is possible to run specific suites from included applications:
549549
* `codecept run functional,*::unit` ⬅ Runs included unit suites and root functional suite
550550

551551

552-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/08-Customization.md"><strong>Improve</strong> this guide</a></div>
552+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/Customization.md"><strong>Improve</strong> this guide</a></div>

docs/Data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,4 @@ The snapshot file will be stored without encoding it to json format, and with th
364364

365365
> Beware that this option will not perform any changes in the data returned by `fetchData`, and store it as it is.
366366

367-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/09-Data.md"><strong>Improve</strong> this guide</a></div>
367+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/Data.md"><strong>Improve</strong> this guide</a></div>

docs/Debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ codecept_pause(['user' => $user]);
8181
```
8282

8383

84-
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/guides/06-Debugging.md"><strong>Improve</strong> this guide</a></div>
84+
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/Debugging.md"><strong>Improve</strong> this guide</a></div>

0 commit comments

Comments
 (0)