Skip to content

Commit

Permalink
Fix source code links in docs for real (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpedrie authored Mar 21, 2017
1 parent f69d0ba commit bfc6040
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dev/src/DocGenerator/Command/Docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ private function generateComponentDocumentation(
$toc = new TableOfContents(
$tocTemplate,
$component['id'],
$release,
$this->getComponentVersion($paths['manifest'], 'google-cloud'),
$paths['toc'],
$outputPath
$outputPath,
$release
);
$toc->generate($pretty);

Expand Down
8 changes: 6 additions & 2 deletions dev/src/DocGenerator/TableOfContents.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ class TableOfContents
private $componentVersion;
private $contentsPath;
private $outputPath;
private $release;

public function __construct(array $template, $componentId, $componentVersion, $contentsPath, $outputPath)
public function __construct(array $template, $componentId, $componentVersion, $contentsPath, $outputPath, $release = false)
{
$this->template = $template;
$this->componentId = $componentId;
$this->componentVersion = $componentVersion;
$this->contentsPath = $contentsPath;
$this->outputPath = $outputPath;
$this->release = $release;
}

public function generate($pretty = false)
Expand All @@ -40,7 +42,9 @@ public function generate($pretty = false)

$tpl = $this->template;
$tpl['services'] = $this->services($toc);
$tpl['tagName'] = $this->componentVersion;
$tpl['tagName'] = $this->release
? $this->componentVersion
: 'master';

$writer = new Writer($tpl, $this->outputPath, $pretty);
$writer->write('toc.json');
Expand Down

0 comments on commit bfc6040

Please sign in to comment.