diff --git a/.gitignore b/.gitignore index fc8f4137175..a6d5a2d4127 100644 --- a/.gitignore +++ b/.gitignore @@ -24,9 +24,8 @@ tools/editor/editor_icons.cpp make.bat log.txt -# Documentation generated by doxygen or scripts -doc/doxygen/ -doc/html/ +# Documentation generated by doxygen or from classes.xml +doc/_build/ # Javascript specific *.bc diff --git a/doc/Doxyfile b/doc/Doxyfile index bc0d6d3925b..c1904f17c92 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -58,7 +58,7 @@ PROJECT_LOGO = ../logo.png # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ./doxygen/ +OUTPUT_DIRECTORY = ./_build/doxygen/ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000000..286a5162aff --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,47 @@ +BASEDIR = $(CURDIR) +CLASSES = $(BASEDIR)/base/classes.xml +OUTPUTDIR = $(BASEDIR)/_build +TOOLSDIR = $(BASEDIR)/tools + +.ONESHELL: + +clean: + rm -rf $(OUTPUTDIR) + +doku: + rm -rf $(OUTPUTDIR)/doku + mkdir -p $(OUTPUTDIR)/doku + pushd $(OUTPUTDIR)/doku + python2 $(TOOLSDIR)/makedoku.py $(CLASSES) + popd + +doxygen: + rm -rf $(OUTPUTDIR)/doxygen + mkdir -p $(OUTPUTDIR)/doxygen + doxygen Doxyfile + +html: + rm -rf $(OUTPUTDIR)/html + mkdir -p $(OUTPUTDIR)/html + pushd $(OUTPUTDIR)/html + python2 $(TOOLSDIR)/makehtml.py -multipage $(CLASSES) + popd + +markdown: + rm -rf $(OUTPUTDIR)/markdown + mkdir -p $(OUTPUTDIR)/markdown + pushd $(OUTPUTDIR)/markdown + python2 $(TOOLSDIR)/makemd.py $(CLASSES) + popd + +rst: + rm -rf $(OUTPUTDIR)/rst + mkdir -p $(OUTPUTDIR)/rst + pushd $(OUTPUTDIR)/rst + echo "TODO" + popd + +textile: + rm -rf $(OUTPUTDIR)/textile + mkdir -p $(OUTPUTDIR)/textile + python3 $(TOOLSDIR)/makedocs.py --input $(CLASSES) --output $(OUTPUTDIR)/textile diff --git a/doc/make_doc.sh b/doc/make_doc.sh deleted file mode 100644 index 5d0c1a9c2fa..00000000000 --- a/doc/make_doc.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/bash -here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -godotHome=$(dirname "$here") -docTarget=${here}/html/class_list - -throw() { - echo "$@" >&2 - exit 1 -} - -[ -d "$docTarget" ] || mkdir -p "$docTarget" || throw "Could not create doc target $docTarget" - -cd "$docTarget" -python ${here}/makehtml.py -multipage ${here}/base/classes.xml -cd "$here" - diff --git a/doc/tools/doc_merge.py b/doc/tools/doc_merge.py index 872f38ed870..6cc70193245 100644 --- a/doc/tools/doc_merge.py +++ b/doc/tools/doc_merge.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET diff --git a/doc/tools/makedocs.py b/doc/tools/makedocs.py index be57891abce..db9f04b0919 100644 --- a/doc/tools/makedocs.py +++ b/doc/tools/makedocs.py @@ -24,7 +24,7 @@ # TODO: # * Refactor code. # * Adapt this script for generating content in other markup formats like -# DokuWiki, Markdown, etc. +# reStructuredText, Markdown, DokuWiki, etc. # # Also check other TODO entries in this script for more information on what is # left to do. diff --git a/doc/tools/makedoku.py b/doc/tools/makedoku.py index e8207715fe7..1ab16841b15 100644 --- a/doc/tools/makedoku.py +++ b/doc/tools/makedoku.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET @@ -8,7 +11,7 @@ for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: - print("usage: makedoku.py ") + print("usage: makedoku.py ") sys.exit(0) diff --git a/doc/tools/makehtml.py b/doc/tools/makehtml.py index 9b9c62f33b1..34db47e4240 100644 --- a/doc/tools/makehtml.py +++ b/doc/tools/makehtml.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET from xml.sax.saxutils import escape, unescape @@ -29,7 +32,7 @@ for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: - print("usage: makehtml.py ") + print("usage: makehtml.py ") sys.exit(0) diff --git a/doc/tools/makemd.py b/doc/tools/makemd.py index f85d145d5e5..e012287b0e2 100644 --- a/doc/tools/makemd.py +++ b/doc/tools/makemd.py @@ -1,5 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET @@ -9,7 +10,7 @@ for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: - print 'usage: makedoku.py ' + print 'usage: makemd.py ' sys.exit(0)