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

display docs; htl blocks; better pre copy #424

Merged
merged 7 commits into from
Dec 24, 2023
Merged

display docs; htl blocks; better pre copy #424

merged 7 commits into from
Dec 24, 2023

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Dec 24, 2023

This…

  • Expands the documentation for display
  • Adds html fenced code blocks
  • Adds svg fenced code blocks
  • Adds implicit trimming to tagged fenced code blocks

One caveat I noticed is that a fenced code block like this will not produce the desired result:

```html
<img src="muybridge/deer.jpeg" width="320" alt="A deer">
```

That is because the path to muybridge/deer.jpeg is not statically analyzed and hence not rewritten to _file. But this is a preexisting problem, e.g.:

```js
html`<img src="muybridge/deer.jpeg" width="320" alt="A deer">`
```

I don’t think this is fixable (because the DOM content is constructed dynamically and hence is not amenable to static analysis). But perhaps we should note it somewhere.

Also fixes #224.

@mbostock mbostock requested a review from Fil December 24, 2023 00:46
Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

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

Re-reading these pages I feel we should explain Prettier (maybe only by adding a link), and somehow show how to make the sparkline?

@mbostock mbostock changed the title display docs; htl blocks display docs; htl blocks; better pre copy Dec 24, 2023
@mbostock mbostock merged commit c321fa0 into main Dec 24, 2023
2 checks passed
@mbostock mbostock deleted the mbostock/display branch December 24, 2023 19:09
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.

Copy code buttons don’t handle overflow-x scrolling well
2 participants