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

Opt-in footnotes in svg and connection tooltips #126

Open
johannes-z opened this issue Nov 7, 2023 · 1 comment
Open

Opt-in footnotes in svg and connection tooltips #126

johannes-z opened this issue Nov 7, 2023 · 1 comment

Comments

@johannes-z
Copy link

Hi, I'm using the vscode extension for d2, writing in markdown and using d2 code blocks. It would be cool if there was an opt-in setting to print tooltips on shapes as footnotes, just like when exporting to pdf/png.

The flag could either be an option in d2, or a flag on the cli, e.g. --footnotes:

# variant 1
Hello: {
  tooltip: Tooltip from Shape "Hello"
  footnote: true
}

# variant 2
footnotes: true

Hello: {
  tooltip: Tooltip from Shape "Hello"
}

Additionally, tooltips on connections would also be nice. When they are converted to footnotes, they could be numbered/ordered using a, b and so on instead of numbers, and have an indent, similar to how lists work in markdown.

Example:

Hello -> World: {
  tooltip: Tooltip from Connection between Shapes "Hello" and "World"
}
Hello: {
  tooltip: Tooltip from Shape "Hello"
}
World: {
  tooltip: Tooltip from Shape "World"
}

Footnotes printed:

1. Tooltip from Shape "Hello"
  a. Tooltip from Connection between Shapes "Hello" and "World"
2. Tooltip from Shape "World"
@gavin-ts gavin-ts transferred this issue from terrastruct/d2 Nov 7, 2023
@gavin-ts
Copy link
Contributor

gavin-ts commented Nov 7, 2023

I think this can be achieved by adding a config setting to the extension for the --force-appendix flag.

      --force-appendix         $D2_FORCE_APPENDIX    an appendix for tooltips and links is added to PNG exports since they are not interactive. --force-appendix adds an appendix to SVG exports as well (default false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants