Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/full_render_doc-en_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
run: "php doc-base/configure.php --disable-libxml-check --enable-xml-details --redirect-stderr-to-stdout"

- name: "Render documentation for doc-en"
run: "php phd/render.php --docbook doc-base/.manual.xml --package PHP --format xhtml --format bigxhtml --format php --format tocfeed --forceindex --output output"
run: "php phd/render.php --docbook doc-base/.manual.xml --package PHP --format xhtml --format bigxhtml --format php --format tocfeed --format markdown --forceindex --output output"
26 changes: 26 additions & 0 deletions phpdotnet/phd/PI/MarkdownPHPDOCHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
namespace phpdotnet\phd;

class PI_MarkdownPHPDOCHandler extends PI_PHPDOCHandler {

protected function generateChangelogMarkup($changelogs): string {
usort($changelogs, [PI_PHPDOCHandler::class, '_sortByVersion']);

$ret = "| Version | Function | Description |\n| --- | --- | --- |\n";
$desc = "";
$lastVersion = "";
foreach ($changelogs as $entry) {
if (!$this->_changelogSince || version_compare($entry["version"], $this->_changelogSince) >= 0) {
$link = $this->format->createLink($entry["docbook_id"], $desc);
$version = ($entry["version"] === $lastVersion) ? "" : $entry["version"];
$description = html_entity_decode($entry["description"], ENT_QUOTES | ENT_HTML5, 'UTF-8');
$description = preg_replace('/\s+/', ' ', trim($description));
$description = str_replace('|', '\\|', $description);
$ret .= sprintf("| %s | [%s](%s) | %s |\n", $version, $desc, $link, $description);
$lastVersion = $entry["version"];
}
}
$this->_changelogSince = null;
return $ret;
}
}
1 change: 1 addition & 0 deletions phpdotnet/phd/Package/PHP/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Package_PHP_Factory extends Format_Factory {
'tocfeed' => 'Package_PHP_TocFeed',
'epub' => 'Package_PHP_Epub',
'enhancedchm' => 'Package_PHP_EnhancedCHM',
'markdown' => 'Package_PHP_Markdown',
);

/**
Expand Down
Loading