diff --git a/modules/docs/src/Volo.Docs.Web/DocsUiOptions.cs b/modules/docs/src/Volo.Docs.Web/DocsUiOptions.cs index 4b4ab6a3b4..b4f3dfbf21 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsUiOptions.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsUiOptions.cs @@ -21,6 +21,12 @@ namespace Volo.Docs /// public bool ShowProjectsCombobox = true; + /// + /// If true, allows to create sections in document and show/hide sections according to user preferences. + /// Default value: True; + /// + public bool SectionRendering = true; + private string GetFormattedRoutePrefix() { if (string.IsNullOrWhiteSpace(_routePrefix)) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 7049adf011..a9c91aed12 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -405,12 +405,15 @@ namespace Volo.Docs.Pages.Documents.Project private async Task ConvertDocumentContentToHtmlAsync() { - await SetDocumentPreferencesAsync(); - SetUserPreferences(); + if (_uiOptions.SectionRendering) + { + await SetDocumentPreferencesAsync(); + SetUserPreferences(); - var partialTemplates = await GetDocumentPartialTemplatesAsync(); + var partialTemplates = await GetDocumentPartialTemplatesAsync(); - Document.Content = await _documentSectionRenderer.RenderAsync(Document.Content, UserPreferences, partialTemplates); + Document.Content = await _documentSectionRenderer.RenderAsync(Document.Content, UserPreferences, partialTemplates); + } var converter = _documentToHtmlConverterFactory.Create(Document.Format ?? Project.Format); var content = converter.Convert(Project, Document, GetSpecificVersionOrLatest(), LanguageCode);