-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update vscode debugging files, add support for tags and datatables (#…
…2653) * add support for tags * add tasks and launch for debugging * remove launch.json from .gitignore * Add DataTables plugin for table functionality replacing tablesort
- Loading branch information
1 parent
f665157
commit 1efab90
Showing
7 changed files
with
112 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ logs | |
*.docx | ||
*.epub | ||
launch.json | ||
docs/MASVS/**/ | ||
docs/MASVS/*-MASVS-*.md | ||
docs/MASTG/**/ | ||
|
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,28 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Current File", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": true | ||
}, | ||
{ | ||
"name": "Python: MkDocs Serve", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/.venv/bin/mkdocs", // Adjust the path if mkdocs is not in a virtual environment | ||
"args": ["serve", "-a", "localhost:8002"], | ||
"console": "integratedTerminal", | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}/.venv/bin/python3" | ||
}, | ||
"preLaunchTask": "Run populate_dynamic_pages.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,27 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run structure_mastg.sh", | ||
"type": "shell", | ||
"command": "./src/scripts/structure_mastg.sh", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Run transform_files.py", | ||
"type": "shell", | ||
"command": "${workspaceFolder}/.venv/bin/python", | ||
"args": ["src/scripts/transform_files.py"], | ||
"problemMatcher": [], | ||
"dependsOn": "Run structure_mastg.sh" | ||
}, | ||
{ | ||
"label": "Run populate_dynamic_pages.py", | ||
"type": "shell", | ||
"command": "${workspaceFolder}/.venv/bin/python", | ||
"args": ["src/scripts/populate_dynamic_pages.py"], | ||
"problemMatcher": [], | ||
"dependsOn": "Run transform_files.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,28 @@ | ||
import logging | ||
import mkdocs.plugins | ||
|
||
log = logging.getLogger('mkdocs') | ||
|
||
# https://www.mkdocs.org/dev-guide/plugins/#on_page_markdown | ||
@mkdocs.plugins.event_priority(-50) | ||
def on_page_markdown(markdown, page, **kwargs): | ||
path = page.file.src_uri | ||
|
||
if "MASWE/" in path: | ||
|
||
tags = page.meta.get('tags', []) | ||
|
||
if page.meta.get('platform'): | ||
for platform in page.meta.get('platform', []): | ||
tags.append(platform) | ||
if page.meta.get('profiles'): | ||
for profile in page.meta.get('profiles', []): | ||
tags.append(profile) | ||
|
||
if page.meta.get('masvs-v2'): | ||
for masvs_v2 in page.meta.get('masvs-v2', []): | ||
tags.append(masvs_v2) | ||
|
||
page.meta['tags'] = tags | ||
|
||
return markdown |
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,5 @@ | ||
document$.subscribe(function() { | ||
$('table').DataTable({ | ||
paging: false | ||
}); | ||
}); |
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,3 @@ | ||
# Tags | ||
|
||
<!-- material/tags --> |
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 |
---|---|---|
|
@@ -141,6 +141,13 @@ theme: | |
favicon: assets/logo_circle.png | ||
icon: | ||
repo: fontawesome/brands/github | ||
tag: | ||
android: material/android | ||
ios: material/apple | ||
p: material/eye-circle-outline | ||
l1: material/circle | ||
l2: material/circle-multiple-outline | ||
r: material/circle-double | ||
features: | ||
- search.suggest | ||
- search.share | ||
|
@@ -167,15 +174,19 @@ theme: | |
|
||
extra_css: | ||
- stylesheets/extra.css | ||
- https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css | ||
extra_javascript: | ||
- javascripts/tablesort.min.js | ||
- javascripts/tablesorts.js | ||
- javascripts/external_links.js | ||
- https://code.jquery.com/jquery-3.5.1.js | ||
- https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js | ||
- javascripts/datatables.js | ||
plugins: | ||
# Uses https://github.com/mkdocs/mkdocs-redirects getting the redirects map from src/scripts/generate_redirects.py | ||
- search | ||
- awesome-pages | ||
- mermaid2 | ||
- tags | ||
# tags_file: tags.md # TODO: bug in mkdocs? dynamic tags from hooks not appearing in tags.md | ||
markdown_extensions: | ||
- meta | ||
- toc: | ||
|
@@ -210,6 +221,7 @@ hooks: | |
- docs/hooks/replace_snippets.py | ||
- docs/hooks/update_titles.py | ||
- docs/hooks/maswe-beta-banner.py | ||
- docs/hooks/add-tags.py | ||
|
||
extra: | ||
generator: false # removed but recreated in copyright above | ||
|
@@ -229,3 +241,10 @@ extra: | |
# - icon: fontawesome/solid/paper-plane | ||
# link: mailto:[email protected] | ||
# name: Sven Schleier | ||
tags: | ||
android: android | ||
ios: ios | ||
P: p | ||
L1: l1 | ||
L2: l2 | ||
R: r |