Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
docs: rework index pages for all categories (#960)
Browse files Browse the repository at this point in the history
* docs: rework website rule page

* docs: rework index pages for all categories

* docs: fix broken link
  • Loading branch information
incendial committed Aug 8, 2022
1 parent 8510e62 commit 975c665
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 44 deletions.
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -17,8 +17,8 @@
**Note: you can find [the full documentation on the website](https://dartcodemetrics.dev/docs/getting-started/introduction)**

[Configuration](https://dartcodemetrics.dev/docs/getting-started/configuration) |
[Rules](https://dartcodemetrics.dev/docs/rules/overview) |
[Metrics](https://dartcodemetrics.dev/docs/metrics/overview) |
[Rules](https://dartcodemetrics.dev/docs/rules) |
[Metrics](https://dartcodemetrics.dev/docs/metrics) |
[Anti-patterns](https://dartcodemetrics.dev/docs/anti-patterns/overivew)

<a href="https://flutter.dev/docs/development/packages-and-plugins/favorites">
Expand All @@ -31,13 +31,13 @@

Dart Code Metrics is a static analysis tool that helps you analyse and improve your code quality.

- Reports [code metrics](https://dartcodemetrics.dev/docs/metrics/overview)
- Provides [additional rules](https://dartcodemetrics.dev/docs/rules/overview) for the dart analyzer
- Checks for [anti-patterns](https://dartcodemetrics.dev/docs/anti-patterns/overview)
- Reports [code metrics](https://dartcodemetrics.dev/docs/metrics)
- Provides [additional rules](https://dartcodemetrics.dev/docs/rules) for the dart analyzer
- Checks for [anti-patterns](https://dartcodemetrics.dev/docs/anti-patterns)
- Checks [unused `*.dart` files](https://dartcodemetrics.dev/docs/cli/check-unused-files)
- Checks [unused l10n](https://dartcodemetrics.dev/docs/cli/check-unused-l10n)
- Checks [unnecessary nullable parameters](https://dartcodemetrics.dev/docs/cli/check-unnecessary-nullable)
- Can be used as [CLI](https://dartcodemetrics.dev/docs/cli/overview), [analyzer plugin](https://dartcodemetrics.dev/docs/analyzer-plugin) or [library](https://dartcodemetrics.dev/docs/getting-started/installation#library)
- Can be used as [CLI](https://dartcodemetrics.dev/docs/cli), [analyzer plugin](https://dartcodemetrics.dev/docs/analyzer-plugin) or [library](https://dartcodemetrics.dev/docs/getting-started/installation#library)

## Links

Expand Down Expand Up @@ -127,7 +127,7 @@ The package can be used as CLI and supports multiple commands:

For additional help on any of the commands, enter `dart run dart_code_metrics:metrics help <command>`

**Note:** if you're setting up Dart Code Metrics for multi-package repository, check out [this website section](https://dartcodemetrics.dev/docs/cli/overview#multi-package-repositories-usage).
**Note:** if you're setting up Dart Code Metrics for multi-package repository, check out [this website section](https://dartcodemetrics.dev/docs/cli#multi-package-repositories-usage).

#### Analyze

Expand Down
@@ -1,11 +1,6 @@
---
sidebar_position: 0
sidebar_label: Overview
---
# Anti-patterns

# Anti-patterns overview

Anti-patterns configuration is [described here](../getting-started/configuration#configuring-an-anti-pattern-entry).
Anti-patterns configuration is [described here](./getting-started/configuration#configuring-an-anti-pattern-entry).

Available anti-patterns:

Expand Down
7 changes: 1 addition & 6 deletions website/docs/cli/overview.md → website/docs/cli/index.md
@@ -1,9 +1,4 @@
---
sidebar_position: 0
sidebar_label: 'Overview'
---

# CLI Overview
# CLI

To use the package as a command-line tool, run

Expand Down
2 changes: 1 addition & 1 deletion website/docs/getting-started/installation.md
Expand Up @@ -43,7 +43,7 @@ To use Dart Code Metrics as a plugin to the Dart analyzer refer to the [Analyzer

### CLI {#cli}

To use Dart Code Metrics as a command-line tool refer to the [Command Line Interface documentation section](../cli/overview.md).
To use Dart Code Metrics as a command-line tool refer to the [Command Line Interface documentation section](../cli).

### Library {#library}

Expand Down
@@ -1,18 +1,13 @@
---
sidebar_position: 0
sidebar_label: Overview
---

# Metrics overview
# Metrics

Metrics are grouped by a category to help you understand their purpose.

Metrics configuration is [described here](../getting-started/configuration#configuring-a-metrics-entry).
Metrics configuration is [described here](./getting-started/configuration#configuring-a-metrics-entry).

## Function specific metrics {#function-specific-metrics}

- [Cyclomatic Complexity](./cyclomatic-complexity.md)

The number of linearly-independent paths through a method.

- [Halstead Volume](./halstead-volume.md)
Expand Down
@@ -1,15 +1,10 @@
---
sidebar_label: Overview
sidebar_position: 0
---

import RuleEntry from '@site/src/components/RuleEntry';

# Rules overview
# Rules

:::tip

General rules configuration is [described here](../getting-started/configuration#configuring-a-rules-entry).
General rules configuration is [described here](./getting-started/configuration#configuring-a-rules-entry).

:::

Expand Down
15 changes: 8 additions & 7 deletions website/docusaurus.config.js
Expand Up @@ -42,22 +42,22 @@ module.exports = {
activeBasePath: 'docs/getting-started',
},
{
to: 'docs/rules/overview',
to: 'docs/rules',
label: 'Rules',
position: 'right',
activeBasePath: 'docs/rules',
},
{
to: 'docs/metrics/overview',
to: 'docs/metrics',
label: 'Metrics',
position: 'right',
activeBasePath: 'docs/metrics',
},
{
to: 'docs/cli/overview',
to: 'docs/cli',
label: 'Commands',
position: 'right',
activeBasePath: 'docs/cli/overview',
activeBasePath: 'docs/cli',
},
{
href: 'https://github.com/dart-code-checker/dart-code-metrics',
Expand All @@ -74,11 +74,11 @@ module.exports = {
items: [
{
label: 'Rules',
to: 'docs/rules/overview',
to: 'docs/rules',
},
{
label: 'Metrics',
to: 'docs/metrics/overview',
to: 'docs/metrics',
},
{
label: 'Configuration',
Expand Down Expand Up @@ -139,7 +139,8 @@ module.exports = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/dart-code-checker/dart-code-metrics/tree/master/website/',
editUrl:
'https://github.com/dart-code-checker/dart-code-metrics/tree/master/website/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/RuleEntry.tsx
Expand Up @@ -23,7 +23,7 @@ export default function RuleEntry({
hasFix,
isDeprecated,
}: Props) {
const href = `${type}/${name}`;
const href = `rules/${type}/${name}`;

return (
<div className="rule-entry">
Expand Down

0 comments on commit 975c665

Please sign in to comment.