Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dpl-docs/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import std.getopt;
import std.process;
import vibe.core.log;

bool noExactSourceCodeLinks;

int main(string[] args)
{
string git_target = "master";
getopt(args, std.getopt.config.passThrough,
"git-target", &git_target);
"git-target", &git_target,
"no-exact-source-links", &noExactSourceCodeLinks);
environment["GIT_TARGET"] = git_target;
environment["NO_EXACT_SOURCE_CODE_LINKS"] = noExactSourceCodeLinks ? "1" : "0";
setLogFormat(FileLogger.Format.plain);
return ddoxMain(args);
}
3 changes: 2 additions & 1 deletion dpl-docs/views/layout.dt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ html(lang='en-US')
| http://digitalmars.com
- import std.process : environment;
- string version_id = environment["GIT_TARGET"];
- bool noExactSourceCodeLinks = environment["NO_EXACT_SOURCE_CODE_LINKS"] == "1";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently that's the "workaround" to inject parameters into the layout file - it's also the prevalent style here (see above).

- bool haveVersion = version_id.startsWith("v");
- string version_name = haveVersion ? version_id[1 .. $] : "Prerelease";
- string root_dir = info.linkTo(null) ~ (req is null ? "../" : "");
Expand Down Expand Up @@ -164,7 +165,7 @@ html(lang='en-US')
- project = "druntime", path_prefix = "src/";
- else
- project = "phobos", path_prefix = "";
- if (info.docGroups.length >= 1)
- if (info.docGroups.length >= 1 && !noExactSourceCodeLinks)
- if (auto decl = cast(Declaration)info.docGroups[0].members[0]) line_suffix = "#L"~to!string(decl.line);
- if (info.node.module_.isPackageModule)
- filename = replace(modname, ".", "/") ~ "/package.d";
Expand Down
19 changes: 15 additions & 4 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ ifeq (,$(MODEL))
endif
endif

# Disable all dynamic content that could potentially have an unrelated impact
# on a diff
ifeq (1,$(DIFFABLE))
NODATETIME := nodatetime.ddoc
DPL_DOCS_PATH_RUN_FLAGS := --no-exact-source-links
else
CHANGELOG_VERSION := "v${LATEST}..upstream/stable"
endif

# Documents

DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME)
Expand Down Expand Up @@ -432,13 +441,15 @@ ${DOC_OUTPUT_DIR}/library-prerelease/sitemap.xml : docs-prerelease.json
@mkdir -p $(dir $@)
${DPL_DOCS} generate-html --file-name-style=lowerUnderscored --std-macros=html.ddoc --std-macros=dlang.org.ddoc --std-macros=std.ddoc --std-macros=macros.ddoc --std-macros=std-ddox.ddoc \
--override-macros=std-ddox-override.ddoc --package-order=std \
--git-target=master docs-prerelease.json ${DOC_OUTPUT_DIR}/library-prerelease
--git-target=master $(DPL_DOCS_PATH_RUN_FLAGS) \
docs-prerelease.json ${DOC_OUTPUT_DIR}/library-prerelease

${DOC_OUTPUT_DIR}/library/sitemap.xml : docs.json
@mkdir -p $(dir $@)
${DPL_DOCS} generate-html --file-name-style=lowerUnderscored --std-macros=html.ddoc --std-macros=dlang.org.ddoc --std-macros=std.ddoc --std-macros=macros.ddoc --std-macros=std-ddox.ddoc \
--override-macros=std-ddox-override.ddoc --package-order=std \
--git-target=v${LATEST} docs.json ${DOC_OUTPUT_DIR}/library
--git-target=v${LATEST} $(DPL_DOCS_PATH_RUN_FLAGS) \
docs.json ${DOC_OUTPUT_DIR}/library

${DOC_OUTPUT_DIR}/library/.htaccess : dpl_release_htaccess
@mkdir -p $(dir $@)
Expand Down Expand Up @@ -524,8 +535,8 @@ test:
################################################################################

changelog/${NEXT_VERSION}.dd: ${STABLE_DMD} ../tools ../installer
$(STABLE_RDMD) $(TOOLS_DIR)/changed.d "v${LATEST}..upstream/stable" -o changelog/${NEXT_VERSION}.dd \
--version "${NEXT_VERSION}"
$(STABLE_RDMD) $(TOOLS_DIR)/changed.d $(CHANGELOG_VERSION) -o changelog/${NEXT_VERSION}.dd \
--version "${NEXT_VERSION}" --prev-version "${LATEST}"

pending_changelog: changelog/${NEXT_VERSION}.dd html
@echo "Please open file:///$(shell pwd)/web/changelog/${NEXT_VERSION}.html in your browser"
Expand Down