sphinx-hackerrank
Export selected Sphinx HTML as portable HackerRank Interviewer Guidelines. Fragments embed scoped styles, code-copy controls, and local images. Externally hosted images retain their URLs without being fetched during export.
Install and configure
pip install sphinx-hackerrank
Add to conf.py:
"""Sphinx configuration."""
from sphinx_hackerrank import GuidelineExport
extensions = ["sphinx_hackerrank"]
hackerrank_exports = [
GuidelineExport(
docname="review",
selector=".hr-interviewer-guideline",
output_path="interviewer-guidelines/widgets/review.html",
name="Widget review",
),
]
Write review.rst using ordinary RST and your chosen Sphinx extensions:
Widget review
=============
.. container:: hr-interviewer-guideline
Interviewer instructions go here.
.. code-block:: text
example input
For collapsible sections, use sphinx-toolbox.collapse. For excerpts from maintained guides, use sphinx-section-include. Consumers install and enable their own authoring and template extensions. See the sample and its dependencies.
Build
sphinx-build -W -b hackerrank docs build/hackerrank
Open build/hackerrank/interviewer-guidelines/index.html to preview the exports. Each request selects exactly one container and writes a unique HTML destination inside the build directory. Use the hr-interviewer-guideline class for the bundled styles and code-copy controls. The builder also produces ordinary themed pages. Use an extension such as sphinx-copybutton for copy buttons on those pages. The exporter’s script is embedded only in standalone fragments. Native disclosures and code remain usable without JavaScript. Hosts must allow the embedded script for copy buttons to appear.
The exporter preserves the selected content, including admonitions and headings. Consumers own composition, language contexts, filtering, question mappings, and publishing. Sphinx’s only directive supports builder_hackerrank, builder_html, or their shared html format tag.
Source links
Relative HTML links are rewritten for the export’s destination. To target a hosted guide or source site, configure:
"""Sphinx configuration."""
hackerrank_source_url = "https://example.org/guides/"
hackerrank_source_suffix = ".html"
hackerrank_source_anchors = True
Use .rst for source files, and disable anchors when the destination does not support them. External URLs and links within a fragment are retained.
Publishing
Use a separate tool to manage credentials, question identities, and HackerRank API calls.
When calling render_fragment directly with local images, supply image_paths mapping the rendered image URLs to their files. The builder supplies this mapping automatically. Missing or unsupported local images fail export instead of leaving broken URLs.
Contributing
See CONTRIBUTING.rst for checks and releases. Licensed under the MIT license. See LICENSE.
Metadata
Release files for sphinx-hackerrank 2026.11.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinx_hackerrank-2026.11.2.1.tar.gz | 182.7 kB | With provenance | Details for sphinx_hackerrank-2026.11.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinx_hackerrank-2026.11.2.1-py3-none-any.whl | Python 3 | none | any | Details for sphinx_hackerrank-2026.11.2.1-py3-none-any.whl |
Total release size: 195.0 kB
Release files / sphinx_hackerrank-2026.11.2.1.tar.gz
| Download URL | sphinx_hackerrank-2026.11.2.1.tar.gz |
|---|---|
| Size | 182.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5eb6c715e10892ebe7c83ab49ec75f8ca763bcc1722fff39eb58c658ff2f8e1e
|
|
BLAKE2b-256 checksum How to use checksums |
c70731eaee64cdc03c1ad97dad823b2119bae04efb6979a1277ad78809393dad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / sphinx_hackerrank-2026.11.2.1-py3-none-any.whl
| Download URL | sphinx_hackerrank-2026.11.2.1-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8e41d997223daea76d75eabc717ef8b5e29f7de8715420756feb77562204fb4
|
|
BLAKE2b-256 checksum How to use checksums |
e369bd18177936239c122319415ac9603108256e6c6294f676930ec57604baf8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for sphinx-hackerrank 2026.11.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sphinx_hackerrank-2026.11.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.