This is an automated email from the ASF dual-hosted git repository.
shazwazza pushed a commit to branch docs-poc
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
The following commit(s) were added to refs/heads/docs-poc by this push:
new f937f67 for now, hard code the version in the index.md until we sort
out the plugin, updates build script to use the new ps1 params
f937f67 is described below
commit f937f673f859d5cc708cac1b1ae7ed23dd951ca5
Author: Shannon <[email protected]>
AuthorDate: Tue Jun 30 15:19:37 2020 +1000
for now, hard code the version in the index.md until we sort out the
plugin, updates build script to use the new ps1 params
---
azure-pipelines.yml | 2 +-
.../EnvironmentVariableInlineRule.cs | 74 +++++++++++-----------
.../LuceneDocsPlugins/LuceneDfmEngineCustomizer.cs | 4 +-
websites/apidocs/docfx.global.json | 4 +-
websites/apidocs/docs.ps1 | 51 +++++++--------
websites/apidocs/index.md | 4 +-
6 files changed, 70 insertions(+), 69 deletions(-)
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 5712013..d5615cd 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -201,7 +201,7 @@ stages:
steps:
- powershell: |
- $(Build.SourcesDirectory)/websites/apidocs/docs.ps1 0 1
+ $(Build.SourcesDirectory)/websites/apidocs/docs.ps1 -LuceneNetVersion
$(PackageVersion) -Clean -BaseUrl https://lucenenet.apache.org/docs/
errorActionPreference: 'continue'
ignoreLASTEXITCODE: true
failOnStderr: false
diff --git a/src/docs/LuceneDocsPlugins/EnvironmentVariableInlineRule.cs
b/src/docs/LuceneDocsPlugins/EnvironmentVariableInlineRule.cs
index 63a2c44..2c06356 100644
--- a/src/docs/LuceneDocsPlugins/EnvironmentVariableInlineRule.cs
+++ b/src/docs/LuceneDocsPlugins/EnvironmentVariableInlineRule.cs
@@ -17,40 +17,40 @@
* under the License.
*/
-using System;
-using System.Collections.Immutable;
-using System.Text.RegularExpressions;
-using Microsoft.DocAsCode.MarkdownLite;
-
-namespace LuceneDocsPlugins
-{
- public class EnvironmentVariableInlineRule : IMarkdownRule
- {
- // give it a name
- public string Name => "EnvVarToken";
-
- // define my regex to match
- private static readonly Regex _envVarRegex = new
Regex(@"^\[EnvVar:(\w+?)\]", RegexOptions.Compiled);
-
- // process the match
- public IMarkdownToken TryMatch(IMarkdownParser parser,
IMarkdownParsingContext context)
- {
- // TODO: This does not process this token from within a code block
like
-
- // ```
- // dotnet tool install lucene-cli -g --version [EnvVar:
LuceneNetVersion]
- // ```
-
- var match = _envVarRegex.Match(context.CurrentMarkdown);
- if (match.Length == 0) return null;
-
- var envVar = match.Groups[1].Value;
- var text = Environment.GetEnvironmentVariable(envVar);
- if (text == null) return null;
-
- // 'eat' the characters of the current markdown token so they anr
- var sourceInfo = context.Consume(match.Length);
- return new MarkdownTextToken(this, parser.Context, text,
sourceInfo);
- }
- }
-}
\ No newline at end of file
+//using System;
+//using System.Collections.Immutable;
+//using System.Text.RegularExpressions;
+//using Microsoft.DocAsCode.MarkdownLite;
+
+//namespace LuceneDocsPlugins
+//{
+// public class EnvironmentVariableInlineRule : IMarkdownRule
+// {
+// // give it a name
+// public string Name => "EnvVarToken";
+
+// // define my regex to match
+// private static readonly Regex _envVarRegex = new
Regex(@"^\[EnvVar:(\w+?)\]", RegexOptions.Compiled);
+
+// // process the match
+// public IMarkdownToken TryMatch(IMarkdownParser parser,
IMarkdownParsingContext context)
+// {
+// // TODO: This does not process this token from within a code
block like
+
+// // ```
+// // dotnet tool install lucene-cli -g --version [EnvVar:
LuceneNetVersion]
+// // ```
+
+// var match = _envVarRegex.Match(context.CurrentMarkdown);
+// if (match.Length == 0) return null;
+
+// var envVar = match.Groups[1].Value;
+// var text = Environment.GetEnvironmentVariable(envVar);
+// if (text == null) return null;
+
+// // 'eat' the characters of the current markdown token so they anr
+// var sourceInfo = context.Consume(match.Length);
+// return new MarkdownTextToken(this, parser.Context, text,
sourceInfo);
+// }
+// }
+//}
\ No newline at end of file
diff --git a/src/docs/LuceneDocsPlugins/LuceneDfmEngineCustomizer.cs
b/src/docs/LuceneDocsPlugins/LuceneDfmEngineCustomizer.cs
index 6bfd711..135aab2 100644
--- a/src/docs/LuceneDocsPlugins/LuceneDfmEngineCustomizer.cs
+++ b/src/docs/LuceneDocsPlugins/LuceneDfmEngineCustomizer.cs
@@ -32,8 +32,8 @@ namespace LuceneDocsPlugins
{
public void Customize(DfmEngineBuilder builder,
IReadOnlyDictionary<string, object> parameters)
{
- // insert inline rule at the top
- builder.InlineRules = builder.InlineRules.Insert(0, new
EnvironmentVariableInlineRule());
+ //// insert inline rule at the top
+ //builder.InlineRules = builder.InlineRules.Insert(0, new
EnvironmentVariableInlineRule());
// insert block rule above header rule. Why? I dunno, that's what
the docs say:
//
https://dotnet.github.io/docfx/tutorial/intro_markdown_lite.html#select-token-kind
diff --git a/websites/apidocs/docfx.global.json
b/websites/apidocs/docfx.global.json
index de7bcda..a20f5af 100644
--- a/websites/apidocs/docfx.global.json
+++ b/websites/apidocs/docfx.global.json
@@ -1,5 +1,5 @@
{
- "_appTitle": "Apache Lucene.NET 4.8.0-beta00008 Documentation",
+ "_appTitle": "Apache Lucene.NET 4.8.0-beta00009 Documentation",
"_disableContribution": false,
"_appFaviconPath": "logo/favicon.ico",
"_enableSearch": true,
@@ -7,7 +7,7 @@
"_appFooter": "Copyright © 2020 Licensed to the Apache Software Foundation
(ASF)",
"_gitContribute": {
"repo": "https://github.com/apache/lucenenet",
- "branch": "docs/4.8.0-beta00008",
+ "branch": "docs/4.8.0-beta00009",
"apiSpecFolder": "websites/apidocs/apiSpec"
},
"_gitSource": "https://github.com/apache/lucenenet.git"
diff --git a/websites/apidocs/docs.ps1 b/websites/apidocs/docs.ps1
index 02874c3..f1077b9 100644
--- a/websites/apidocs/docs.ps1
+++ b/websites/apidocs/docs.ps1
@@ -24,6 +24,7 @@ param (
[switch] $Clean = $false,
[switch] $DisableMetaData = $false,
[switch] $DisableBuild = $false,
+ [switch] $DisablePlugins = $false,
# LogLevel can be: Diagnostic, Verbose, Info, Warning, Error
[Parameter(Mandatory = $false)]
[string] $LogLevel = 'Warning',
@@ -53,7 +54,7 @@ $DocFxExe = "$ToolsFolder\docfx\docfx.exe"
if (-not (test-path $DocFxExe)) {
Write-Host "Retrieving docfx..."
$DocFxZip = "$ToolsFolder\tmp\docfx.zip"
- Invoke-WebRequest
"https://github.com/dotnet/docfx/releases/download/v2.54/docfx.zip" -OutFile
$DocFxZip -TimeoutSec 60
+ Invoke-WebRequest
"https://github.com/dotnet/docfx/releases/download/v2.56/docfx.zip" -OutFile
$DocFxZip -TimeoutSec 60
#unzip
Expand-Archive $DocFxZip -DestinationPath (Join-Path -Path $ToolsFolder
-ChildPath "docfx")
@@ -74,9 +75,9 @@ if (-not (test-path $vswhere)) {
Write-Host "Download VsWhere..."
$path = "$ToolsFolder\tmp"
&$nuget install vswhere -OutputDirectory $path
- $dir = ls "$path\vswhere.*" | sort -property Name -descending | select
-first 1
- $file = ls -path "$dir" -name vswhere.exe -recurse
- mv "$dir\$file" $vswhere
+ $dir = Get-ChildItem "$path\vswhere.*" | Sort-Object -property Name
-descending | Select-Object -first 1
+ $file = Get-ChildItem -path "$dir" -name vswhere.exe -recurse
+ Move-Item "$dir\$file" $vswhere
}
Remove-Item -Recurse -Force "$ToolsFolder\tmp"
@@ -92,19 +93,21 @@ if ($Clean) {
# Build our custom docfx tools
-$MSBuild = &$vswhere -latest -requires Microsoft.Component.MSBuild -find
MSBuild\**\Bin\MSBuild.exe | select-object -first 1
-if (-not (test-path $MSBuild)) {
- throw "MSBuild not found!"
+if ($DisablePlugins -eq $false) {
+ $MSBuild = &$vswhere -latest -requires Microsoft.Component.MSBuild -find
MSBuild\**\Bin\MSBuild.exe | select-object -first 1
+ if (-not (test-path $MSBuild)) {
+ throw "MSBuild not found!"
+ }
+
+ # Build the plugin solution
+ $pluginSln = (Join-Path -Path $RepoRoot "src\docs\DocumentationTools.sln")
+ & $nuget restore $pluginSln
+
+ $PluginsFolder = (Join-Path -Path $ApiDocsFolder
"Templates\LuceneTemplate\plugins")
+ New-Item $PluginsFolder -type directory -force
+ & $msbuild $pluginSln /target:LuceneDocsPlugins "/p:OutDir=$PluginsFolder"
}
-# Build the plugin solution
-$pluginSln = (Join-Path -Path $RepoRoot "src\docs\DocumentationTools.sln")
-& $nuget restore $pluginSln
-
-$PluginsFolder = (Join-Path -Path $ApiDocsFolder "lucenetemplate\plugins")
-New-Item $PluginsFolder -type directory -force
-& $msbuild $pluginSln /target:LuceneDocsPlugins "/p:OutDir=$PluginsFolder"
-
# update the docjx.global.json file based
$DocFxGlobalJson = Join-Path -Path $ApiDocsFolder "docfx.global.json"
$DocFxJsonContent = Get-Content $DocFxGlobalJson | ConvertFrom-Json
@@ -174,6 +177,10 @@ if ($? -and $DisableBuild -eq $false) {
# build the output
Write-Host "Building site output for $projFile..."
+ # Before we build the site we have to clear the frickin docfx cache!
+ # else the xref links don't work on the home page. That is crazy.
+ Remove-Item (Join-Path -Path $ApiDocsFolder "obj\.cache") -recurse
-force -ErrorAction SilentlyContinue
+
if ($Clean) {
& $DocFxExe build $projFile --log "$DocFxLog" --loglevel $LogLevel
--force --debug
}
@@ -191,21 +198,15 @@ if ($? -and $DisableBuild -eq $false) {
$projBaseUrl = $BaseUrl + $projBuildDest.Substring(5,
$projBuildDest.Length - 5) # trim the _site part of the string
$xrefMap = "### YamlMime:XRefMap" + [Environment]::NewLine + "baseUrl:
" + $projBaseUrl + "/" + [Environment]::NewLine + $xrefMap
Set-Content -Path $xrefFile -Value $xrefMap
-
- # TODO: Figure out why this doesn't work as expected, the absolute
path isn't quite right.
- # ... It does work now but we'll see if it breaks with overlapping uids
- # ... it seems to work 'sometimes' but not others, very strange, like
the analysis-common package has the xref map of 'core' but it doesn't resolve
- # which seems a bit strange. Might be time to try to debug in
DocFx
- # // baseUrl: https://xxxx.azurewebsites.net/,
https://github.com/dotnet/docfx/issues/2346#issuecomment-356054027
- # TODO: Look into uidPrefix which is part of the xrefmap (see
XRefMapRedirection)
- # NOTE: With Info logs, we should see this output when resolving
xrefmap: external references found in
- # NOTE: THere's a field ThrowIfNotResolved on XRefDetails that might
help, as it turns out it looks like via code that the resolved external Xref's
- # Don't have an Href field?
}
}
if ($?) {
+ # Before we build the site we have to clear the frickin docfx cache!
+ # else the xref links don't work on the home page. That is crazy.
+ Remove-Item (Join-Path -Path $ApiDocsFolder "obj\.cache") -recurse -force
-ErrorAction SilentlyContinue
+
$DocFxLog = Join-Path -Path $ApiDocsFolder "obj\docfx.site.json.log"
if ($ServeDocs -eq $false) {
diff --git a/websites/apidocs/index.md b/websites/apidocs/index.md
index 32730be..0463cf1 100644
--- a/websites/apidocs/index.md
+++ b/websites/apidocs/index.md
@@ -3,7 +3,7 @@ title: Lucene.Net Docs - The documentation website for
Lucene.Net
description: The documentation website for Lucene.Net
---
-Apache Lucene.Net [EnvVar:LuceneNetVersion] Documentation
+Apache Lucene.Net 4.8.0-beta00009 Documentation
===============
---------------
@@ -12,7 +12,7 @@ Lucene is a _.NET full-text search engine_. Lucene.NET is not
a complete applica
but rather a code library and API that can easily be used to add search
capabilities
to applications.
-This is the official API documentation for __Apache Lucene.NET
[EnvVar:LuceneNetVersion]__.
+This is the official API documentation for __Apache Lucene.NET
4.8.0-beta00009__.
## Getting Started