plotly / plotly/plotly.py

Error of `make html` to build API reference

Open
#3,543 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug documentation infrastructure P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apidoc/Makefile and inspect the sed commands used by the html target. Run make html on macOS to reproduce the failure, then verify that the API reference builds successfully with the macOS-compatible commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
build-system, documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.