-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import project: suggest a config file (yaml)
I tried to add the intermediate page where we suggest a common Sphinx YAML file for the user to copy and paste. I found the pattern a little hard to follow. The base template didn't have all the blocks I needed, so I added some more but I don't feel comfortable with them. I also had to create a block to overwrite the CSS classes of the main div, which sounds weird to me as well. Besides, I'm not sure how to use the CSS classes to achieve what I need: syntax highlighting, smaller text, etc.
- Loading branch information
Showing
2 changed files
with
71 additions
and
4 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
61 changes: 61 additions & 0 deletions
61
readthedocsext/theme/templates/projects/import_config.html
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,61 @@ | ||
{% extends "projects/import_base.html" %} | ||
{% load i18n %} | ||
|
||
{% block project_add_content_subheader %} | ||
{% trans "Add a configuration file (<code>.readthedocs.yaml</code>) to your project" %} | ||
{% endblock project_add_content_subheader %} | ||
|
||
{% block project_add_css_classes %}ui ten wide tablet wide computer column{% endblock project_add_css_classes %} | ||
{% block project_add_content_main %} | ||
<p class="info"> | ||
{% blocktrans trimmed %} | ||
Make sure your project has a <code>.readthedocs.yaml</code> at the root of your repository. This file is required by Read the Docs to be able to build your documentation. You can <a href="https://docs.readthedocs.io/en/stable/config-file/v2.html">read more about this in our documentation</a>. | ||
{% endblocktrans %} | ||
</p> | ||
|
||
<p class="info"> | ||
Here you have an example for a common Sphinx project: | ||
|
||
<pre class="ui padded"> | ||
<code class="ui small text"> | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
# You can also specify other tool versions: | ||
# nodejs: "19" | ||
# rust: "1.64" | ||
# golang: "1.19" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
# formats: | ||
# - epub | ||
|
||
# Optionally, but recommended, | ||
# declare the Python requirements required to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
# python: | ||
# install: | ||
# - requirements: docs/requirements.txt | ||
</code> | ||
</pre> | ||
</p> | ||
|
||
{{ block.super }} | ||
{% endblock project_add_content_main %} | ||
|
||
{% block project_add_help_topics %} | ||
{% endblock project_add_help_topics %} |