- Issue created by @Kristen Pol
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
This will be self-assigned by one of the QED42 team members.
- Assigned to guptahemant
- 🇮🇳India Akhil Babu Chengannur
Here are the steps
Prerequisites
- Make sure you have Python installed on your system
- Check that the required libraries (pyyaml and re) are available in your Python environment.
Downloading the script
- Follow the SDDS development guide to install Drupal Starshot with the Starshot Demo Design System theme
- Go to the project folder. If you have followed the steps in the SDDS development guide, this will be the 'starshot' folder
-
To download the script, run
git clone https://github.com/qed42/twig-sdc-yaml-generator.git
. This will download the folder 'twig-sdc-yaml-generator' containing the script.
Executing the script
-
The script uses the 'comments' in the component twig files to generate the props and slots. Few of the SDDS components have incorrect comments in their twig files. Those should be adjusted before running the script'. For that
-
Go to the SDDS theme folder
cd web/themes/contrib/demo_design_system
-
Run thw command
curl -sL https://git.drupalcode.org/project/demo_design_system/-/merge_requests/3/diffs.patch | patch -p1
- To manually make these adjustments without using a patch, check the merge request https://git.drupalcode.org/project/demo_design_system/-/merge_requests/3/diffs
-
Go to the SDDS theme folder
-
Structure of the command:
python3
-
Move to the project folder:
cd starshot
-
Converting a single component
-
python3 twig-sdc-yaml-generator/twig_sdc_yaml_generator.py web/themes/contrib/demo_design_system/components/01-atoms/button/
- The above command will generate button.component.yml and README.md files in web/themes/contrib/demo_design_system/components/01-atoms/button/ folder.
-
-
Converting a group of components
-
python3 twig-sdc-yaml-generator/twig_sdc_yaml_generator.py web/themes/contrib/demo_design_system/components/01-atoms/
-
-
Converting all components at once
-
python3 twig-sdc-yaml-generator/twig_sdc_yaml_generator.py web/themes/contrib/demo_design_system/components
-
- 🇮🇳India guptahemant
Thanks @Akhil Babu for detailed steps i have documented them on https://www.drupal.org/community-initiatives/starshot-demo-design-system... →
Also @Kristen Pol can we please review and merge this PR https://git.drupalcode.org/project/demo_design_system/-/merge_requests/3...
It will reduce any additional work on component twig files for metadata correction.Thanks
- Assigned to Kristen Pol
- Status changed to Needs review
4 months ago 10:14pm 8 August 2024 - 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
Fantastic! 😍 I'll review and get this added!
I'll make a separate issue for the MR so you guys get credit for that work.
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
I've reviewed the documentation and got it working locally. I'll add a modified version of this to the SDC conversion guide soon.
- 🇮🇳India guptahemant
Looks like my recent updates regarding the usage of the script were reverted https://www.drupal.org/node/3464545/revisions/view/13666619/13667940 →
Re-adding that with manual edit. @Kristen Pol please modify them as needed.
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
Oh! I thought I copied over myself as I was editing a lot of docs yesterday. I didn’t realize you did that. I thought only I could edit. I was going to clean up the text to simplify but I’ll start with what you have, thanks 🙏
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
Note that I merged the MR so that part is not required anymore so I've removed it.
- Status changed to Needs work
4 months ago 6:34pm 9 August 2024 - 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
No more work needed on your end... just moving to needs work for me to to clean up the text a bit based on my testing yesterday.
- Issue was unassigned.
- Status changed to Fixed
4 months ago 6:25am 10 August 2024 - 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
I've reworked it a bit so all good now :) Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.