diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-03-26 16:29:34 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-03-26 16:29:34 +0300 |
commit | 3d9b10cff7374ab800b1f5eeb9f6284f224046cd (patch) | |
tree | 5ce6ca3bb77bbdd1c439e110b6e1858598e53ed7 | |
parent | 7f581c863e059d3b5d1d9cce8dd31f5c68a50785 (diff) |
add end tag for config documentation to be able to extend the documentation
-rw-r--r-- | convert.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/convert.php b/convert.php index 71490af..a7bcc3b 100644 --- a/convert.php +++ b/convert.php @@ -223,7 +223,7 @@ $configDocumentationOutput = ''; $tmp = explode('DEFAULT_SECTION_START', $configDocumentation); if(count($tmp) !== 2) { - print("There are several DEFAULT_SECTION_START in the config documentation\n"); + print("There are not exactly one DEFAULT_SECTION_START in the config documentation\n"); exit(); } @@ -237,14 +237,14 @@ $configDocumentationOutput .= ".. DEFAULT_SECTION_END"; $tmp = explode('DEFAULT_SECTION_END', $tmp[1]); if(count($tmp) !== 2) { - print("There are several DEFAULT_SECTION_END in the config documentation\n"); + print("There are not exactly one DEFAULT_SECTION_END in the config documentation\n"); exit(); } // drop the first part (old generated documentation which should be overwritten // by this script) and just process $tmp = explode('ALL_OTHER_SECTIONS_START', $tmp[1]); if(count($tmp) !== 2) { - print("There are several ALL_OTHER_SECTIONS_START in the config documentation\n"); + print("There are not exactly one ALL_OTHER_SECTIONS_START in the config documentation\n"); exit(); } // apppend middle part between DEFAULT_SECTION_END and ALL_OTHER_SECTIONS_START @@ -254,5 +254,17 @@ $configDocumentationOutput .= "ALL_OTHER_SECTIONS_START\n\n"; // append rest of generated code $configDocumentationOutput .= $output; +// drop the first part (old generated documentation which should be overwritten +// by this script) and just process +$tmp = explode('ALL_OTHER_SECTIONS_END', $tmp[1]); +if(count($tmp) !== 2) { + print("There are not exactly one ALL_OTHER_SECTIONS_END in the config documentation\n"); + exit(); +} +// append end placeholder +$configDocumentationOutput .= "\n.. ALL_OTHER_SECTIONS_END"; + +$configDocumentationOutput .= $tmp[1]; + // write content to file file_put_contents($OUTPUT_FILE, $configDocumentationOutput); |