Comment 26 for bug 1512093

Revision history for this message
kaputtnik (franku) wrote :

Current state...

You can define directorys to search for lua files (containing RST comments) and define a TOC where to put the found files (conatining RST comments) in. Defining is made in extract.py:

# (src_dir, toc_to_place_found_RSTs_in)
lua_dirs = (
    ('data/scripting', 'auxiliary'),
    ('data/scripting/editor', 'lua_world'),
    ('data/scripting/win_conditions', 'lua_world'),
    ('data/tribes', 'lua_tribes'),
    ('data/tribes/scripting/help', 'lua_tribes'),
    ('data/tribes/buildings/militarysites/atlanteans/castle', 'lua_tribes'),
)

The tocs defined here (second argument in each line) have to be present as a file. Currently there are three predefined TOC files available:

auxiliary.rst.org (renamed from auxiliary.rst.in)
lua_world.rst.org
lua_tribes.rst.org

I have to work more on extract.py to give the variables a better name.

Is this something you can work with? If we could say 'each RST in files living under doc/tribes and the subdirs are related to lua_tribes' we could maybe simplify defining lua_dirs to search for 'main folder including subfolders' so one doesn't have to define each directory in lua_dirs.

There is one remaining warning about a double defined function (text_line()):

/home/kaputtnik/Quellcode/widelands-repo/sphinx_changes/doc/sphinx/source/autogen_lua_world_format_editor.rst:14: WARNING: duplicate object description of text_line, other instance in /home/kaputtnik/Quellcode/widelands-repo/sphinx_changes/doc/sphinx/source/autogen_lua_tribes_building_help.rst, use :noindex: for one of them