Create steps for using QED42's SDC generator for SDDS

Created on 7 August 2024, 4 months ago
Updated 24 August 2024, 3 months ago

Problem/Motivation

We are using this SDC generator script from QED42 and want to include using it in the documentation.

Steps to reproduce

Proposed resolution

Write concise step-by-step notes for the "Create files using script" section of the SDC guide .

Remaining tasks

  • Create text with links in a comment below
  • Review and test
  • Update guide

User interface changes

The info will be in the documentation guide.

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Documentation

Created by

🇺🇸United States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Kristen Pol
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Updating title.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    once more :)

  • 🇺🇸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
    • 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
  • 🇺🇸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

    Add parent.

  • 🇺🇸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

    Great, thanks

  • 🇮🇳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
  • 🇺🇸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
  • 🇺🇸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.

Production build 0.71.5 2024