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

docs(ipynb): documents media related tips & tricks #7749

Closed
wants to merge 4 commits into from
Closed

docs(ipynb): documents media related tips & tricks #7749

wants to merge 4 commits into from

Conversation

ickc
Copy link
Contributor

@ickc ickc commented Dec 11, 2021

For require.js, See discussion in #7745, in particular,

#7745 (comment)
#7745 (comment)

I added a commit to documents the use of --extract-media or --self-contained too. nbconvert behavior is similar to using --self-contained here.

@ickc
Copy link
Contributor Author

ickc commented Dec 11, 2021

@jgm, I take the approach that simply document this behavior. Let me know if you think this is enough.

@ickc ickc changed the title docs(ipynb): mention some ipynb expects require.js in html output docs(ipynb): documents media related tips & tricks Dec 11, 2021
@ickc
Copy link
Contributor Author

ickc commented Dec 18, 2021

@jgm, did you have a chance to look at the proposed doc and see if this is ok? Thanks.

MANUAL.txt Outdated
Comment on lines 6444 to 6472
## Image media

When the ipynb input has media such as svg, png, pdf,
you may want to use `--self-contained` for any of the supported
output formats including HTML, or use `--extract-media` in general.

## Javascript media

When converting from ipynb, some Jupyter extensions,
especially those that uses javascript for visualization,
expects the presence of
[`require.js`](https://github.com/requirejs/requirejs).
In this case when converting say from ipynb to html,
you can add the following
either via `header-includes` in metadata or
`--include-in-header` on the command line:

```
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js">
</script>
```

such as

```
pandoc -s -o require.html require.ipynb \
-V header-includes='<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>'
```

Copy link
Owner

Choose a reason for hiding this comment

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

I'm reluctant to add this to the manual, which is already overly long.
Perhaps this information should be in the FAQ on the website?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to shorten the description to be more succinct.
I think people are more used to get information like this in the manual than the FAQ,
(where I never went to look for information, but I should now knowing it exists.)

If you insist to make it to FAQ instead,
is it https://pandoc.org/faqs.html ?
Should it be committed to https://github.com/jgm/pandoc-website and which file?

Copy link
Owner

Choose a reason for hiding this comment

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

FAQs live in this repository, in doc/faqs.md.
They get copied to the website from this repo on each release.

Copy link
Owner

Choose a reason for hiding this comment

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

Is there a specific error people would get that would tell us that they need require.js? If so, it would be natural to have a FAQ like "I'm getting such-and-such error when I try to use JavaScript in ipynb. What does this mean?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it will just show as an empty image, which can still be the hint to use require.js in the FAQ.

(Of course there will be error message in the console if they open the debug tool, but probably the FAQ is for those who don't.)

@ickc
Copy link
Contributor Author

ickc commented Jan 14, 2022

We will rebase after the discussion above is settle.

@jgm jgm closed this in 0856eb3 Jan 14, 2022
@jgm
Copy link
Owner

jgm commented Jan 14, 2022

I added a FAQ.

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.

2 participants