diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md new file mode 100644 index 000000000000..96ae397fdf6e --- /dev/null +++ b/docs/DOCS_README.md @@ -0,0 +1,15 @@ +# Welcome to the Developer Guide + +Welcome to our Developer Guide! This site is dedicated to providing comprehensive documentation to support developers using OpenSearch Dashboards. Here, you'll find a quick way to access all the readme's that exist within the OpenSearch Dashboards repo in an easy to find manner. + +## About This Documentation + +The documentation is dynamically generated using [Docsify](https://docsify.js.org/). Docsify dynamically renders the Markdown files into HTML pages without the need for a build step. Docsify uses the documentation directly from the repository. The links in the sidebar are generated based on the folder structure of the repository. To update the links in the sidebar, run `yarn docs:generateDevDocs`. + +## Starting Up the Doc Site Locally + +To start up the documentation site locally for development or validation purposes, you can simply start a server in the root directory of the repository. `npx serve` is a simple way to start a server. + +--- + +[Repo Readme](../README.md) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index fe4274019ddf..db1e0a09b57c 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -91,7 +91,6 @@ - [Url_generators_examples](../examples/url_generators_examples/README.md) - [Url_generators_explorer](../examples/url_generators_explorer/README.md) - packages - - [README](../packages/README.md) - [Opensearch datemath](../packages/opensearch-datemath/readme.md) - [Opensearch eslint config opensearch dashboards](../packages/opensearch-eslint-config-opensearch-dashboards/README.md) - [Opensearch safer lodash set](../packages/opensearch-safer-lodash-set/README.md) @@ -124,6 +123,7 @@ - [Osd ui shared deps](../packages/osd-ui-shared-deps/README.md) - [Osd utility types](../packages/osd-utility-types/README.md) - [Osd utils](../packages/osd-utils/README.md) + - [README](../packages/README.md) - release-notes - [Opensearch dashboards.release notes 1.0.0 rc1](../release-notes/opensearch-dashboards.release-notes-1.0.0-rc1.md) - [Opensearch dashboards.release notes 1.0.0](../release-notes/opensearch-dashboards.release-notes-1.0.0.md) @@ -163,6 +163,7 @@ - [Opensearch dashboards.release notes 2.9.0](../release-notes/opensearch-dashboards.release-notes-2.9.0.md) - scripts - [README](../scripts/README.md) + - [DOCS_README](DOCS_README.md) - [CHANGELOG](../CHANGELOG.md) - [CODE_OF_CONDUCT](../CODE_OF_CONDUCT.md) - [COMMUNICATIONS](../COMMUNICATIONS.md) diff --git a/docs/index.html b/docs/index.html index 72efcf2ef680..ba48d8328604 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,7 +26,7 @@ '/.*/_sidebar.md': '/_sidebar.md', sidebarDisplayLevel: 1, // set sidebar display level alias: { - '/': '../README.md', + '/': './DOCS_README.md', '/.*/_sidebar.md': '/_sidebar.md', // See #301 }, } diff --git a/scripts/generate_docs_sidebar.js b/scripts/generate_docs_sidebar.js index 5e4ac84a035a..e336441827f0 100644 --- a/scripts/generate_docs_sidebar.js +++ b/scripts/generate_docs_sidebar.js @@ -77,6 +77,11 @@ function findMarkdownFiles(dir, prefix = '', baseDir = '', recursively = true) { function generateSidebarContent(items, nestLevel = 0) { let content = nestLevel === 0 ? '* [Home](/)\n\n' : ''; + // folders first, then files + items = items.sort((a, b) => { + if (a.type === 'directory' && b.type === 'file') return -1; + }); + items.forEach((item) => { if (item.type === 'directory') { // If there is a readme in the directory, use that as the reference for the directory.