Skip to content

Commit

Permalink
add copy code button
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTedrake committed Oct 5, 2023
1 parent 3e8934b commit eea1b3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions drake.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,21 @@ <h1><a href="index.html" style="text-decoration:none;">Underactuated Robotics</a
<section><h1>Running on your own machine</h1>

<p>As you get more advanced, you will likely want to run (and extend) these examples on your own machine. On platforms that Drake supports (the latest two releases of Mac and Ubuntu), it should be as simple as running
<pre><code class="python">pip install underactuated --extra-index-url https://drake-packages.csail.mit.edu/whl/nightly/</code></pre>
In general, I would strongly recommend running <code>pip</code>
<div style="background:#f0f0f0;">
<div style="display:flex; justify-content:flex-end;"><button style="padding:10; background-color: transparent; border:0" onclick="copy_code_to_clipboard(this)"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="icon-sm" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg>Copy code</button></div>
<pre><code class="bash">pip install underactuated --extra-index-url https://drake-packages.csail.mit.edu/whl/nightly/</code></pre>
</div> In general, I would strongly recommend running <code>pip</code>
commands in a <a
href="https://python-guide-cn.readthedocs.io/en/latest/dev/virtualenvs.html">virtualenv</a>.</p>

<p></p>The <drake></drake> website also has a number of alternative <a href="https://drake.mit.edu/installation.html">installation options</a>, including precompiled binaries and Docker instances.</p>

<p>You'll likely want to start from the underactuated root directory. Then launch your notebook with:</p>

<div><pre class="highlight"><code>jupyter notebook</code></pre></div>
<div style="background:#f0f0f0;">
<div style="display:flex; justify-content:flex-end;"><button style="padding:10; background-color: transparent; border:0" onclick="copy_code_to_clipboard(this)"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="icon-sm" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg>Copy code</button></div>
<pre><code class="bash">jupyter notebook</code></pre>
</div>

<p>The examples for each chapter that has them will be in a .ipynb file
right alongside the chapter's html file, and the notebook exercises are
Expand Down
2 changes: 1 addition & 1 deletion htmlbook
Submodule htmlbook updated 1 files
+13 −0 book.js

0 comments on commit eea1b3c

Please sign in to comment.