diplodoc-platform / diplodoc-platform/cli

Auto-Generate Table of Contents Based on Input Directory

Open
#937 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
TypeScript
Stars
123
Forks
51
Avg merge
10h 50m
Merged PRs (30d)
38

Description

Enhance the Diplodoc CLI by introducing a feature that automatically generates a toc.yaml if it does not already exist. The feature should create a structured Table of Contents reflecting the files in a directory. It is essential that:
- Each file should have properly formatted titles for clarity.
- The ToC generation process should ignore folder names starting with an underscore `_`.

**Proposed Solution:**
Implement a feature with the following capabilities:
- Check if a toc.yaml file already exists in the directory.
- If no toc.yaml is present, try to auto-generate one by scanning the directory's files.
- Extract and format titles for each file.
- Exclude any directories that start with an underscore `_`.

**Use Cases:**
- Automatically maintaining a ToC for projects without manual input.
- Ensuring that documentation hierarchies reflect actual file structures, excluding non-essential folders.

**Benefits:**
- Eases the process of setting up new documentation directories by automatically generating a toc.yaml.
- Maintains clarity by organizing content without displaying non-user-facing directories.

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Start by locating the TypeScript CLI entry point that processes a documentation directory and any tests for toc.yaml handling. Done means preserving an existing toc.yaml, generating one when absent with formatted file titles, and excluding underscore-prefixed directories.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.