Skip to content

Commit

Permalink
add docs readme
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin P Chandran <[email protected]>
  • Loading branch information
ashwin-pc committed Feb 26, 2024
1 parent 2fc5a3c commit 25a203d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
15 changes: 15 additions & 0 deletions docs/DOCS_README.md
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 2 additions & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
}
Expand Down
5 changes: 5 additions & 0 deletions scripts/generate_docs_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 25a203d

Please sign in to comment.