| id | create-document |
|---|---|
| title | Create a Sumo Logic Document |
| sidebar_label | Create and Publish a Doc |
| description | Learn how to create a doc, write content in markdown, and submit your changes to our repo. |
:::caution
🚧 Under construction 🚧 :::
A document is a markdown file (.md) with content, bulleted instructions, images, tables, code samples, and more.
To create your first doc:
Create a markdown file with filename.md in a /docs folder that best matches the guide. This is the English language guide. For information on translations, see Translate Documentation.
See Markdown Features > Front Matter to learn how.
See Markdown Cheat Sheet to learn about how to write in markdown. Doc body text content is written in GitHub-flavored markdown, with some customizations.
Help us keep Sumo Logic open and inclusive. Read and follow our Code of Conduct.
Images must be added to the static/img folders. The img folder structure currently mirrors the doc sections. To stay organized, always replace existing images, rather than adding new ones with dates or version numbers.
You can also add files such as custom code, json, yaml, and xml in the static/files folder.
See Docusaurus Static Assets for more information.
The sidebars.ts file (in repo root) controls the side navigation for the entire site. It consists of multiple sidebars and sections based on the Guides top navigation, drilling down per guide. A list of sections and advice on content is at the top of the sidebars file, with comments throughout. The docusaurus.config.js file controls top-level navigation content.
- To add a specific page, you include the directory path and topic id from the frontmatter. For example, this page is
contribution/create-document. - To add a section within a section, use a category section with page links in it (see below example).
- To add an index for a section, create an index.md page in the folder. Give it a
slug: namewhere the name is the folder for the entire section like contribution-guide. In the category, use a link line with the folder name and index for example:link: {type: 'doc', id: 'contribution/index'},. - To add a new page, make note of the file path and id. For example, this document is located in the folder
contributionwith an id ofcreate-document. When adding this file to the sidebar, it would be added to thecontribution/create-document.
Example: add contribution/create-document to sidebars.ts
//Contribution guide for documentation
contributing: [
{
type: 'category',
label: 'Contribution Guide',
collapsible: true,
collapsed: false,
link: {type: 'doc', id: 'contributing/index'},
items: [
'contributing/create-document',
'contributing/markdown-cheat-sheet',
'contributing/release-notes',
'contributing/build-deploy',
'contributing/translations',
{
type: 'category',
label: 'Templates',
collapsible: true,
collapsed: false,
items: [
'contributing/templates/partner-app'
]
}
],
},
],- To add a category, or drop-down list of documentation, use the following format:
Example: add sidebar category example with additional section
{
type: 'category',
label: 'Name of Guide',
collapsible: true,
collapsed: false,
link: {type: 'doc', id: 'foldername/id-first-page'},
items: [
'foldername/doc-id1',
'foldername/doc-id2',
{
type: 'category',
label: 'Section in Guide',
collapsible: true,
collapsed: false,
link: {type: 'doc', id: 'foldername/id-section'},
items: [
'foldername/doc-id3',
'foldername/doc-id4',
]
}
],
},- To add a dedicated sidebar, use the following format:
Example: adding a dedicated sidebar for a guide
module.exports = {
sectionName: [
``,
{
type: 'category',
label: 'Name of Guide',
collapsible: true,
collapsed: false,
link: {type: 'doc', id: 'foldername/id-first-page'},
items: [
'foldername/doc-id1',
'foldername/doc-id2',
{
type: 'category',
label: 'Section in Guide',
collapsible: true,
collapsed: false,
link: {type: 'doc', id: 'foldername/id-section'},
items: [
'foldername/doc-id3',
'foldername/doc-id4',
]
}
],
},
{
type: 'category',
label: 'Name of Another Guide',
collapsible: true,
collapsed: false,
link: {type: 'doc', id: 'otherfoldername/id-first-page'},
items: [
'otherfoldername/doc-id1',
'otherfoldername/doc-id2',
{
type: 'category',
label: 'Section in Another Guide',
collapsible: true,
collapsed: false,
link: {type: 'doc', id: 'otherfoldername/id-section'},
items: [
'otherfoldername/doc-id3',
'otherfoldername/doc-id4',
]
}
],
},
]:::note Doc Team Support The Sumo Logic Doc Team will help your add your documentation to the sidebar and top navigation. If you have suggestions, please include those in your Pull Request description. If you add the documentation to the sidebar, the team will review the location and names for building and placement in navigation. :::
Next, you'll build and deploy a local instance of the Sumo Logic Docusaurus site.
Our site is built using Docusaurus, a static-site-generator. To preview your work, make sure to run the following commands to install and build. We use Yarn for all installs and builds. Never use NPM commands for installing or updating packages.
It builds your site as simple static HTML, JavaScript and CSS files.
You need the following at a minimum installed on your machine to run builds:
- NodeJS version >= 14
- Yarn version >= 1.5, you can install with Homebrew if you have that installed:
brew install yarn
The site includes translations into other languages. To build on your local:
-
Clone the repo using Git or tools like GitHub Desktop.
-
In a terminal, change to the cloned repo folder. Run the install command:
yarn install -
To build locally and test links, use build:
yarn build -
To serve and review, use one of the following:
-
Use start, hot reloads as you make changes:
yarn startAny issues with broken links and images are listed according to file. Locate and update those issues, then run build and start again to verify.
-
Use npm serve to test and review multi-languages:
npm run serveThis build does not hot reload and requires a rebuild to test and review.
-
The static files are generated in the build folder and run on your local machine at: http://localhost:3000/. As you make changes, it will hot reload, or refresh, on the fly.
To end builds and served sites, hit Ctrl + C. You can then enter commands again, like rebuilding and starting.
See Clone Sumo Docs Repository for instructions.