Skip to content

Commit 8429a8f

Browse files
authored
Updated to support including of build version number in docs footer (#257)
* Updated `msbuildproject` to hopefully avoid future complaints from IDE about missing configurations. Co-authored-by: smaillet <25911635+smaillet@users.noreply.github.com>
1 parent 5b80259 commit 8429a8f

File tree

4 files changed

+183
-11
lines changed

4 files changed

+183
-11
lines changed

BuildVersion.msbuildproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
<Project Sdk="Microsoft.Build.NoTargets">
22
<PropertyGroup>
33
<TargetFramework>net9.0</TargetFramework>
4+
<!--
5+
Workaround annoying recurring bug: (IDE, MSBUILD, NoTargets?) Force x86 to AnyCPU.
6+
Bug is that anything cares or sets a default that the IDE can't set causing it to occur.
7+
-->
8+
<Platform Condition="'$(Platform)'=='x86'">AnyCPU</Platform>
49
</PropertyGroup>
510

11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
13+
614
<ItemGroup>
715
<None Include="Build-docs.ps1"/>
816
</ItemGroup>

docfx/documentation.msbuildproj

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
<Project Sdk="Microsoft.Build.NoTargets">
22
<PropertyGroup>
33
<TargetFramework>net9.0</TargetFramework>
4+
<!--
5+
Workaround annoying recurring bug: (IDE, MSBUILD, NoTargets?) Force x86 to AnyCPU.
6+
Bug is that anything cares or sets a default that the IDE can't set causing it to occur.
7+
-->
8+
<Platform Condition="'$(Platform)'=='x86'">AnyCPU</Platform>
49
</PropertyGroup>
5-
10+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
612
<!--
713
This projects serves as a convenient placeholder to reference the doc files. It uses project relative include
814
and exclude patterns to simplify referencing ALL files but skipping over the generated API files.
915
(Getting docfx to generate files into a folder outside of the build tree (IntermediateOutputPath) but then
1016
reference content from that is an exercise in frustration - problem unsolved. So this is used instead.)
1117
-->
12-
1318
<ItemGroup>
1419
<!--Every FILE in this folder except this project file itself-->
1520
<None Include="*.*" Exclude="$(MSBuildThisFile)" />
16-
<None Include="templates/**"/>
21+
<None Include="templates/**" />
1722
</ItemGroup>
18-
1923
<ItemGroup>
2024
<!--Everything in the LLVM sub-folders except the API folder as that contains generated files -->
2125
<None Include="llvm/**" Exclude="llvm/api/**" />
@@ -24,36 +28,31 @@
2428
<None Include="llvm/api/*.png" />
2529
<None Include="llvm/api/llvm-xref.yml" />
2630
</ItemGroup>
27-
2831
<ItemGroup>
2932
<!--Everything in the runtime-utils sub-folders except the API folder as that contains generated files -->
3033
<None Include="runtime-utils/**" Exclude="runtime-utils/api/**" />
3134
<!-- Explicitly call out the non-generated files in the API folder-->
3235
<None Include="runtime-utils/api/index.md" />
3336
</ItemGroup>
34-
3537
<ItemGroup>
3638
<!--Everything in the extensions sub-folders except the API folder as that contains generated files -->
3739
<None Include="extensions/**" Exclude="extensions/api/**" />
3840
<!-- Explicitly call out the non-generated files in the API folder-->
3941
<None Include="extensions/api/index.md" />
4042
</ItemGroup>
41-
4243
<ItemGroup>
4344
<!--Everything in the antlr-utils sub-folders except the API folder as that contains generated files -->
4445
<None Include="antlr-utils/**" Exclude="antlr-utils/api/**" />
4546
<!-- Explicitly call out the non-generated files in the API folder-->
4647
<None Include="antlr-utils/api/index.md" />
4748
</ItemGroup>
48-
4949
<ItemGroup>
5050
<!--Everything in the interop-helpers sub-folders except the API folder as that contains generated files -->
5151
<None Include="interop-helpers/**" Exclude="interop-helpers/api/**" />
5252
<!-- Explicitly call out the non-generated files in the API folder-->
5353
<None Include="interop-helpers/api/index.md" />
5454
</ItemGroup>
55-
5655
<Target Name="AlwaysRun" BeforeTargets="AfterBuild">
57-
<Message Importance="High" Text="NOTE: Building $(MSBuildProjectFile) does NOTHING, docs are built using the docfx tool. This project is simply a convenient placeholder for organizing/editing files"/>
56+
<Message Importance="High" Text="NOTE: Building $(MSBuildProjectFile) does NOTHING, docs are built using the docfx tool. This project is simply a convenient placeholder for organizing/editing files" />
5857
</Target>
59-
</Project>
58+
</Project>
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
2+
{{!include(/^public/.*/)}}
3+
{{!include(favicon.ico)}}
4+
{{!include(logo.svg)}}
5+
<!DOCTYPE html>
6+
<html {{#_lang}}lang="{{_lang}}"{{/_lang}}>
7+
<head>
8+
<meta charset="utf-8">
9+
{{#redirect_url}}
10+
<meta http-equiv="refresh" content="0;URL='{{redirect_url}}'">
11+
{{/redirect_url}}
12+
{{^redirect_url}}
13+
<title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
14+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
15+
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
16+
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
17+
{{#description}}<meta name="description" content="{{description}}">{{/description}}
18+
<link rel="icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
19+
<link rel="stylesheet" href="{{_rel}}public/docfx.min.css">
20+
<link rel="stylesheet" href="{{_rel}}public/main.css">
21+
<meta name="docfx:navrel" content="{{_navRel}}">
22+
<meta name="docfx:tocrel" content="{{_tocRel}}">
23+
{{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
24+
{{#_enableSearch}}<meta name="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
25+
{{#_disableNewTab}}<meta name="docfx:disablenewtab" content="true">{{/_disableNewTab}}
26+
{{#_disableTocFilter}}<meta name="docfx:disabletocfilter" content="true">{{/_disableTocFilter}}
27+
{{#docurl}}<meta name="docfx:docurl" content="{{docurl}}">{{/docurl}}
28+
<meta name="loc:inThisArticle" content="{{__global.inThisArticle}}">
29+
<meta name="loc:searchResultsCount" content="{{__global.searchResultsCount}}">
30+
<meta name="loc:searchNoResults" content="{{__global.searchNoResults}}">
31+
<meta name="loc:tocFilter" content="{{__global.tocFilter}}">
32+
<meta name="loc:nextArticle" content="{{__global.nextArticle}}">
33+
<meta name="loc:prevArticle" content="{{__global.prevArticle}}">
34+
<meta name="loc:themeLight" content="{{__global.themeLight}}">
35+
<meta name="loc:themeDark" content="{{__global.themeDark}}">
36+
<meta name="loc:themeAuto" content="{{__global.themeAuto}}">
37+
<meta name="loc:changeTheme" content="{{__global.changeTheme}}">
38+
<meta name="loc:copy" content="{{__global.copy}}">
39+
<meta name="loc:downloadPdf" content="{{__global.downloadPdf}}">
40+
41+
<script type="module" src="./{{_rel}}public/docfx.min.js"></script>
42+
43+
<script>
44+
const theme = localStorage.getItem('theme') || 'auto'
45+
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
46+
</script>
47+
48+
{{#_googleAnalyticsTagId}}
49+
<script async src="https://www.googletagmanager.com/gtag/js?id={{_googleAnalyticsTagId}}"></script>
50+
<script>
51+
window.dataLayer = window.dataLayer || [];
52+
function gtag() { dataLayer.push(arguments); }
53+
gtag('js', new Date());
54+
gtag('config', '{{_googleAnalyticsTagId}}');
55+
</script>
56+
{{/_googleAnalyticsTagId}}
57+
{{/redirect_url}}
58+
</head>
59+
60+
{{^redirect_url}}
61+
<body class="tex2jax_ignore" data-layout="{{_layout}}{{layout}}" data-yaml-mime="{{yamlmime}}">
62+
<header class="bg-body border-bottom">
63+
{{^_disableNavbar}}
64+
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
65+
<div class="container-xxl flex-nowrap">
66+
<a class="navbar-brand" href="{{_appLogoUrl}}{{^_appLogoUrl}}{{_rel}}index.html{{/_appLogoUrl}}">
67+
<img id="logo" class="svg" src="{{_rel}}{{{_appLogoPath}}}{{^_appLogoPath}}logo.svg{{/_appLogoPath}}" alt="{{_appName}}" >
68+
{{_appName}}
69+
</a>
70+
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
71+
<i class="bi bi-three-dots"></i>
72+
</button>
73+
<div class="collapse navbar-collapse" id="navpanel">
74+
<div id="navbar">
75+
{{#_enableSearch}}
76+
<form class="search" role="search" id="search">
77+
<i class="bi bi-search"></i>
78+
<input class="form-control" id="search-query" type="search" disabled placeholder="{{__global.search}}" autocomplete="off" aria-label="Search">
79+
</form>
80+
{{/_enableSearch}}
81+
</div>
82+
</div>
83+
</div>
84+
</nav>
85+
{{/_disableNavbar}}
86+
</header>
87+
88+
<main class="container-xxl">
89+
{{^_disableToc}}
90+
<div class="toc-offcanvas">
91+
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
92+
<div class="offcanvas-header">
93+
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
94+
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
95+
</div>
96+
<div class="offcanvas-body">
97+
<nav class="toc" id="toc"></nav>
98+
</div>
99+
</div>
100+
</div>
101+
{{/_disableToc}}
102+
103+
<div class="content">
104+
<div class="actionbar">
105+
{{^_disableToc}}
106+
<button class="btn btn-lg border-0 d-md-none"
107+
type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas"
108+
aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
109+
<i class="bi bi-list"></i>
110+
</button>
111+
{{/_disableToc}}
112+
113+
{{^_disableBreadcrumb}}
114+
<nav id="breadcrumb"></nav>
115+
{{/_disableBreadcrumb}}
116+
</div>
117+
118+
<article data-uid="{{uid}}">
119+
{{!body}}
120+
</article>
121+
122+
{{^_disableContribution}}
123+
<div class="contribution d-print-none">
124+
{{#sourceurl}}
125+
<a href="{{sourceurl}}" class="edit-link">{{__global.improveThisDoc}}</a>
126+
{{/sourceurl}}
127+
{{^sourceurl}}{{#docurl}}
128+
<a href="{{docurl}}" class="edit-link">{{__global.improveThisDoc}}</a>
129+
{{/docurl}}{{/sourceurl}}
130+
</div>
131+
{{/_disableContribution}}
132+
133+
{{^_disableNextArticle}}
134+
<div class="next-article d-print-none border-top" id="nextArticle"></div>
135+
{{/_disableNextArticle}}
136+
137+
</div>
138+
139+
{{^_disableAffix}}
140+
<div class="affix">
141+
<nav id="affix"></nav>
142+
</div>
143+
{{/_disableAffix}}
144+
</main>
145+
146+
{{#_enableSearch}}
147+
<div class="container-xxl search-results" id="search-results"></div>
148+
{{/_enableSearch}}
149+
150+
<footer class="border-top text-secondary">
151+
<div class="container-xxl">
152+
<div class="flex-fill">
153+
{{{_appFooter}}}{{^_appFooter}}<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>{{/_appFooter}}
154+
{{#_buildVersion}}- Build: {{_buildVersion}}{{/_buildVersion}}
155+
</div>
156+
</div>
157+
</footer>
158+
</body>
159+
{{/redirect_url}}
160+
</html>

docfx/templates/Ubiquity/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ tutorials. (No surprise that one isn't supported) [Though it oddly IS supported
77
directly in the [Local MarkDig based editor](https://github.com/MadsKristensen/MarkdownEditor2022)
88
used to edit these files... [Go Figure! :shrug: ]
99

10+
## layout/_master.tmpl
11+
This is mostly borrowed from the official DocFX `modern` template. However, the build
12+
version number was added to the footer. Unfortunately no simpler means was found to do
13+
that.
14+
1015
## Theming
1116
This template also updates the theme for SVG image backgrounds to improve
1217
readability of the parse diagrams. It also updates the HighlightJS classifiers

0 commit comments

Comments
 (0)