Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update static site docs #2323

Merged
merged 2 commits into from
Mar 11, 2022
Merged

Update static site docs #2323

merged 2 commits into from
Mar 11, 2022

Conversation

pikinier20
Copy link
Contributor

No description provided.

│ └── getting-started.md
└── index.html
└── _docs
└── getting-started.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add back the index.html file, for consistency with the previous examples?

└── _docs
└── getting-started.md
```
To reference the asset in a page, one need to create link relative to the `_assets` directory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To reference the asset in a page, one need to create link relative to the `_assets` directory
To reference the asset on a page, one needs to create a link relative to the `_assets` directory

```

## Sidebar

Scaladoc by default uses layout of files in `docs` directory to create table of content. There is also ability to override it by providing a `sidebar.yml` file in the site root:
Scaladoc by default uses layout of files in `_docs` directory to render static site. There is also ability to override it by providing a `sidebar.yml` file in the site root. The YAML configuration file describes the structure of rendered static site and the table of content:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Scaladoc by default uses layout of files in `_docs` directory to render static site. There is also ability to override it by providing a `sidebar.yml` file in the site root. The YAML configuration file describes the structure of rendered static site and the table of content:
By default, Scaladoc uses the layout of the files in the `_docs` directory to render the static site. There is also the ability to override it by providing a `sidebar.yml` file in the site root directory. The YAML configuration file describes the structure of the rendered static site and the table of content:

hidden: false
```
The `rootIndex` property defines the root page of a static site: `_docs/index.html`
The `pages` key is mandatory. Its value should be array of `subsection` or `page`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `pages` key is mandatory. Its value should be array of `subsection` or `page`.
The `pages` key is mandatory. Its value should be an array of `subsection` or `page`.

- `title` - Optional string - A default title of the subsection.
Front-matter titles have higher priorities.
- `index` - Optional string - A path to index page of a subsection.
- `directory` - Optional string - A name of the directory that will contain the subsection.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `directory` - Optional string - A name of the directory that will contain the subsection.
- `directory` - Optional string - A name of the directory that will contain the subsection in the generated site.

- `page` - String - A path to the page
- `hidden` - Optional boolean - A flag that indicates whether the page should be visible in navigation. By default, it is set to `false`.

**Note**: All paths in YAML configuration file are relative to `<static-root>/_docs`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Note**: All paths in YAML configuration file are relative to `<static-root>/_docs`.
**Note**: All the paths in the YAML configuration file are relative to `<static-root>/_docs`.

```
It results in static site containing documents as well as blog. It also contains custom layouts and assets. The structure of rendered documentation can be based on file system but it can also be overriden by YAML configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It results in static site containing documents as well as blog. It also contains custom layouts and assets. The structure of rendered documentation can be based on file system but it can also be overriden by YAML configuration.
It results in a static site containing documents as well as a blog. It also contains custom layouts and assets. The structure of the rendered documentation can be based on the file system but it can also be overridden by YAML configuration.


```
This is my blog post. Here is the image ![](my_image.png) and here is my [pdf](my_file.pdf)```
Using YAML configuration file, we can define how the source directory structure should be transformed in target directory structure.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Using YAML configuration file, we can define how the source directory structure should be transformed in target directory structure.
Using the YAML configuration file, we can define how the source directory structure should be transformed into an output directory structure.

This is my blog post. Here is the image ![](my_image.png) and here is my [pdf](my_file.pdf)```
Using YAML configuration file, we can define how the source directory structure should be transformed in target directory structure.

Take a look at following subsection definition:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Take a look at following subsection definition:
Take a look at the following subsection definition:

- page: foo/page2.md
```
This subsection shows the ability of YAML configuration to map the directory structure.
Even though the index page and all defined children are in different directories, they will be rendered in `custom-directory`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Even though the index page and all defined children are in different directories, they will be rendered in `custom-directory`.
Even though the index page and all defined children are in different directories, they will be rendered in `custom-directory`. The source page `abc/index.html` will generate a page `custom-directory/index.html`, the source page `abc2/page1.md` will generate a page `custom-directory/page1.html`, and the source page `foo/page2.md` will generate a page `custom-directory/page2.html`.

@julienrf
Copy link
Contributor

Is this ready for review?

@pikinier20 pikinier20 force-pushed the static-site-update branch from 57dbc50 to 9097144 Compare March 9, 2022 09:41
@pikinier20
Copy link
Contributor Author

Is this ready for review?

Now it's ready :)

@julienrf
Copy link
Contributor

julienrf commented Mar 9, 2022

I see several comments/suggestions not taken into account. Could you please address them?

@pikinier20 pikinier20 marked this pull request as ready for review March 10, 2022 08:05
@bishabosha bishabosha requested a review from julienrf March 10, 2022 09:08
@julienrf julienrf merged commit 705ae51 into scala:main Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants