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

feat(embed): Support breadcrumbs in block embed #6427

Closed
wants to merge 5 commits into from

Conversation

sawhney17
Copy link
Collaborator

@sawhney17 sawhney17 commented Aug 20, 2022

This PR adds support for breadcrumbs in block embeds using the syntax {{embed-path ((uuid))}}, similar to Roam.

Cases Handled

  • Roam import will work just fine to convert the macro from the roam syntax
  • Implemented the required slash menus
  • Breadcrumbs will include the page name in the path.
  • also fixed spelling error in dicts.

@sawhney17 sawhney17 changed the title Support breadcrumbs in block embed feat(embed): Support breadcrumbs in block embed Aug 20, 2022
@tiensonqin
Copy link
Contributor

For block embeds, there're at least two feature requests from the community:

  1. Block embed with its breadcrumb. This has been addressed by roam research through a new macro embed-path.
  2. Block embed without its children, roam doesn't have this problem, because for block references, logseq chose to only reference the block's title instead of the whole body.

Instead of introducing a new macro or more macros, how about extending the embed macro like org-mode?
For example, we can introduce two arguments: path and no-children :

  1. {{embed ((block-uuid))}} is the same as the current behavior
  2. {{embed ((block-uuid)) path}} will include the block's breadcrumb
  3. {{embed ((block-uuid)) no-children}} will not include block's children.
  4. {{embed ((block-uuid)) path no-children}} will not only show the breadcrumb path but also omit its children.

To make it easy to use, we probably need to introduce a custom menu action to help users to change those arguments.

@sawhney17
Copy link
Collaborator Author

I like this idea but that's my concern as well.

I guess it could be to an extent alleviated by having a right click convert to block embed with path function added to the menu that pops up when you right click a block reference. But this doesn't handle being able to switch between embeds.

For that perhaps we could trigger a right click menu when clicking anywhere on the embed besides the actual block?

@tiensonqin
Copy link
Contributor

I guess it could be to an extent alleviated by having a right click convert to block embed with path function added to the menu that pops up when you right click a block reference. But this doesn't handle being able to switch between embeds.

Ideally, there could be a submenu to allow users to select their preferred embed. CleanShot 2022-08-23 at 17 31 17

For that perhaps we could trigger a right click menu when clicking anywhere on the embed besides the actual block?

That'll be nice.

@CLAassistant
Copy link

CLAassistant commented Nov 10, 2022

CLA assistant check
All committers have signed the CLA.

@logseq-cldwalker
Copy link
Collaborator

@sawhney17 Hi. Closing this PR as it has been stale for awhile. We're going with a different approach for this e.g. #6734 but haven't had time to finish it. If you want to work on this, you know where to chat with us ;) Also, we'd love it if you can sign the CLA to help us convert to a new license

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.

None yet

4 participants