소스 검색

Moved the documentation generator into the tools folder, so that it can easily be reused for other projects.

David Piuva 7 시간 전
부모
커밋
c5feb78453

+ 0 - 4
Doc/Generator/generate.bat

@@ -1,4 +0,0 @@
-# Make sure to compile the documentation generator using build_windows.bat before calling the program with, input, output and resource paths.
-
-# Generate documentation from the folder Input to the Doc folder outside at .., using the style in Resources.
-generator Input .. Resources

+ 0 - 6
Doc/Generator/generate.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Make sure to compile the documentation generator using build_linux.sh or build_macos.sh before calling the program with, input, output and resource paths.
-
-# Generate documentation from the folder ./Input to the Doc folder outside at .., using the style in ./Resources.
-./generator ./Input .. ./Resources

+ 0 - 0
Doc/Generator/Resources/Default.css → Doc/Resources/Default.css


+ 0 - 0
Doc/Generator/Input/Buffers.txt → Doc/Text/Buffers.txt


+ 0 - 0
Doc/Generator/Input/ChoosingStorage.txt → Doc/Text/ChoosingStorage.txt


+ 0 - 0
Doc/Generator/Input/Files.txt → Doc/Text/Files.txt


+ 0 - 0
Doc/Generator/Input/ImageProcessing.txt → Doc/Text/ImageProcessing.txt


+ 0 - 0
Doc/Generator/Input/Images.txt → Doc/Text/Images.txt


+ 0 - 0
Doc/Generator/Input/License.txt → Doc/Text/License.txt


+ 0 - 0
Doc/Generator/Input/Manual.txt → Doc/Text/Manual.txt


+ 0 - 0
Doc/Generator/Input/Security.txt → Doc/Text/Security.txt


+ 0 - 0
Doc/Generator/Input/Starting.txt → Doc/Text/Starting.txt


+ 0 - 0
Doc/Generator/Input/Strings.txt → Doc/Text/Strings.txt


+ 0 - 0
Doc/Generator/Input/StyleGuide.txt → Doc/Text/StyleGuide.txt


+ 0 - 0
Doc/Generator/Input/Troubleshooting.txt → Doc/Text/Troubleshooting.txt


+ 6 - 0
Doc/Text/generate_linux.sh

@@ -0,0 +1,6 @@
+# Build the generator if it does not already exist.
+chmod +x ../../Source/tools/builder/buildProject.sh;
+../../Source/tools/builder/buildProject.sh ../../Source/tools/documentation/Generator.DsrProj Linux SkipIfBinaryExists;
+
+# Call the generator to convert text files into HTML.
+../../Source/tools/documentation/Generator . .. ../Resources

+ 6 - 0
Doc/Text/generate_macos.sh

@@ -0,0 +1,6 @@
+# Build the generator if it does not already exist.
+chmod +x ../../Source/tools/builder/buildProject.sh;
+../../Source/tools/builder/buildProject.sh ../../Source/tools/documentation/Generator.DsrProj MacOS SkipIfBinaryExists;
+
+# Call the generator to convert text files into HTML.
+../../Source/tools/documentation/Generator . .. ../Resources

+ 5 - 0
Doc/Text/generate_windows.bat

@@ -0,0 +1,5 @@
+rem Build the generator if it does not already exist.
+call ..\..\Source\tools\builder\buildProject.bat ..\..\Source\tools\documentation\Generator.DsrProj Windows SkipIfBinaryExists
+
+rem Call the generator to convert text files into HTML.
+..\..\Source\tools\documentation\Generator.exe . .. ..\Resources

+ 0 - 0
Doc/Generator/Generator.DsrProj → Source/tools/documentation/Generator.DsrProj


+ 0 - 0
Doc/Generator/build_linux.sh → Source/tools/documentation/build_linux.sh


+ 0 - 0
Doc/Generator/build_macos.sh → Source/tools/documentation/build_macos.sh


+ 0 - 0
Doc/Generator/build_windows.bat → Source/tools/documentation/build_windows.bat


+ 10 - 14
Doc/Generator/main.cpp → Source/tools/documentation/main.cpp

@@ -5,14 +5,7 @@
   Follow include "", but not include <> when listing types.
   Follow include "", but not include <> when listing types.
 */
 */
 
 
-// Only fileAPI.h is needed to also get stringAPI, bufferAPI, SafePointer.h and List.h.
-// Needs to compile and link with:
-//   DFPSR/collection/collections.cpp
-//   DFPSR/api/fileAPI.cpp
-//   DFPSR/api/bufferAPI.cpp
-//   DFPSR/api/stringAPI.cpp
-//   DFPSR/base/SafePointer.cpp
-#include "../../Source/DFPSR/includeEssentials.h"
+#include "../../DFPSR/includeEssentials.h"
 
 
 using namespace dsr;
 using namespace dsr;
 
 
@@ -133,12 +126,15 @@ void processFolder(const ReadableString& sourceFolderPath, const ReadableString&
 			// TODO: Create new output folders if needed for nested output.
 			// TODO: Create new output folders if needed for nested output.
 			//processFolder(sourcePath, file_combinePaths(targetFolderPath, entryName));
 			//processFolder(sourcePath, file_combinePaths(targetFolderPath, entryName));
 		} else if (entryType == EntryType::File) {
 		} else if (entryType == EntryType::File) {
-			ReadableString extensionless = getExtensionless(entryName);
-			String targetPath = file_combinePaths(targetFolderPath, extensionless + U".html");
-			printText(U"Generating ", targetPath, U" from ", sourcePath, U" using the style ", resourceFolderPath, U"\n");
-			String content = string_load(sourcePath);
-			String result = generateHtml(content);
-			string_save(file_combinePaths(targetFolderPath, targetPath), result);
+			ReadableString inputExtension = file_getExtension(entryName);
+			if (string_caseInsensitiveMatch(inputExtension, U"TXT")) {
+				ReadableString extensionless = getExtensionless(entryName);
+				String targetPath = file_combinePaths(targetFolderPath, extensionless + U".html");
+				printText(U"Generating ", targetPath, U" from ", sourcePath, U" using the style ", resourceFolderPath, U"\n");
+				String content = string_load(sourcePath);
+				String result = generateHtml(content);
+				string_save(file_combinePaths(targetFolderPath, targetPath), result);
+			}
 		}
 		}
 	});
 	});
 }
 }