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
commit a1c9e2ce7abbcec6525e5a6704747dc576b41cb5 Author: Shannon <[email protected]> AuthorDate: Mon Jun 1 18:31:14 2020 +1000 have 2x sites building, now to see if we can make them act as part of an encompassing site --- websites/apidocs/docfx.core.json | 79 +++++++++++++++++++++++++++++ websites/apidocs/docfx.test-framework.json | 79 +++++++++++++++++++++++++++++ websites/apidocs/docs.ps1 | 74 +++++++++++++++++++++------ websites/apidocs/toc/core/toc.yml | 3 ++ websites/apidocs/toc/test-framework/toc.yml | 3 ++ 5 files changed, 222 insertions(+), 16 deletions(-) diff --git a/websites/apidocs/docfx.core.json b/websites/apidocs/docfx.core.json new file mode 100644 index 0000000..f095f87 --- /dev/null +++ b/websites/apidocs/docfx.core.json @@ -0,0 +1,79 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ + "Lucene.Net/Lucene.Net.csproj" + ], + "exclude": [ + "**/obj/**", + "**/bin/**" + ], + "src": "../../src" + } + ], + "dest": "obj/docfx/api/core", + "properties": { + "TargetFramework": "netstandard2.0" + } + } + ], + "build": { + "content": [ + { + "files": [ + "overview.md" + ], + "src": "../../src/Lucene.Net", + "dest": "docs" + }, + { + "files": [ + "**.yml", + "**.md" + ], + "src": "obj/docfx/api/core", + "dest": "docs" + }, + { + "files": [ + "toc/core/toc.yml" + ], + "dest": "docs" + } + ], + "resource": [ + { + "files": [ + "logo/favicon.ico", + "logo/lucene-net-icon-64x64.png", + "logo/lucene-net-color.png", + "logo/lucene-net-reverse-color.png" + ], + "src": "../../branding" + } + ], + "overwrite": [ + { + "files": [ + "apiSpec/core/**/*.md" + ] + } + ], + "dest": "_site/api/core", + "globalMetadataFiles": [ + "docfx.global.json" + ], + "template": [ + "default", + "lucenetemplate" + ], + "postProcessors": [], + "markdownEngineName": "dfm", + "noLangKeyword": false, + "keepFileLink": false, + "cleanupCacheHistory": false, + "disableGitFeatures": false + } +} \ No newline at end of file diff --git a/websites/apidocs/docfx.test-framework.json b/websites/apidocs/docfx.test-framework.json new file mode 100644 index 0000000..cc0ee4c --- /dev/null +++ b/websites/apidocs/docfx.test-framework.json @@ -0,0 +1,79 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ + "Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj" + ], + "exclude": [ + "**/obj/**", + "**/bin/**" + ], + "src": "../../src" + } + ], + "dest": "obj/docfx/api/test-framework", + "properties": { + "TargetFramework": "netstandard2.0" + } + } + ], + "build": { + "content": [ + { + "files": [ + "overview.md" + ], + "src": "../../src/Lucene.Net.TestFramework", + "dest": "docs" + }, + { + "files": [ + "**.yml", + "**.md" + ], + "src": "obj/docfx/api/test-framework", + "dest": "docs" + }, + { + "files": [ + "toc/test-framework/toc.yml" + ], + "dest": "docs" + } + ], + "resource": [ + { + "files": [ + "logo/favicon.ico", + "logo/lucene-net-icon-64x64.png", + "logo/lucene-net-color.png", + "logo/lucene-net-reverse-color.png" + ], + "src": "../../branding" + } + ], + "overwrite": [ + { + "files": [ + "apiSpec/test-framework/**/*.md" + ] + } + ], + "dest": "_site/api/test-framework", + "globalMetadataFiles": [ + "docfx.global.json" + ], + "template": [ + "default", + "lucenetemplate" + ], + "postProcessors": [], + "markdownEngineName": "dfm", + "noLangKeyword": false, + "keepFileLink": false, + "cleanupCacheHistory": false, + "disableGitFeatures": false + } +} \ No newline at end of file diff --git a/websites/apidocs/docs.ps1 b/websites/apidocs/docs.ps1 index 626086a..2050512 100644 --- a/websites/apidocs/docs.ps1 +++ b/websites/apidocs/docs.ps1 @@ -55,7 +55,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.50/docfx.zip" -OutFile $DocFxZip -TimeoutSec 60 + Invoke-WebRequest "https://github.com/dotnet/docfx/releases/download/v2.54/docfx.zip" -OutFile $DocFxZip -TimeoutSec 60 #unzip Expand-Archive $DocFxZip -DestinationPath (Join-Path -Path $ToolsFolder -ChildPath "docfx") @@ -107,14 +107,20 @@ $PluginsFolder = (Join-Path -Path $ApiDocsFolder "lucenetemplate\plugins") New-Item $PluginsFolder -type directory -force & $msbuild $pluginSln /target:LuceneDocsPlugins "/p:OutDir=$PluginsFolder" -$DocFxJson = Join-Path -Path $ApiDocsFolder "docfx.json" - -# update the docjx.json file based -$DocFxJsonContent = Get-Content $DocFxJson | ConvertFrom-Json -$DocFxJsonContent.build.globalMetadata._appFooter = "Copyright © $((Get-Date).Year) Licensed to the Apache Software Foundation (ASF)" -$DocFxJsonContent.build.globalMetadata._appTitle = "Apache Lucene.NET $LuceneNetVersion Documentation" -$DocFxJsonContent.build.globalMetadata._gitContribute.branch = "docs/$LuceneNetVersion" -$DocFxJsonContent | ConvertTo-Json -depth 100 | Set-Content $DocFxJson +# update the docjx.global.json file based +$DocFxGlobalJson = Join-Path -Path $ApiDocsFolder "docfx.global.json" +$DocFxJsonContent = Get-Content $DocFxGlobalJson | ConvertFrom-Json +$DocFxJsonContent._appFooter = "Copyright © $((Get-Date).Year) Licensed to the Apache Software Foundation (ASF)" +$DocFxJsonContent._appTitle = "Apache Lucene.NET $LuceneNetVersion Documentation" +$DocFxJsonContent._gitContribute.branch = "docs/$LuceneNetVersion" +$DocFxJsonContent | ConvertTo-Json -depth 100 | Set-Content $DocFxGlobalJson + +$DocFxJsonMeta = @( + "docfx.core.json", + "docfx.test-framework.json" +) +# $DocFxJsonSite = Join-Path -Path $ApiDocsFolder "docfx.site.json" +$DocFxJsonSite = Join-Path -Path $ApiDocsFolder "docfx.core.json" # set env vars that will be replaced in Markdown $env:LuceneNetVersion = $LuceneNetVersion @@ -122,23 +128,59 @@ $env:LuceneNetVersion = $LuceneNetVersion $DocFxLog = Join-Path -Path $ApiDocsFolder "obj\docfx.log" if ($?) { - if ($ServeDocs -eq 0) { + foreach ($proj in $DocFxJsonMeta) { + $projFile = Join-Path -Path $ApiDocsFolder $proj + + # build the output + Write-Host "Building api metadata for $projFile..." - Write-Host "Building metadata..." if ($Clean -eq 1) { - & $DocFxExe metadata $DocFxJson -l "$DocFxLog" --loglevel $LogLevel --force + & $DocFxExe metadata $projFile --log "$DocFxLog" --loglevel $LogLevel --force } else { - & $DocFxExe metadata $DocFxJson -l "$DocFxLog" --loglevel $LogLevel + & $DocFxExe metadata $projFile --log "$DocFxLog" --loglevel $LogLevel } + } +} + +# if ($?) { +# foreach ($proj in $DocFxJsonMeta) { +# $projFile = Join-Path -Path $ApiDocsFolder $proj +# +# # build the output +# Write-Host "Building site output for $projFile..." +# +# if ($Clean -eq 1) { +# & $DocFxExe build $projFile --log "$DocFxLog" --loglevel $LogLevel --force +# } +# else { +# & $DocFxExe build $projFile --log "$DocFxLog" --loglevel $LogLevel +# } +# } +# } + +if ($?) { + if ($ServeDocs -eq 0) { # build the output Write-Host "Building docs..." - & $DocFxExe build $DocFxJson -l "$DocFxLog" --loglevel $LogLevel + + if ($Clean -eq 1) { + & $DocFxExe $DocFxJsonSite --log "$DocFxLog" --loglevel $LogLevel --force + } + else { + & $DocFxExe $DocFxJsonSite --log "$DocFxLog" --loglevel $LogLevel + } } else { # build + serve (for testing) Write-Host "starting website..." - & $DocFxExe $DocFxJson --serve -l "$DocFxLog" --loglevel $LogLevel + & $DocFxExe $DocFxJsonSite --log "$DocFxLog" --loglevel $LogLevel --serve } -} \ No newline at end of file +} + +# need to create one for each site +# and then many of these params can be excluded from the json file + +# .\docfx.exe ..\..\docfx.core.json --globalMetadataFiles docfx.global.json --output _TEST --serve --force --loglevel Warning +# docfx.exe --output TARGET --globalMetadataFiles docfx.global.json Warning \ No newline at end of file diff --git a/websites/apidocs/toc/core/toc.yml b/websites/apidocs/toc/core/toc.yml new file mode 100644 index 0000000..305d3be --- /dev/null +++ b/websites/apidocs/toc/core/toc.yml @@ -0,0 +1,3 @@ +- name: Lucene.Net + href: ../../obj/docfx/api/core/toc.yml + topicUid: Lucene.Net \ No newline at end of file diff --git a/websites/apidocs/toc/test-framework/toc.yml b/websites/apidocs/toc/test-framework/toc.yml new file mode 100644 index 0000000..c802568 --- /dev/null +++ b/websites/apidocs/toc/test-framework/toc.yml @@ -0,0 +1,3 @@ +- name: Lucene.Net.TestFramework + href: ../../obj/docfx/api/test-framework/toc.yml + topicUid: Lucene.Net.TestFramework \ No newline at end of file
