-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation and testing logic
- Update documentation release scripts to use sphinx-cmake instead of embedded the sphinx CMake module; - Use custom logic instead of 'lowdown' to handle changelog, as it doesn't seem to be maintained; - Update README to indicate support of CMake 3.30; - Use requirements.txt file to track Python dependencies used for testing; - Update documentation.
- Loading branch information
Showing
15 changed files
with
262 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Lowdown==0.2.1 | ||
Sphinx==5.1.1 | ||
sphinx-rtd-theme==1.0.0 | ||
sphinxcontrib-doxylink==1.12.2 | ||
Sphinx==7.* | ||
sphinx-cmake==0.* | ||
sphinx-rtd-theme==2.* | ||
sphinxcontrib-doxylink==1.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
from datetime import datetime | ||
|
||
from docutils import nodes | ||
from docutils.parsers.rst import directives | ||
from sphinx.util.docutils import SphinxDirective | ||
|
||
|
||
class ReleaseDirective(SphinxDirective): | ||
has_content = True | ||
required_arguments = 1 | ||
optional_arguments = 0 | ||
option_spec = { | ||
"date": directives.unchanged_required | ||
} | ||
|
||
def run(self): | ||
"""Creates a section for release notes with version and date.""" | ||
version = self.arguments[0] | ||
|
||
# Fetch today's date as default if no date is provided | ||
today_date_str = datetime.now().strftime("%Y-%m-%d") | ||
date_str = self.options.get("date", today_date_str) | ||
|
||
try: | ||
parsed_date = datetime.strptime(date_str, "%Y-%m-%d") | ||
release_date = parsed_date.strftime("%e %B %Y") | ||
except ValueError: | ||
raise ValueError(f"Invalid date format: {date_str}") | ||
|
||
# Create the version title node | ||
version_node = nodes.strong(text=version) | ||
section_title = nodes.title("", "", version_node) | ||
|
||
# Create the section node with a specific ID | ||
section_id = f"release-{version.replace(' ', '-')}" | ||
section = nodes.section( | ||
"", section_title, | ||
ids=[section_id], | ||
classes=["changelog-release"] | ||
) | ||
|
||
# Append formatted date | ||
section.append( | ||
nodes.emphasis(text=release_date, classes=["release-date"]) | ||
) | ||
|
||
# Parse content into a list of changes | ||
content_node = nodes.Element() | ||
self.state.nested_parse(self.content, self.content_offset, content_node) | ||
|
||
# Create a bullet list of changes | ||
changes_list = nodes.bullet_list("", classes=["changelog-change-list"]) | ||
for child in content_node: | ||
item = nodes.list_item("") | ||
item.append(child) | ||
changes_list.append(item) | ||
|
||
section.append(changes_list) | ||
|
||
return [section] | ||
|
||
|
||
class ChangeDirective(SphinxDirective): | ||
has_content = True | ||
required_arguments = 1 | ||
optional_arguments = 0 | ||
|
||
def run(self): | ||
"""Generates a categorized list item for a changelog entry.""" | ||
category = self.arguments[0] | ||
|
||
# Create a paragraph for the category with specific styling | ||
class_name = f"changelog-category-{category.lower().replace(' ', '-')}" | ||
category_node = nodes.inline( | ||
"", category, | ||
classes=["changelog-category", class_name] | ||
) | ||
paragraph_node = nodes.paragraph("", "", category_node) | ||
|
||
# Parse the detailed content under the category | ||
content_node = nodes.container() | ||
self.state.nested_parse(self.content, 0, content_node) | ||
paragraph_node += content_node | ||
|
||
return [paragraph_node] | ||
|
||
|
||
def setup(app): | ||
"""Register extension with Sphinx.""" | ||
app.add_directive("release", ReleaseDirective) | ||
app.add_directive("change", ChangeDirective) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.changelog-release { | ||
position: relative; | ||
} | ||
|
||
.changelog-release > h1, h2, h3, h4, h5 { | ||
margin-bottom: 5px; | ||
} | ||
|
||
.changelog-release em.release-date { | ||
color: #999; | ||
position: absolute; | ||
line-height: 2.5em; | ||
top: 0; | ||
right: 0; | ||
} | ||
|
||
.changelog-release ul.changelog-change-list { | ||
list-style: outside none none; | ||
} | ||
|
||
.changelog-release ul.changelog-change-list > li { | ||
list-style: outside none none; | ||
position: relative; | ||
margin: 0; | ||
padding: 8px 0 2px 120px; | ||
border-top: 1px solid #D6D6D6; | ||
} | ||
|
||
.rst-content .section .changelog-change-list ul li { | ||
list-style: initial; | ||
} | ||
|
||
.changelog-category { | ||
border-right: 3px solid #CCC; | ||
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05), 0px -1px 0px rgba(0, 0, 0, 0.05) inset; | ||
color: #333; | ||
display: inline-block; | ||
font-size: 0.7em; | ||
font-style: normal; | ||
font-weight: bold; | ||
line-height: 14px; | ||
padding: 4px 2px 4px 10px; | ||
text-shadow: 1px 1px 0px #FFF; | ||
text-transform: uppercase; | ||
width: 102px; | ||
position: absolute; | ||
top: 10px; | ||
left: 0px; | ||
background-color: #f8f8f8; | ||
} | ||
|
||
.changelog-category-fixed { | ||
border-color: #7C0; | ||
} | ||
|
||
.changelog-category-new { | ||
border-color: #11B0E9; | ||
} | ||
|
||
.changelog-category-changed { | ||
border-color: #EB3F3F; | ||
} |
Oops, something went wrong.