-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4926 from himeshsiriwardana/replace-feature-json-…
…file Added hooks for IS 7 and 7.1 to make feature variables always true
- Loading branch information
Showing
7 changed files
with
60 additions
and
2 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
File renamed without changes.
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,26 @@ | ||
import os | ||
import json | ||
from mkdocs.structure.nav import Section, Page, Link | ||
|
||
def parse_json(file_path): | ||
features_to_remove = {"feature": {}, "page": []} | ||
with open(file_path, 'r') as json_file: | ||
parse_data = json.load(json_file) | ||
for feature, details in parse_data.items(): | ||
enabled = details['enabled'] | ||
page = details['page'] | ||
features_to_remove['feature'][feature] = enabled | ||
|
||
if not enabled: | ||
features_to_remove['page'].extend(page) | ||
json_file.close() | ||
return features_to_remove | ||
|
||
files_to_remove = parse_json(os.path.join(os.getcwd(), '../../features.json')) | ||
|
||
def on_config(config): | ||
|
||
for feature, enabled in files_to_remove['feature'].items(): | ||
config[feature] = True | ||
|
||
return config |
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 |
---|---|---|
|
@@ -23,6 +23,9 @@ extra: | |
base_path: /en/7.0.0 | ||
is_version: 7.0.0 | ||
|
||
hooks: | ||
- hooks.py | ||
|
||
plugins: | ||
- search: | ||
indexing: "full" | ||
|
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,26 @@ | ||
import os | ||
import json | ||
from mkdocs.structure.nav import Section, Page, Link | ||
|
||
def parse_json(file_path): | ||
features_to_remove = {"feature": {}, "page": []} | ||
with open(file_path, 'r') as json_file: | ||
parse_data = json.load(json_file) | ||
for feature, details in parse_data.items(): | ||
enabled = details['enabled'] | ||
page = details['page'] | ||
features_to_remove['feature'][feature] = enabled | ||
|
||
if not enabled: | ||
features_to_remove['page'].extend(page) | ||
json_file.close() | ||
return features_to_remove | ||
|
||
files_to_remove = parse_json(os.path.join(os.getcwd(), '../../features.json')) | ||
|
||
def on_config(config): | ||
|
||
for feature, enabled in files_to_remove['feature'].items(): | ||
config[feature] = True | ||
|
||
return config |
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 |
---|---|---|
|
@@ -23,6 +23,9 @@ extra: | |
base_path: /en/next | ||
is_version: next | ||
|
||
hooks: | ||
- hooks.py | ||
|
||
plugins: | ||
- search: | ||
indexing: "full" | ||
|
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