diff --git a/.gitignore b/.gitignore index 88cb2c085..63bd079c3 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,6 @@ tags # Mac OS X .DS_Store files .DS_Store + +# autogenerated include-all.rst files +**include-all.rst \ No newline at end of file diff --git a/docs/Scripts.rst b/docs/Scripts.rst index 825c44e59..4e28f8a4a 100644 --- a/docs/Scripts.rst +++ b/docs/Scripts.rst @@ -620,17 +620,14 @@ Other Scripts ============= These scripts are not stored in any subdirectory, and can be invoked directly. +.. include:: ../scripts/include-all.rst + adaptation ========== View or set level of cavern adaptation for the selected unit or the whole fort. Usage: ``adaptation [value]``. The ``value`` must be between 0 and 800,000 inclusive. -add-thought -=========== -Adds a thought or emotion to the selected unit. Can be used by other scripts, -or the gui invoked by running ``add-thought gui`` with a unit selected. - armoks-blessing =============== Runs the equivalent of `scripts/rejuvenate`, `scripts/elevate-physical`, diff --git a/docs/conf.py.in b/docs/conf.py.in index 48de7b901..55e6cbe68 100644 --- a/docs/conf.py.in +++ b/docs/conf.py.in @@ -18,6 +18,35 @@ import sys import os import shlex +from os import listdir +from os.path import isfile, join, isdir +#import sys + +currentDir = '@CMAKE_CURRENT_SOURCE_DIR@' + +def makeIncludeAll(directory, extension): + outputFile = join(directory,'include-all.rst') + #print(outputFile) + files = [ f for f in listdir(directory) if isfile(join(directory,f)) and f.endswith(extension) ] + files.sort() + out = open(outputFile, 'w') + for f in files: + #TODO: check if the file contains the BEGIN_DOCS string + #print(join(directory,f)) + fstream = open(join(directory,f), 'r', encoding='utf8') + data = fstream.read().replace('\n','') + fstream.close() + if 'BEGIN_DOCS' in data: + out.write('.. include:: ' + join(directory,f) + '\n :start-after: BEGIN_DOCS\n :end-before: END_DOCS\n\n') + out.close() + +def makeAllIncludeAll(directory, extension): + for root, subdirs, files in os.walk(directory): + if isdir(root): + makeIncludeAll(root, extension) + +makeAllIncludeAll(currentDir + '/scripts', '.lua') + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/scripts/3rdparty/dscorbett b/scripts/3rdparty/dscorbett index 412f2b283..4353c1040 160000 --- a/scripts/3rdparty/dscorbett +++ b/scripts/3rdparty/dscorbett @@ -1 +1 @@ -Subproject commit 412f2b283d33a4c63a5bbcfab9c015c488ab6d5d +Subproject commit 4353c10401ced7aec89f002947d1252f30237789 diff --git a/scripts/3rdparty/kane-t b/scripts/3rdparty/kane-t index e80864910..8cf05cc89 160000 --- a/scripts/3rdparty/kane-t +++ b/scripts/3rdparty/kane-t @@ -1 +1 @@ -Subproject commit e808649108be6bc97323b54151d621c57aded51f +Subproject commit 8cf05cc89782206235f4bef1b5ef98e1bc74e266 diff --git a/scripts/3rdparty/lethosor b/scripts/3rdparty/lethosor index 491c4614f..4fbced45c 160000 --- a/scripts/3rdparty/lethosor +++ b/scripts/3rdparty/lethosor @@ -1 +1 @@ -Subproject commit 491c4614fb9b83015815a5784a2ba53ac3f8430f +Subproject commit 4fbced45c1ac18dba3a53804ee625cb8a666d460 diff --git a/scripts/3rdparty/maienm b/scripts/3rdparty/maienm index 8cffa1266..ac6dae2ff 160000 --- a/scripts/3rdparty/maienm +++ b/scripts/3rdparty/maienm @@ -1 +1 @@ -Subproject commit 8cffa1266d8903b568cf48366dd6f57095e3ae97 +Subproject commit ac6dae2ff06d1576873b8e508017e8043e7aa701 diff --git a/scripts/3rdparty/maxthyme b/scripts/3rdparty/maxthyme index a0f48ba8a..5682fc285 160000 --- a/scripts/3rdparty/maxthyme +++ b/scripts/3rdparty/maxthyme @@ -1 +1 @@ -Subproject commit a0f48ba8a8fb7e32cb57125e31f76979e3687a1d +Subproject commit 5682fc2851628d84183c42d8d2d9ba0320901fb3 diff --git a/scripts/3rdparty/roses b/scripts/3rdparty/roses index 9341dd35f..4b6e77265 160000 --- a/scripts/3rdparty/roses +++ b/scripts/3rdparty/roses @@ -1 +1 @@ -Subproject commit 9341dd35f83bcc2c4e41cdd4ee16060a049d374d +Subproject commit 4b6e772654df6805b66f77900a4618bbf9b54dab diff --git a/scripts/add-thought.lua b/scripts/add-thought.lua index a27eae69f..27eec5322 100644 --- a/scripts/add-thought.lua +++ b/scripts/add-thought.lua @@ -1,6 +1,19 @@ -- Adds emotions to creatures. --@ module = true +--[[ +BEGIN_DOCS + +.. _scripts/add-thought + +add-thought +=========== +Adds a thought or emotion to the selected unit. Can be used by other scripts, +or the gui invoked by running ``add-thought gui`` with a unit selected. + +END_DOCS +]] + local utils=require('utils') function addEmotionToUnit(unit,thought,emotion,severity,strength,subthought)