Skip to content

Error of make html to build API reference #3543

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

Open
yimingli opened this issue Jan 8, 2022 · 2 comments
Open

Error of make html to build API reference #3543

yimingli opened this issue Jan 8, 2022 · 2 comments
Assignees
Labels
bug something broken documentation written for humans infrastructure build process etc. P3 backlog

Comments

@yimingli
Copy link

yimingli commented Jan 8, 2022

I was following the guide to build the API reference. Took me a while to debug the make html to build api reference in apidoc folder on macOS. Error message:

sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*.py
sed: 1: "../../packages/python/p ...": invalid command code .
make: *** [html] Error 1

The problem was that the sed commands in the apidoc/Makefile don't work on macOS. You'll need to edit the Makefile to replace commands like

sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*.py

with

sed -i '' -e 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*.py

Why?

On the OSX version of sed, the -i option expects an extension argument so your command is actually parsed as the extension argument and the file path is interpreted as the command code.

See this thread for details.

@yimingli
Copy link
Author

yimingli commented Jan 9, 2022

Ran into a couple of additional issues running make html, see the Makefile here. I use a MacBook Air (M1, 2020), using macOS Big Sur 11.6.2.

issue 1

rename 's/graph_objs/graph_objects/' _build/html/*.html _build/html/generated/*.html
  1. mac OS doesn't have rename utility. I installed using homebrew. brew install rename and tried again.
  2. But this time it returns error saying "_build/html/generated/plotly.graph_objects.html already exists".

issue 2

sed -i '' -e 's/graph_objs/graph_objects/g' _build/html/*.inv

raises error: re error: illegal byte sequence. Following this guide, I fixed it by

LC_ALL=C sed -i '' -e 's/graph_objs/graph_objects/g' _build/html/*.inv

@duckbill
Copy link

duckbill commented Sep 7, 2022

👍

@gvwilson gvwilson self-assigned this Jul 4, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added P3 backlog bug something broken infrastructure build process etc. documentation written for humans labels Aug 12, 2024
@gvwilson gvwilson assigned gvwilson and unassigned LiamConnors Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken documentation written for humans infrastructure build process etc. P3 backlog
Projects
None yet
Development

No branches or pull requests

4 participants