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

[Feature] Add Documentation Menu with Markdown Export for Database Documentation #229

Conversation

LuigimonSoft
Copy link
Contributor

What

This pull request introduces a new "Documentation" menu item to the application, allowing users to export database documentation in Markdown format. The documentation is structured in a data dictionary format, including details such as table names, columns, constraints, indexes, and relationships.

Why

The purpose of this feature is to enhance the user experience by providing a streamlined way to generate and export database documentation in Markdown format. This allows users to easily share, review, and manage the database schema in a widely accepted and readable format.

How

  • Add Documentation Menu:

    • A new menu item labeled "Documentation" has been added to the application's main menu.
    • Under the "Documentation" menu, an option labeled "Export as Markdown" has been included.
  • Generate Markdown Documentation:

    • On selecting "Export as Markdown," a new window opens, displaying a preview of the database documentation in Markdown format.
    • The Markdown documentation is organized as follows:
      • Table Names: Each table in the database is clearly labeled.
      • Columns: For each table, the following details are listed:
        • Column Name
        • Data Type
        • Constraints (Primary Key, Foreign Key, Unique)
        • Default Values (if any)
        • Nullable (yes/no)
      • Relationships: Foreign key references and other relationships between tables are described.
  • Export Functionality:

    • An "Export" button is provided in the Markdown preview window.
    • Upon clicking "Export," the Markdown file is downloaded to the user's machine.

close #228

Copy link

vercel bot commented Aug 26, 2024

@LuigimonSoft is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Aug 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drawdb ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 8:05am

Copy link
Member

@1ilit 1ilit left a comment

Choose a reason for hiding this comment

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

This is a great feature. Thanks for the contribution.

Other than the comments, please move the dropdown to export as readme, I don't want people to think it's drawdb docs.

That should be pretty much it but I'll take a closer look at night

src/utils/exportAs/documentation.js Outdated Show resolved Hide resolved
src/utils/exportAs/documentation.js Outdated Show resolved Hide resolved
src/utils/exportAs/documentation.js Outdated Show resolved Hide resolved
Copy link
Member

@1ilit 1ilit left a comment

Choose a reason for hiding this comment

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

Misclicked the approved sorry

@LuigimonSoft
Copy link
Contributor Author

Than you for you feedback

Copy link
Member

@1ilit 1ilit left a comment

Choose a reason for hiding this comment

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

Just had a closer look. Idk why I just thought of it but you can also document the enums and types.

Thank you

src/utils/exportAs/documentation.js Outdated Show resolved Hide resolved
src/utils/exportAs/documentation.js Outdated Show resolved Hide resolved
`## Introduction\n\n## Database type\n\n- **Database system:** `+
`${databases[obj.database].name}\n## Table structure\n\n${documentationEntities}`+
`\n## Relationships\n\n${documentationRelationships}\n` +
`${databases[obj.database].hasTypes && obj.types.length > 0 ? `## Types\n\n` + documentationTypes`\n\n` : "" }` +
Copy link
Member

Choose a reason for hiding this comment

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

There's a missing plus sign between documentationTypes and \n\n that ends up throwing an error. Please test on postgres and add types before trying to export

Copy link
Member

@1ilit 1ilit left a comment

Choose a reason for hiding this comment

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

Looks good, thank you

@1ilit 1ilit merged commit c03202f into drawdb-io:main Aug 31, 2024
4 checks passed
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.

[FEATURE] Add Documentation Menu with Markdown Export for Database Documentation
2 participants