Skip to content

Commit

Permalink
Add a trailing slash at the end of URLs (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
daizutabi committed Aug 3, 2020
1 parent 3764ef1 commit 0c4cb2a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## [Unreleased]
### Fixed
- Handle parsing empty line ([#23](https://github.com/daizutabi/mkapi/pull/23)). Thanks to [tony](https://github.com/tony).
- Typo ([#24](https://github.com/daizutabi/mkapi/pull/24)). Thanks to [tony](https://github.com/tony).
- Add a slash at the end of URL ([#25](https://github.com/daizutabi/mkapi/issues/25)).


## [1.0.12] - 2020-07-29
Expand Down
2 changes: 1 addition & 1 deletion mkapi/core/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def func(match):
module, object = match.groups()
link = f'<span id="{object}"></span>'
link += f'<a class="mkapi-docs-link" title="{object}" '
link += f'href="../../{module}#{object}">DOCS</a>'
link += f'href="../../{module}/#{object}">DOCS</a>'
return link

return COMMENT_PATTERN.sub(func, html)
Expand Down
2 changes: 1 addition & 1 deletion mkapi/core/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def sourcelink(object: Object) -> str:
link = f'<span id="{object.id}"></span>'
else:
link = ""
link += f'<a class="mkapi-src-link" href="../source/{object.module}'
link += f'<a class="mkapi-src-link" href="../source/{object.module}/'
link += f'#{object.id}" title="Source for {object.id}">&lt;/&gt;</a>'
return link

Expand Down
2 changes: 1 addition & 1 deletion mkapi/templates/object.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
{% if 'sourcelink' in filters or 'link' in filters or 'apilink' in filters -%}
<div class="mkapi-src-link">
<a class="mkapi-src-link" href="../source/{{ object.module }}#{{ object.id }}" title="Source for {{ object.id }}">&lt;/&gt;</a>
<a class="mkapi-src-link" href="../source/{{ object.module }}/#{{ object.id }}" title="Source for {{ object.id }}">&lt;/&gt;</a>
</div>
{%- endif %}
</div>

0 comments on commit 0c4cb2a

Please sign in to comment.