Skip to content

[docs] Remove "raw" from templates docs #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,43 @@ source_filename: templates
### Create the template file
To edit the template you will have to create a `.html` file to override the original one. Inside your `templates` directory create a directory named `rest_framework_docs` and inside this create the file `docs.html`. You can then extend/override the default template.

{% raw %}
{% extends "rest_framework_docs/base.html" %}
{% endraw %}


### Default Blocks

##### Styles (CSS)

{% raw %}
{% block style %}
<link rel="stylesheet" href="{% static "path/to/custom/css/style.css" %}">
{% endblock %}
{% endraw %}

##### GitHub Badge
To hide the GitHub badge from the page, just override it with an empty block.

{% raw %}{% block github_badge %}{% endblock %}{% endraw %}
{% block github_badge %}{% endblock %}

##### Title

{% raw %}{% block title %}Project Name{% endblock %}{% endraw %}
{% block title %}Project Name{% endblock %}

##### Logo

{% raw %}
{% block logo %}
<a class="navbar-brand" href="http://www.drfdocs.com/">DRF Docs</a>
{% endblock %}
{% endraw %}

##### Jumbotron

{% raw %}
{% block jumbotron %}
<div class="jumbotron">
<h1>Project Title</h1>
<h3>Documentantion of the project 'Example'.</h3>
</div>
{% endblock %}
{% endraw %}

##### Footer

{% raw %}
{% block footer %}
<div class="footer">
<div class="links">
Expand All @@ -61,13 +52,11 @@ To hide the GitHub badge from the page, just override it with an empty block.
Copyright © 2015 Emmanouil Konstantinidis.
</div>
{% endblock %}
{% endraw %}


### Complete Example
File location: `templates/rest_framework_docs/docs.html`

{% raw %}
{% extends "rest_framework_docs/base.html" %}

{% block title %}Project Name{% endblock %}
Expand All @@ -81,5 +70,3 @@ File location: `templates/rest_framework_docs/docs.html`
{% endblock %}

{% block footer %}<div class="footer">Copyright © 2016 Project Name.</div>{% endblock %}

{% endraw %}