From a2183f654a301fd3c8e2d4d7a7d8ac0053678d16 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Thu, 12 Feb 2015 15:24:51 +0000 Subject: [PATCH 1/2] chmgen: Make HTML root configurable --- chmgen.d | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/chmgen.d b/chmgen.d index 8aad0774cd..b2f278d35f 100644 --- a/chmgen.d +++ b/chmgen.d @@ -13,7 +13,7 @@ import std.string; import std.regex; import std.path; -enum ROOT = `.`; +string docRoot = `.`; // ******************************************************************** @@ -124,6 +124,7 @@ void main(string[] args) getopt(args, "only-tags", &onlyTags, + "root", &docRoot, ); bool chm = !onlyTags; @@ -135,16 +136,16 @@ void main(string[] args) mkdirRecurse(`chm/files`); } - enforce(exists(ROOT ~ `/phobos/index.html`), + enforce(exists(docRoot ~ `/phobos/index.html`), `Phobos documentation not present. Please place Phobos documentation HTML files into the "phobos" subdirectory.`); string[] files = chain( - dirEntries(ROOT ~ `/` , "*.html", SpanMode.shallow), - dirEntries(ROOT ~ `/phobos/`, "*.html", SpanMode.shallow), - // dirEntries(ROOT ~ `/js/` , SpanMode.shallow), - dirEntries(ROOT ~ `/css/` , SpanMode.shallow), - dirEntries(ROOT ~ `/images/`, "*.*" , SpanMode.shallow), - only(ROOT ~ `/favicon.ico`) + dirEntries(docRoot ~ `/` , "*.html", SpanMode.shallow), + dirEntries(docRoot ~ `/phobos/`, "*.html", SpanMode.shallow), + // dirEntries(docRoot ~ `/js/` , SpanMode.shallow), + dirEntries(docRoot ~ `/css/` , SpanMode.shallow), + dirEntries(docRoot ~ `/images/`, "*.*" , SpanMode.shallow), + only(docRoot ~ `/favicon.ico`) ).array(); foreach (fileName; files) @@ -152,7 +153,7 @@ void main(string[] args) scope(failure) stderr.writeln("Error while processing file: ", fileName); auto page = new Page; - fileName = page.fileName = fileName[ROOT.length+1 .. $].forwardSlashes(); + fileName = page.fileName = fileName[docRoot.length+1 .. $].forwardSlashes(); pages[fileName] = page; auto newFileName = `chm/files/` ~ fileName; From 13229c1a3ab25cfcb64534e617cd67a8f8749bd7 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Thu, 12 Feb 2015 16:18:31 +0000 Subject: [PATCH 2/2] Add d.tag target to makefiles --- posix.mak | 10 ++++++++++ win32.mak | 3 +++ 2 files changed, 13 insertions(+) diff --git a/posix.mak b/posix.mak index b50767ad9f..1feb044b4e 100644 --- a/posix.mak +++ b/posix.mak @@ -434,3 +434,13 @@ ${STABLE_DMD}: ${DUB}: ${DUB_DIR}/.cloned ${STABLE_DMD} cd ${DUB_DIR} && DC=$(abspath ${STABLE_DMD}) ./build.sh + +################################################################################ +# Dman tags +################################################################################ + +chmgen : chmgen.d $(DMD) + $(DMD) -I${PHOBOS_DIR} -g chmgen.d + +d.tag : chmgen $(ALL_FILES) + ./chmgen --root=$(DOC_OUTPUT_DIR) --only-tags diff --git a/win32.mak b/win32.mak index e916da3dfe..00f7fc4bac 100644 --- a/win32.mak +++ b/win32.mak @@ -303,6 +303,9 @@ chm-nav-doc.json : $(DDOC) chm-nav.dd chm-nav-std.json : $(DDOC) $(DDOC_STD) chm-nav.dd $(DMD) -o- -c -Df$@ $(DDOC) $(DDOC_STD) chm-nav.dd +d.tag : chmgen.exe $(TARGETS) + chmgen --only-tags + ################# Other ######################### zip: