AppFlowy-IO / AppFlowy

Bring projects, wikis, and teams together with AI. AppFlowy is an AI collaborative workspace where you achieve more without losing control of your data. The best open source alternative to Notion.
https://www.appflowy.io
GNU Affero General Public License v3.0
58.04k stars 3.82k forks source link

[FR] Outline for subpages #4282

Open PeterHero opened 10 months ago

PeterHero commented 10 months ago

Description

Outline for page can be created using /outline. It uses headlines. The same functionality should be for creating the outline for sub pages. It would allow easy navigation in nested documents structure.

It could look like this: structure1 structure2

Impact

Easy navigation through sub documents. I like to have a nested structure of smaller documents. This would enable to have the top document as a overview of the structure. One could easily navigate to the specific document.

Additional Context

I don't have a good idea for the keyword when using '/'. Maybe 'structure', 'overview'? Any suggestions?

LucasXu0 commented 10 months ago

How about the 'hierarchy' or 'directory'?

Jayaprakash-dev commented 10 months ago

Hey @LucasXu0 @annieappflowy, I would like to work on this issue!

LucasXu0 commented 10 months ago

Hey, @Jayaprakash-dev. Do you already have any idea on how to implement it? If so, please share it here.

PeterHero commented 10 months ago

It could be useful to change the depth of the outline. Could that be please added as a functionality?

Jayaprakash-dev commented 10 months ago

Hey, @Jayaprakash-dev. Do you already have any idea on how to implement it? If so, please share it here.

Hey @LucasXu0, I haven't fully figured out the optimal solution yet; currently, I'm surfing through the code base. Sure, I'll reach out to you once I've found a solution for it.

Jayaprakash-dev commented 10 months ago

It could be useful to change the depth of the outline. Could that be please added as a functionality?

Hey @PeterHero, Could you please provide more details? Currently, the /outline command outputs all headings, including subheadings up to level 3. Are you suggesting it should only display headings at a certain depth, such as only top-level headings or outputs up to subheadings levels 1 or 2? Your clarification on this would be super helpful.

PeterHero commented 10 months ago

The comment was connected to this issue. I meant the depth of the outline for subpages. There could be a selection next to the '/hierarchy' (or what it'd be called) where you could select the depth as a number. Hierarchy would be generated only to this depth. Usecase: it is useful to create overview of subpages but not contain all of them because then it would become bloated and not clear.

@Jayaprakash-dev But yes, it could be applied to /outline as well.

Jayaprakash-dev commented 10 months ago

Hey @LucasXu0 & @PeterHero,

I've successfully implemented the feature that controls the depth of the OutlineBlockComponent block. Now, when a depth H1 is selected, the app displays headings up to level 1, and similarly for H2, it shows headings up to level 2, extending to subsequent H3 headings.

As of now, the app only supports options up to Heading 3, and that's why I limited this feature to H3 Heading.

However, I'm facing a challenge in generating Localkeys for lang translation in this implementation. If you have any guidance or suggestions on how to proceed, it would be helpful. If necessary, I can share the relevant code snippet here for your review.

Looking forward to your response and guidance on this matter.

https://github.com/AppFlowy-IO/AppFlowy/assets/68953739/63f0ea8e-c4f8-413d-9db8-e9cf2e57f4cc

https://github.com/AppFlowy-IO/AppFlowy/assets/68953739/e9d66143-ce55-4e05-b76f-34e9decb1c78

I understand the issue involves creating an outline-like structure for the pages. However, when @PeterHero commented about the possibility of implementing depth control for the Outline, I thought it would be relatively easier to implement.

PeterHero commented 10 months ago

@Jayaprakash-dev, I created a new issue where this feature could be tracked. It is better to have separate issues for separate features.

Jayaprakash-dev commented 10 months ago

Hey @LucasXu0,

I've successfully implemented the feature and submitted a pull request. Now, users can create an outline/overview for the workspace folder and its sub-pages.