Skip to content

Commit ab62e2f

Browse files
authored
Updated docfx template (#49)
1 parent 9871906 commit ab62e2f

File tree

6 files changed

+68
-39
lines changed

6 files changed

+68
-39
lines changed

docfx/Llvm.Net.Docfx.csproj

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,46 @@
1-
<Project>
2-
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
44
<TargetFramework>net47</TargetFramework>
55
</PropertyGroup>
66

7-
<PropertyGroup>
8-
<CompileDependsOn>ResolveReferences;BeforeCompile</CompileDependsOn>
9-
</PropertyGroup>
10-
11-
<ItemGroup>
12-
<ProjectReference Include="..\src\Llvm.NET\Llvm.NET.csproj">
13-
<PrivateAssets>All</PrivateAssets>
14-
<Private>false</Private>
15-
</ProjectReference>
16-
</ItemGroup>
17-
187
<ItemGroup>
19-
<None Remove="Docfx-*.log" />
8+
<ProjectReference Include="..\src\Llvm.NET\Llvm.NET.csproj" />
209
</ItemGroup>
2110

2211
<ItemGroup>
12+
<PackageReference Include="CSemVer.Build.Tasks" Version="1.0.3-beta--ci-BLD.431367438" />
2313
<PackageReference Include="docfx.console" Version="2.29.1" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" />
2414
<PackageReference Include="memberpage" Version="2.29.1" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" />
2515
<PackageReference Include="msdn.4.5.2" Version="0.1.0-alpha-1611021200" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" />
2616
</ItemGroup>
2717

28-
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
29-
18+
<!--
19+
This target dynamically resolves the installed location of the NuGet Packages used and applies
20+
appropriate parameters to the docfx command to use them. Otherwise the docfx.json would need to
21+
have a hard coded path, which doesn't work with multiple users of a version controlled project.
22+
It also removes the need to workaround the hard coded path with relative paths by using a
23+
nuget.config to force package installs to a well known location.
24+
-->
3025
<Target Name="GetDocfxPackagePaths" BeforeTargets="DocBuild">
3126
<ItemGroup>
3227
<docfxpkg Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='docfx.console'" />
3328
<memberpage Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='memberpage'" />
3429
<Msdn4_5_2 Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='msdn.4.5.2'" />
35-
<DocFxInputAssembly Include="@(ReferencePath)" Condition="'%(ReferencePath.ReferenceSourceTarget)'=='ProjectReference'" />
3630
</ItemGroup>
3731
<PropertyGroup>
3832
<DocfxConsolePath>%(docfxpkg.ResolvedPath)</DocfxConsolePath>
3933
<MemberPagePath>%(memberpage.ResolvedPath)</MemberPagePath>
4034
<MsdnXRefPath>%(msdn4_5_2.ResolvedPath)</MsdnXRefPath>
41-
<LogLevel>Warning</LogLevel>
42-
<LogFile>Docfx-$(TargetFramework).log</LogFile>
43-
<DocParameters>$(DocParameters) --disableGitFeatures</DocParameters>
35+
<LogLevel>Info</LogLevel>
36+
<LogFile>$(IntermediateOutputPath)Docfx-Metadata.log</LogFile>
4437
<DocParameters>$(DocParameters) --cleanupCacheHistory</DocParameters>
4538
<DocParameters>$(DocParameters) --lruSize=0</DocParameters>
46-
<DocParameters>$(DocParameters) --intermediateFolder=$(IntermediateOutputPath)</DocParameters>
47-
<DocParameters>$(DocParameters) --xref=llvm-xref.yml,$(MsdnXrefPath)\content\msdn.4.5.2.zip,$(MsdnXrefPath)\content\namespaces.4.5.2.zip</DocParameters>
39+
<DocParameters>$(DocParameters) --globalMetadata="{_buildVersion:\"$(FullBuildNumber)\"}"</DocParameters>
40+
<DocParameters>$(DocParameters) --intermediateFolder="$(IntermediateOutputPath.TrimEnd('\'))"</DocParameters>
41+
<DocParameters>$(DocParameters) --xref="llvm-xref.yml,$(MsdnXrefPath)\content\msdn.4.5.2.zip,$(MsdnXrefPath)\content\namespaces.4.5.2.zip"</DocParameters>
4842
<DocTemplate>statictoc,$(MemberPagePath)\content,templates\Ubiquity</DocTemplate>
4943
</PropertyGroup>
50-
<Message Importance="high" Text="DocFxInputAssembly: %(DocFxInputAssembly.ReferenceAssembly)" />
5144
</Target>
5245

5346
<!-- Stub the build target as this project only builds the documentation -->

docfx/templates/Ubiquity/partials/collection.tmpl.partial

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@
66

77
{{#children}}
88
{{#children}}
9-
{{^_disableContribution}}
10-
{{#docurl}}
11-
<span class="small pull-right mobile-hide">
12-
<span class="divider">|</span>
13-
<a href="{{docurl}}">{{__global.improveThisDoc}}</a>
14-
</span>{{/docurl}}
15-
{{#sourceurl}}
16-
<span class="small pull-right mobile-hide">
17-
<a href="{{sourceurl}}">{{__global.viewSource}}</a>
18-
</span>{{/sourceurl}}
19-
{{/_disableContribution}}
209
{{#overload}}
2110
<a id="{{id}}" data-uid="{{uid}}"></a>
2211
{{/overload}}

docfx/templates/Ubiquity/partials/enum.tmpl.partial

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
2-
31
{{>partials/class.header}}
42
{{#children}}
53
<h3 id="{{id}}">{{>partials/classSubtitle}}</h3>
@@ -12,6 +10,7 @@
1210
{{/children}}
1311
</table>
1412
{{/children}}
13+
1514
{{#extensionMethods.0}}
1615
<h3 id="extensionmethods">{{__global.extensionMethods}}</h3>
1716
{{/extensionMethods.0}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
2+
3+
<footer>
4+
<div class="grad-bottom"></div>
5+
<div class="footer">
6+
<div class="container">
7+
<span class="pull-right">
8+
<a href="#top">Back to top</a>
9+
</span>
10+
{{{_appFooter}}}<br/><strong>Build:</strong> {{{_buildVersion}}}
11+
{{^_appFooter}}<span>Copyright © 2015-2017 Microsoft<br>Generated by <strong>DocFX</strong></span>{{/_appFooter}}
12+
</div>
13+
</div>
14+
</footer>

docfx/templates/Ubiquity/styles/main.css

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css");*/
1+
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css");
22

33
body,
44
html {
@@ -273,6 +273,20 @@ article {
273273
margin: 1em;
274274
}
275275

276+
.sideaffix {
277+
overflow: visible;
278+
}
279+
280+
toc .level2 {
281+
font-weight: normal;
282+
font-size: inherit;
283+
}
284+
285+
.toc .level1 > li {
286+
font-weight: bold;
287+
font-size: inherit;
288+
}
289+
276290
/* Overrides for - Ubiquity DocFX Dark theme */
277291
body {
278292
color:#ccc;
@@ -395,7 +409,7 @@ a:focus {
395409
text-decoration: underline;
396410
}
397411

398-
a.expander.hover {
412+
a.expander:hover {
399413
text-decoration:none;
400414
}
401415

docfx/templates/Ubiquity/styles/main.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,27 @@ $(function () {
5555
work($(this), 0);
5656
});
5757
})
58-
58+
// Add EBNF language from highlightjs.org
59+
hljs.registerLanguage("ebnf", function (a) {
60+
var e = a.C(/\(\*/, /\*\)/),
61+
t = {
62+
cN: "attribute",
63+
b: /^[ ]*[a-zA-Z][a-zA-Z-]*([\s-]+[a-zA-Z][a-zA-Z]*)*/
64+
},
65+
r = {
66+
cN: "meta",
67+
b: /\?.*\?/
68+
},
69+
b = {
70+
b: /=/,
71+
e: /;/,
72+
c: [e, r, a.ASM, a.QSM]
73+
};
74+
return {
75+
i: /\S/,
76+
c: [e, t, b]
77+
}
78+
});
5979
// Add LLVM IR language support from highlightjs.org
6080
hljs.registerLanguage("llvm", function (e) {
6181
var n = "([-a-zA-Z$._][\\w\\-$.]*)";

0 commit comments

Comments
 (0)