-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature flag to make
readthedocs
theme default on MkDocs docs (#4802)
* Feature flag to make `readthedocs` theme default on MkDocs docs Historically, we were using `readthedocs` as default theme for MkDocs but in #4556 we decided to change it to get the same behavior when building locally than in Read the Docs. This commit adds a Feature flag to keep having the old behavior for some particular projects so we can add these project and do not break their documentation (change the theme without asking/reason). * Typo
- Loading branch information
Showing
4 changed files
with
124 additions
and
1 deletion.
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
35 changes: 35 additions & 0 deletions
35
readthedocs/projects/migrations/0028_feature-flag-mkdocs-theme.py
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,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.16 on 2018-10-24 07:43 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
FEATURE_ID = 'mkdocs_theme_rtd' | ||
|
||
|
||
def forward_add_feature(apps, schema_editor): | ||
Feature = apps.get_model('projects', 'Feature') | ||
Feature.objects.create( | ||
feature_id=FEATURE_ID, | ||
# Not using ``default_true=True`` because we will do this manually in | ||
# the database from the Corporate site only, since this is not required | ||
# in the Community site | ||
# default_true=True, | ||
) | ||
|
||
|
||
def reverse_add_feature(apps, schema_editor): | ||
Feature = apps.get_model('projects', 'Feature') | ||
Feature.objects.filter(feature_id=FEATURE_ID).delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('projects', '0027_remove_json_with_html_feature'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward_add_feature, reverse_add_feature), | ||
] |
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
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