-
-
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.
Addons: make default root CSS selector a shared option (#11767)
Add a "global" shared CSS root selector that is used all across our features: link previews, docdiff, search, embed API, etc. Also, put the "documentation tool name" as a top level config as well. With that information we can define better defaults for CSS selectors and other stuffs in the future if needed. Example: if documentation tool is set as Sphinx by the user, we will be able to use `[role=main] a.internal` for the Link Preview CSS selector. Related readthedocs/addons#433
- Loading branch information
Showing
7 changed files
with
88 additions
and
60 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
25 changes: 25 additions & 0 deletions
25
readthedocs/projects/migrations/0137_use_generic_root_selector.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,25 @@ | ||
# Generated by Django 4.2.16 on 2024-11-20 12:35 | ||
|
||
from django.db import migrations, models | ||
from django_safemigrate import Safe | ||
|
||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.before_deploy | ||
|
||
dependencies = [ | ||
('projects', '0136_addons_customscript_notnull'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='addonsconfig', | ||
name='options_root_selector', | ||
field=models.CharField(blank=True, help_text='CSS selector for the main content of the page. Leave it blank for auto-detect.', max_length=128, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='historicaladdonsconfig', | ||
name='options_root_selector', | ||
field=models.CharField(blank=True, help_text='CSS selector for the main content of the page. Leave it blank for auto-detect.', max_length=128, null=True), | ||
), | ||
] |
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,47 @@ | ||
# Generated by Django 4.2.16 on 2024-11-20 12:35 | ||
|
||
from django.db import migrations | ||
from django_safemigrate import Safe | ||
|
||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.after_deploy | ||
|
||
dependencies = [ | ||
('projects', '0137_use_generic_root_selector'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='addonsconfig', | ||
name='doc_diff_root_selector', | ||
), | ||
migrations.RemoveField( | ||
model_name='addonsconfig', | ||
name='linkpreviews_doctool_name', | ||
), | ||
migrations.RemoveField( | ||
model_name='addonsconfig', | ||
name='linkpreviews_doctool_version', | ||
), | ||
migrations.RemoveField( | ||
model_name='addonsconfig', | ||
name='linkpreviews_root_selector', | ||
), | ||
migrations.RemoveField( | ||
model_name='historicaladdonsconfig', | ||
name='doc_diff_root_selector', | ||
), | ||
migrations.RemoveField( | ||
model_name='historicaladdonsconfig', | ||
name='linkpreviews_doctool_name', | ||
), | ||
migrations.RemoveField( | ||
model_name='historicaladdonsconfig', | ||
name='linkpreviews_doctool_version', | ||
), | ||
migrations.RemoveField( | ||
model_name='historicaladdonsconfig', | ||
name='linkpreviews_root_selector', | ||
), | ||
] |
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
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