diff --git a/libraries/constants.py b/libraries/constants.py index 51d2fbcbc..6e3b5a615 100644 --- a/libraries/constants.py +++ b/libraries/constants.py @@ -369,3 +369,60 @@ DOCKER_CONTAINER_URL_WEB = "http://web:8000" RELEASE_REPORT_AUTHORS_PER_PAGE_THRESHOLD = 6 +TOOLS = [ + { + "name": "AutoIndex", + "description": "AutoIndex is a tool for taking the grunt work out of indexing a Boostbook/Docbook document (perhaps generated by your Quickbook file mylibrary.qbk, and perhaps using also Doxygen autodoc) that describes C/C++ code.", + "version_specific": False, + "url_path": "https://github.com/boostorg/auto_index", + }, + { + "name": "BoostDep", + "description": "Boostdep is a tool for generating Boost dependency reports. It scans the header or source files of the Boost libraries for #include directives, builds a dependency graph from this information and outputs its findings in plain text or HTML.", + "version_specific": False, + "url_path": "https://github.com/boostorg/boostdep", + }, + { + "name": "boostlook", + "description": "A CSS framework for Boost C++ Library documentation.", + "url_path": "https://github.com/boostorg/boostlook", + "version_specific": False, + }, + { + "name": "Boost.Build", + "slug": "build", + "description": "The Boost build system, including the full Boost version of the jam sources.", + "version_specific": True, + "url_path": "tools/build/doc/html/index.html", + }, + { + "name": "Regression", + "description": "The Boost regression testing system reporting sources.", + "url_path": "https://www.boost.org/doc/contributor-guide/testing/regression-tests.html", + "version_specific": False, + }, + { + "name": "Inspect", + "description": "The inspection tool used to detect errors in the Boost directory hierarchy.", + "version_specific": True, + "url_path": "tools/inspect/index.html", + }, + { + "name": "BoostBook", + "description": "A Boost documentation system, based on DocBook and the Extensible Stylesheet Language (XSL), used by some Boost libraries.", + "version_specific": True, + "url_path": "tools/boostbook/index.html", + }, + { + "name": "bcp", + "description": "A utility to extract subsets of Boost; to determine which parts of Boost your code is using; and to print reports on Boost usage (including Licence information).", + "version_specific": True, + "url_path": "tools/bcp/", + }, + { + "name": "QuickBook", + "description": "QuickBook is a WikiWiki style documentation tool geared towards C++ documentation using simple rules and markup for simple formatting tasks. QuickBook generates BoostBook XML.", + "url_path": "/doc/libs/latest/doc/html/quickbook.html", + "version_specific": False, + }, +] diff --git a/libraries/utils.py b/libraries/utils.py index cdb88f029..0ad87d219 100644 --- a/libraries/utils.py +++ b/libraries/utils.py @@ -19,6 +19,7 @@ LEGACY_LATEST_RELEASE_URL_PATH_STR, DEVELOP_RELEASE_URL_PATH_STR, MASTER_RELEASE_URL_PATH_STR, + TOOLS, ) from versions.models import Version @@ -370,3 +371,39 @@ def generate_release_report_filename(version_slug: str, published_format: bool = filename_data.append(datetime.now(timezone.utc).isoformat()) filename = f"{'-'.join(filename_data)}.pdf" return filename + + +def get_tools(version=None): + """ + Return list of tool dictionaries. + + Tools are utilities used by Boost developers and users, + separate from libraries. They appear alongside libraries + in library list views. + + Args: + version: Optional Version object. If provided, tools with + version_specific=True will have their URLs generated + based on the version. + + Returns: + list: List of tool dictionaries with keys: + - name: str + - description: str + - url: str (generated for version_specific tools if version provided) + """ + version_slug = version.stripped_boost_url_slug + tools = [] + for tool in TOOLS.copy(): + tool_dict = tool.copy() + url_path = tool_dict.get("url_path", "") + if tool_dict.get("version_specific"): + if version: + tool_dict["url"] = f"/doc/libs/{version_slug}/{url_path}" + else: + tool_dict["url"] = "" + else: + # For non-version-specific tools, use url_path as-is (full URL) + tool_dict["url"] = url_path + tools.append(tool_dict) + return sorted(tools, key=lambda tool: tool["name"].lower()) diff --git a/libraries/views.py b/libraries/views.py index a11c146a7..763439b41 100644 --- a/libraries/views.py +++ b/libraries/views.py @@ -35,6 +35,7 @@ get_documentation_url_redirect, get_prioritized_version, get_version_from_cookie, + get_tools, ) from .constants import LATEST_RELEASE_URL_PATH_STR @@ -104,6 +105,7 @@ def get_queryset(self): def get_context_data(self, **kwargs): context = super().get_context_data(**self.kwargs) context["categories"] = self.get_categories(context["selected_version"]) + context["tools"] = get_tools(version=context.get("selected_version")) # todo: add tests for sort order if self.kwargs.get("category_slug"): context["category"] = Category.objects.get( @@ -210,6 +212,23 @@ def get_results_by_category(self, version: Version | None): results_by_category.append( {"category": category, "library_version_list": library_versions} ) + + # Add tools as a separate category + tools = get_tools(version=version) + if tools: + # Create a simple object for tools category + class ToolsCategory: + name = "Tools" + slug = "tools" + + results_by_category.append( + { + "category": ToolsCategory(), + "library_version_list": [], + "tools": tools, + } + ) + return results_by_category diff --git a/templates/libraries/_tool_categorized_list_item.html b/templates/libraries/_tool_categorized_list_item.html new file mode 100644 index 000000000..d56b4641b --- /dev/null +++ b/templates/libraries/_tool_categorized_list_item.html @@ -0,0 +1,23 @@ +{% if tool.url %} +
{{ tool.description }}
+Boost developers, testers, and maintainers have developed various programs to help with the administration of the Boost Libraries. Like everything else about Boost, these tools are available in source form, and are part of the regular Boost distribution.
+ {% endif %}Boost developers, testers, and maintainers have developed various programs to help with the administration of the Boost Libraries. Like everything else about Boost, these tools are available in source form, and are part of the regular Boost distribution.
+Boost developers, testers, and maintainers have developed various programs to help with the administration of the Boost Libraries. Like everything else about Boost, these tools are available in source form, and are part of the regular Boost distribution.
+