mirror of
https://github.com/dlang/tools.git
synced 2025-04-25 20:51:00 +03:00
dman: Use d-tags.json instead of d.tag
Fixes issue 17731.
This commit is contained in:
parent
ee59ec9291
commit
72ab90cead
3 changed files with 12 additions and 11 deletions
11
dman.d
11
dman.d
|
@ -128,12 +128,13 @@ string DmcCommands(string topic)
|
||||||
|
|
||||||
string D(string topic)
|
string D(string topic)
|
||||||
{
|
{
|
||||||
static struct IndexEntry { string keyword; string[] urls; }
|
static immutable tagJson = import("d-tags.json");
|
||||||
static IndexEntry[] entries = mixin (import("d.tag"));
|
|
||||||
|
|
||||||
foreach (entry; entries)
|
import std.json;
|
||||||
if (entry.keyword == topic && entry.urls.length)
|
JSONValue tags = parseJSON(tagJson);
|
||||||
return entry.urls[0];
|
|
||||||
|
if (topic in tags && tags[topic].array.length)
|
||||||
|
return tags[topic][0].str;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,10 +77,10 @@ $(TOOLS) $(DOC_TOOLS) $(CURL_TOOLS) $(TEST_TOOLS): $(ROOT)/%: %.d
|
||||||
|
|
||||||
ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG = # ???
|
ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG = # ???
|
||||||
|
|
||||||
$(DOC)/d.tag : $(ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG)
|
$(DOC)/d-tags.json : $(ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG)
|
||||||
${MAKE} --directory=${DOC} -f posix.mak d.tag
|
${MAKE} --directory=${DOC} -f posix.mak d-tags.json
|
||||||
|
|
||||||
$(ROOT)/dman: $(DOC)/d.tag
|
$(ROOT)/dman: $(DOC)/d-tags.json
|
||||||
$(ROOT)/dman: DFLAGS += -J$(DOC)
|
$(ROOT)/dman: DFLAGS += -J$(DOC)
|
||||||
|
|
||||||
install: $(TOOLS) $(CURL_TOOLS) $(ROOT)/dustmite
|
install: $(TOOLS) $(CURL_TOOLS) $(ROOT)/dustmite
|
||||||
|
|
|
@ -54,10 +54,10 @@ dustmite: $(ROOT)\dustmite.exe
|
||||||
|
|
||||||
ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG = # ???
|
ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG = # ???
|
||||||
|
|
||||||
$(DOC)\d.tag : $(ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG)
|
$(DOC)\d-tags.json : $(ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG)
|
||||||
cmd /C "cd $(DOC) && $(MAKE) -f win32.mak d.tag"
|
cmd /C "cd $(DOC) && $(MAKE) -f win32.mak d-tags.json"
|
||||||
|
|
||||||
$(ROOT)\dman.exe : dman.d $(DOC)\d.tag
|
$(ROOT)\dman.exe : dman.d $(DOC)\d-tags.json
|
||||||
$(DMD) $(DFLAGS) -of$@ dman.d -J$(DOC)
|
$(DMD) $(DFLAGS) -of$@ dman.d -J$(DOC)
|
||||||
|
|
||||||
$(ROOT)\rdmd.exe : rdmd.d
|
$(ROOT)\rdmd.exe : rdmd.d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue