Skip to content

[WIP] Feat: Reusable Workflow to Draw QMK Keymaps from C File - #168

Open
repparw wants to merge 1 commit into
caksoylar:mainfrom
repparw:main
Open

repparw wants to merge 1 commit into
caksoylar:mainfrom
repparw:main

Conversation

@repparw

@repparw repparw commented Apr 11, 2025

Copy link
Copy Markdown

started doing this but after sometime got frustrated with trying to standardize it. my own custom one works, you can check the history on that file for the caller i tried to this.

tried to make this one as similar to the zmk one as possible.

could also split it in parts, qmk c2json in a workflow, then json to svg here. dunno. if someone wants to follow this or has any ideas to try, all yours.

with a caller something like this for testing.

name: Generate Keymap Diagram

on:
  push:
    branches:
      - main  # Or your default branch
    paths:
      - 'keyboards/**/keymaps/**/keymap.c' # Watch for keymap.c files

  workflow_dispatch:

jobs:
  generate_diagram:
    name: Generate Keymap Diagram
    uses: <USERNAME>/<REPOSITORY>/.github/workflows/your_draw_workflow.yml@main # Replace with your workflow path
    with:
      # --- REQUIRED INPUTS - REPLACE WITH YOUR VALUES ---
      qmk_keymap_c_path: 'keyboards/your_keyboard/keymaps/default/keymap.c' # Replace this path
      qmk_keyboard: 'your_keyboard_name'                                    # Replace this name
      qmk_keymap: 'your_keymap_name'                                      # Replace this name

      # --- OPTIONAL INPUTS - UNCOMMENT AND CUSTOMIZE AS NEEDED ---
      output_folder: 'docs/keymaps'
      commit_message: 'docs: Update keymap diagram'

@caksoylar

Copy link
Copy Markdown
Owner

Hey, thank you for the contribution! I have been meaning to look at this and it makes sense, given QMK userspaces are a thing now. Unfortunately I have been a bit out of the loop with QMK so I want to invest some time into understanding things. I am sure this will come in handy even in its WIP form, so thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants