Skip to content
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

Integrating Nuclia Widget #792

Draft
wants to merge 102 commits into
base: nuclia
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
99a154c
Integrating Nuclia Widget
justdaksh Sep 3, 2023
520b294
removing redundant searchtester script
justdaksh Sep 3, 2023
b4533ea
Merged with main
justdaksh Sep 16, 2023
26ba768
Merged with main
justdaksh Sep 16, 2023
e752db2
Revert "Merged with main"
justdaksh Sep 16, 2023
2f72d6b
Merging with main
justdaksh Sep 16, 2023
642e5e0
Resolved conflicts of widget with nuclia
justdaksh Sep 16, 2023
a6aca93
Updated nuclia_sync.yml
justdaksh Sep 16, 2023
aa591bf
Updated Environment varibles
justdaksh Sep 17, 2023
ae4d412
Merge branch 'nuclia_widget' of https://github.com/plone/training int…
justdaksh Sep 17, 2023
c20299a
Updating env varibale to upload job
justdaksh Sep 17, 2023
00dda20
Functioning breadcrumbs,Debugging CI
justdaksh Sep 18, 2023
cdb9d41
Removed breadmaker.py && heading_to_breadcrumb_mapping.json
justdaksh Sep 18, 2023
95037a4
Updated nuclia workflow
justdaksh Sep 18, 2023
69e1658
Nuclia Sync: Updated docs
invalid-email-address Sep 18, 2023
adf5cbd
remove print statements
justdaksh Sep 18, 2023
8262dda
Merge branch 'nuclia_widget' of https://github.com/plone/training int…
justdaksh Sep 18, 2023
09683d9
Rerunning jobs for debugging
justdaksh Sep 18, 2023
dfc5dfe
Updating Commit Changes Run
justdaksh Sep 18, 2023
38cd562
Nuclia Sync: Updated docs
invalid-email-address Sep 18, 2023
930ebfe
Reverting to using JSON for breadcrumbs insted of metadata
justdaksh Sep 19, 2023
323e5de
Merge branch 'nuclia_widget' of https://github.com/plone/training int…
justdaksh Sep 19, 2023
dd68adf
Nuclia Sync: Updated docs
invalid-email-address Sep 19, 2023
c0d8c37
Updated searchhtml
justdaksh Sep 19, 2023
0572655
Merge branch 'nuclia_widget' of https://github.com/plone/training int…
justdaksh Sep 19, 2023
7d30969
Nuclia Sync: Updated docs
invalid-email-address Sep 19, 2023
4e53835
Using metadata,style changes
justdaksh Sep 20, 2023
adb5743
Updating workflow
justdaksh Sep 21, 2023
b5c5647
Added field parameter to upload script
justdaksh Oct 1, 2023
28b2a20
Style Changes on results
justdaksh Oct 1, 2023
6dc5fdc
title font-size change
justdaksh Oct 1, 2023
5823c65
Merge branch 'main' into nuclia_widget
justdaksh Oct 15, 2023
731c4d9
Merge branch 'refs/heads/main' into nuclia_widget
stevepiercy May 21, 2024
1257b91
Merge remote-tracking branch 'origin/nuclia_widget' into nuclia_widget
stevepiercy May 21, 2024
3373a37
Merge branch 'nuclia' into nuclia_widget
stevepiercy May 21, 2024
3f214f7
refactor: volto customization for JS beginners
nileshgulia1 Nov 2, 2024
f044b3a
remove some chapters,fix grammer
nileshgulia1 Nov 2, 2024
9fb4a52
fix weather block
nileshgulia1 Nov 2, 2024
9adc25f
simplified installation docs
nileshgulia1 Nov 2, 2024
7811dfb
fix prerequisites
nileshgulia1 Nov 2, 2024
4d8b8aa
fix blank line
nileshgulia1 Nov 2, 2024
b82654d
fix code block
nileshgulia1 Nov 3, 2024
0a78266
initial commit
iRohitSingh Nov 3, 2024
e11dd6c
Merge branch 'main' into rafactor-volto-customization
claudiaifrim Nov 4, 2024
cca0c31
use correct command for pnpm workspaces
nileshgulia1 Nov 4, 2024
482f91a
amend more worspace hints
nileshgulia1 Nov 4, 2024
d91612d
pin matching Plone and Volto versions correctly
nileshgulia1 Nov 5, 2024
93bffda
Merge branch 'main' into rafactor-volto-customization
nileshgulia1 Nov 7, 2024
d9c8dcd
Apply suggestions from code review
nileshgulia1 Nov 7, 2024
6e843e8
refactor: apply leftover suggestions
nileshgulia1 Nov 7, 2024
a650478
replace occurances of <a> in links by md
nileshgulia1 Nov 8, 2024
722b66a
Merge branch 'main' into nuclia_widget
stevepiercy Nov 9, 2024
0893762
Merge branch 'nuclia' into nuclia_widget
stevepiercy Nov 9, 2024
fb1ec8a
Merge branch 'nuclia' into nuclia_widget
stevepiercy Nov 9, 2024
fefecda
fix search page
ebrehault Nov 9, 2024
daa573a
Move search results inside the searchtext block, and wrap with a styl…
stevepiercy Nov 10, 2024
85de850
Don't recreate the virtual environment, just delete it
stevepiercy Nov 10, 2024
dd1d1bd
Update Makefile
stevepiercy Nov 10, 2024
a0fad25
Merge pull request #865 from plone/make-use-sphinx-build-target
stevepiercy Nov 10, 2024
1f2a61d
Merge branch 'main' into rafactor-volto-customization
nileshgulia1 Nov 11, 2024
a1fa751
some improvements in content
iRohitSingh Nov 12, 2024
61f3100
fix all the things pointed by steve
iRohitSingh Nov 13, 2024
e050e90
fix: apply suggestions from @stevepiercy
nileshgulia1 Nov 14, 2024
19685d8
Merge pull request #860 from plone/rafactor-volto-customization
nileshgulia1 Nov 14, 2024
70f172b
update extending vlt training
danalvrz Nov 16, 2024
b566968
Merge branch 'main' into vlt-training
danalvrz Nov 16, 2024
814ef3c
Merge branch 'main' into vlt-training
danalvrz Nov 16, 2024
b3f800c
Promote current trainings, use dash for directory
stevepiercy Nov 18, 2024
d895014
Fix errors with `numbered` option in `toctree` directive
stevepiercy Nov 18, 2024
6c5c279
Fix errors with `numbered` option in `toctree` directive
stevepiercy Nov 18, 2024
8250d6a
Populate meta information for teaching section, in hopes that the oth…
stevepiercy Nov 18, 2024
89c2df3
what_vagrant_does.md is an orphan (not included in a toctree). We don…
stevepiercy Nov 18, 2024
1f9dc3e
Fix broken references
stevepiercy Nov 18, 2024
bc7799f
Exclude files that are not included in a toctree, and are not referen…
stevepiercy Nov 18, 2024
7e4f768
Clean up MyST syntax for toctree
stevepiercy Nov 18, 2024
d2f6442
Use proper lexer and syntax for selected lexer, wherever possible. JS…
stevepiercy Nov 18, 2024
92c7c09
Document how to override build configuration options
stevepiercy Nov 18, 2024
bdcd5de
Merge pull request #871 from plone/tidy-up-training
stevepiercy Nov 18, 2024
56f6e93
Fix RTD pull request previews
stevepiercy Nov 18, 2024
ee4564a
Include .github/workflows/rtd-pr-preview.yml as "docs"
stevepiercy Nov 18, 2024
541386e
Merge pull request #874 from plone/fix-rtd-build-2
stevepiercy Nov 18, 2024
c03a2be
Fix spelling of Node.js
stevepiercy Nov 18, 2024
4031b4d
Merge pull request #875 from plone/test-rtd-pr-build
stevepiercy Nov 18, 2024
ad51a2d
We r bad spelrz
stevepiercy Nov 18, 2024
f8baaa5
whoops, wrong project-slug
stevepiercy Nov 18, 2024
78776f9
Merge pull request #876 from plone/rtd-pr-test-2
stevepiercy Nov 18, 2024
3b1f032
It's a good thing that there are so many misspellings of Node.js to c…
stevepiercy Nov 18, 2024
58755ad
Clearly I cant type
stevepiercy Nov 18, 2024
f4699a8
Merge pull request #877 from plone/rtd-pr-test-3
stevepiercy Nov 18, 2024
ff18b56
At this rate Node.js will be spelled correctly throughout the trainin…
stevepiercy Nov 18, 2024
1f7bc9e
Merge pull request #878 from plone/rtd-pr-test-4
stevepiercy Nov 18, 2024
9e48d47
Remove lesscpy from requirements.txt
stevepiercy Nov 18, 2024
1c348e6
Merge pull request #879 from plone/update-reqs
stevepiercy Nov 18, 2024
fcffb53
Use no-tracking url of youtube
ksuess Nov 20, 2024
68fd2cf
Merge pull request #882 from plone/privacy-youtube
stevepiercy Nov 20, 2024
f8e6d50
Merge branch 'main' into nuclia_widget
stevepiercy Nov 22, 2024
6c11bbc
Change from secret to repo env.
stevepiercy Nov 22, 2024
76aa8e3
Try another var
stevepiercy Nov 22, 2024
f6f0fda
This should do it, copied from build_deploy_staging.yml
stevepiercy Nov 22, 2024
c0e95e9
fix SDK call for deletion
ebrehault Nov 22, 2024
b89c046
typo
ebrehault Nov 22, 2024
7346523
- Bump actions versions
stevepiercy Nov 22, 2024
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
37 changes: 37 additions & 0 deletions .github/workflows/nuclia_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Nuclia Sync

on: [push]
jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install requirements
run: |
pip install -q -r requirements-initial.txt
pip install -q -r requirements.txt

- name: Run Nuclia Sync
run: |
python3 upload.py

- name: Run Breadcrumb Json maker
run: |
python3 breadmaker.py

- name: Commit changes
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git add .
git commit -m "Nuclia Sync: Updated docs"
git push
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So everytime there is a commit on main, we run the job, which makes a commit on main.
It looks like an infinite loop :)

Maybe the job should have a condition like if the last changes are only about our 2 generated json files, we stop.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebrehault I have put the check for nuclia_sync.json only. This should work, right?


56 changes: 56 additions & 0 deletions breadmaker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import json
import os
from upload import extract_first_heading, PUBLIC_URL

# Load nuclia_sync.json
try:
with open("./docs/_static/nuclia_sync.json", "r") as sync_info:
nuclia_sync_data = json.load(sync_info)
except FileNotFoundError:
print("Error: nuclia_sync.json not found.")
except json.JSONDecodeError as e:
print(f"Error decoding JSON: {e}")


def normalize_path(path):
return path.replace('.md', '').replace('./docs', '').lstrip('/')


def create_url(origin_url, url_path):
return f"{origin_url.rstrip('/')}/{url_path}"


def generate_breadcrumb_for_path(path):
breadcrumb = {}
temp_path = "./"
path_items = path.split('/')[1:]

for path_item in path_items:
temp_path = os.path.join(temp_path, path_item)
if temp_path.endswith(".md"):
heading = extract_first_heading(temp_path)
breadcrumb[heading] = create_url(
PUBLIC_URL, normalize_path(temp_path))
else:
index_md_path = os.path.join(temp_path, "index.md")
if os.path.exists(index_md_path):
heading = extract_first_heading(index_md_path)
breadcrumb[heading] = create_url(
PUBLIC_URL, normalize_path(temp_path))
temp_path = os.path.join(temp_path, "")
return breadcrumb


result = {"heading_to_breadcrumb": {}}
for md_path in nuclia_sync_data["docs"]:
heading = extract_first_heading(md_path)
breadcrumb = generate_breadcrumb_for_path(md_path)
result["heading_to_breadcrumb"][heading] = breadcrumb


try:
with open("./docs/_static/heading_to_breadcrumb_mapping.json", "w") as mapping_file: # noqa
json.dump(result, mapping_file, indent=4)
print("Data written to heading_to_breadcrumb_mapping.json.")
except Exception as e:
print(f"Error writing JSON: {e}")
Loading
Loading