sphinx-hackerrank
Build portable Interviewer Guidelines from maintained Sphinx guides.
Reuse Sphinx’s HTML renderer.
Export one standalone HTML fragment per question and language, plus a local preview index.
Build and preview without a HackerRank login or API token.
Installation
Requires Python 3.12+ and Sphinx 9.1.1+.
Installed packages need no sys.path changes.
Install from PyPI:
pip install sphinx-hackerrank
Or install a wheel from the GitHub release assets:
pip install https://github.com/adamtheturtle/sphinx-hackerrank/releases/download/2026.10.30.2/sphinx_hackerrank-2026.10.30.2-py3-none-any.whl
Enable the extension in conf.py:
"""Sphinx configuration."""
extensions = ["sphinx_hackerrank"]
Subsection exclusions
Keep the guide’s existing heading hierarchy when composing separate disclosures. Use :exclude-sections: to omit subsections from a parent selection:
.. interviewer-guideline-section:: widgets.rst
:section: Part 1 / Prompt
:language: python
:exclude-sections: Follow up questions
.. interviewer-guideline-section:: widgets.rst
:section: Part 1 / Prompt / Follow up questions
:language: python
Exclusions are heading paths relative to the selected section, or section labels within it.
List multiple exclusions on separate indented lines.
Missing or ambiguous exclusions fail the build, as does excluding the selected section itself.
Exclusions affect only the copied view. The source guide and other selections retain their content.
Language contexts
Configure how each language renders the guide’s Jinja context:
"""Sphinx configuration."""
hackerrank_jinja_context = "snippets"
hackerrank_languages = {
"python": {
"name": "Python",
"context": {"variants": [{"name": "Python", "lexer": "python"}]},
},
}
context overrides values in the configured Jinja context while that variant is parsed. The original configuration is restored afterwards.
name identifies redundant language disclosures to flatten in copied content.
Other part, category, and test-alternative disclosures remain intact.
Admonitions are omitted within hr-interviewer-guideline containers by default. Set hackerrank_exclude_admonitions = False to retain them. The full guide’s admonitions are unaffected.
Question mappings
Create a mapping beside each Interviewer Guideline, such as widgets-interviewer-guideline.yml beside widgets-interviewer-guideline.rst:
version: 1
questions:
- language: python
name: Widgets - Python
hackerrank_manifest_pattern defaults to **/*-interviewer-guideline.yml, relative to Sphinx’s source directory.
Nested directories and custom source layouts are supported.
The builder reads the language and name. Your publishing tool can manage extra fields such as question IDs.
Build and preview
sphinx-build -W -b hackerrank docs build/hackerrank
Open build/hackerrank/interviewer-guidelines/index.html to select a question and language.
Each preview uses the same self-contained HTML that can be saved as HackerRank Interviewer Guidelines.
Each code block has a keyboard-accessible Copy code button that preserves whitespace.
Copy buttons use JavaScript bundled with the output. Hosts must allow that script to run for the buttons to appear.
Native disclosure elements and code remain usable without JavaScript.
The builder also produces ordinary themed HTML pages. The extension’s directives work in the standard html builder too.
Sphinx’s native only directive can select builder_hackerrank, builder_html, or the shared html format tag.
Source links
By default, links to full guide pages point back into the local HTML build. To target a hosted documentation or source site, configure:
"""Sphinx configuration."""
hackerrank_source_url = "https://example.org/guides/"
hackerrank_source_suffix = ".html"
hackerrank_source_anchors = True
Set hackerrank_source_suffix to .rst when linking to source files.
Set hackerrank_source_anchors = False when the destination does not support anchors.
External URLs and links within a fragment are retained.
Publishing
Use a separate publishing tool to call the HackerRank API and manage credentials, question identities, candidate prompts, or projects.
Your publishing tool can read the generated fragments and verify saved Interviewer Guidelines.
Contributing
See CONTRIBUTING.rst for setup, linting, tests, and releases.
The sample under sample/source uses a custom Jinja context and nested guide files.
The wheel smoke test installs the built wheel into a fresh environment and builds that sample outside the checkout.
License
MIT. See LICENSE.
Metadata
Release files for sphinx-hackerrank 2026.10.30.2
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.10.30.2.tar.gz | 185.3 kB | With provenance | Details for sphinx_hackerrank-2026.10.30.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinx_hackerrank-2026.10.30.2-py3-none-any.whl | Python 3 | none | any | Details for sphinx_hackerrank-2026.10.30.2-py3-none-any.whl |
Total release size: 201.7 kB
Release files / sphinx_hackerrank-2026.10.30.2.tar.gz
| Download URL | sphinx_hackerrank-2026.10.30.2.tar.gz |
|---|---|
| Size | 185.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e29420df1d3f86fbf60748fd6ca2d959316ec1e85854d66604bfc02b0af8b13f
|
|
BLAKE2b-256 checksum How to use checksums |
a7c6c137f225aa0bae3a82ee769ea6f48b2be9a0af8212872dce8f1dff8e1d04
|
| 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 Oct 30, 2026.
Transparency logRelease files / sphinx_hackerrank-2026.10.30.2-py3-none-any.whl
| Download URL | sphinx_hackerrank-2026.10.30.2-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d722108bd7523594cd564b029de3129a30a2cbad8b5e274d499bbdb3d47aedc
|
|
BLAKE2b-256 checksum How to use checksums |
5e169191676d7929364536769972cd8c8c8f75889643c559490a624de5277470
|
| 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 Oct 30, 2026.
Transparency logSecurity for sphinx-hackerrank 2026.10.30.2
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.10.30.2.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 Oct 30, 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.