Exporting Skills
Choose the right export command and understand how WIM decides what to write.
Export commands§
The Skills backend is available under s in M-x org-export-dispatch (C-c C-e).
| Key | Action |
|---|---|
s | Export the current file to SKILL.md |
S | Export the current file to a temporary buffer |
w | Export the current subtree or file to SKILL.md |
a | Export all subtrees, or the current file, to SKILL.md |
ox-skills-export-wim-to-md is the WIM command behind w and a. It chooses what to export from point:
- If the heading at point has
EXPORT_SKILL_NAME, export that subtree. - Otherwise walk up the heading hierarchy until a skill is found.
- If no heading has
EXPORT_SKILL_NAME, export the whole file using the file-levelSKILL_NAMEkeyword.
With a prefix argument (C-u), it exports every subtree in the buffer that has EXPORT_SKILL_NAME.
Output path§
Each exported skill is written to:
{SKILL_BASE_DIR}/{EXPORT_SKILL_NAME}/SKILL.md
SKILL_BASE_DIR is resolved in this order:
EXPORT_SKILL_BASE_DIRproperty on the subtree- File-level
#+SKILL_BASE_DIR:keyword ox-skills-default-base-dir- Directory of the current Org file
Example§
Given a multi-skill file:
#+SKILL_BASE_DIR: ~/my-project
* Skill One
:PROPERTIES:
:EXPORT_SKILL_NAME: skill-one
:END:
** Setup
Some instructions here.
* Skill Two
:PROPERTIES:
:EXPORT_SKILL_NAME: skill-two
:END:
Some other instructions.| Point is at | ox-skills-export-wim-to-md | C-u ox-skills-export-wim-to-md |
|---|---|---|
| Setup subheading | exports Skill One | exports both skills |
| Skill One heading | exports Skill One | exports both skills |
| Skill Two heading | exports Skill Two | exports both skills |
| Before any heading | exports the whole file | exports both skills |
Other export commands§
| Command | Behavior |
|---|---|
ox-skills-export-to-md | Export the current buffer or subtree explicitly |
ox-skills-export-as-md | Export to a temporary buffer |
ox-skills-export-wim-to-md | Smart dispatch based on point, or all skills with C-u |