Files
openide/plugins/ide-features-trainer/res/HowToCreateLessons.md
Leonid Shalupov 2f2ab1fe14 IJI-2422: community/plugins: move resources under resources root
GitOrigin-RevId: 8eb1f83f015e7e1a7626f69f9e64d7c328ba7765
2025-02-05 04:43:28 +00:00

1.4 KiB

###Paths

We should be careful with paths of all lessons and xml files that we are using to hold lessons data.

If you need to add support for a custom language you should:

  1. Add extension for training.lang.LangSupport
  2. Add your LearnProject realisation and put it in res/learnProjects/$langName$
  3. Specify LearnProject name in LangSupport

How is plugin looking for a modules: res/data/modules.xml. This file contains a relative path from modules dir to a module xml.

<modules version="0.3">
       <module name="modules/EditorBasics.xml"/>
       <module name="modules/Completions.xml"/>
       <module name="modules/Refactorings.xml"/>
       <module name="modules/CodeAssistance.xml"/>
       <module name="modules/Navigation.xml"/>
       <!--<module name="modules/Loops.xml"/>-->
   </modules>

Module xml has a list of lessons with a relative path to them:

<?xml version="1.0" encoding="UTF-8"?>
<module name="Refactorings" lessonsPath="Refactorings/" version="0.3" id="refactorings" fileType="PROJECT" description="Rename, extract variable and method and other refactorings">
  <lesson filename="01.Rename.xml"/>
  <lesson filename="02.Extract Variable.xml" />
  <lesson filename="03.Extract Method.xml"/>
  <lesson filename="04.RefactoringBasics.xml"/>
</module>

So lessons for Refactorings module are located in res/data/modules/java/Refactorings/01.Rename.xml.