mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 18:17:35 +02:00
parent
7b0b87458d
commit
5d59a2bc6d
55 changed files with 483 additions and 483 deletions
|
@ -83,19 +83,19 @@
|
|||
</ul>
|
||||
<h2><a class="anchor" aria-hidden="true" id="running-from-the-command-line"></a><a href="#running-from-the-command-line" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Running from the command line</h2>
|
||||
<p>The scripts can be run using either Yarn or npm. If you've already gone through our Getting Started guide, you may already be familiar with the <code>start</code> command. It's the command that tells Docusaurus to run the <code>docusaurus-start</code> script which generates the site and starts up a server, and it's usually invoked like so:</p>
|
||||
<pre><code class="hljs">yarn <span class="hljs-keyword">run</span><span class="bash"> start
|
||||
</span></code></pre>
|
||||
<pre><code class="hljs">yarn <span class="hljs-keyword">run</span><span class="bash"> start</span>
|
||||
</code></pre>
|
||||
<p>The same script can be invoked using npm:</p>
|
||||
<pre><code class="hljs">npm <span class="hljs-keyword">run</span><span class="bash"> start
|
||||
</span></code></pre>
|
||||
<pre><code class="hljs">npm <span class="hljs-keyword">run</span><span class="bash"> start</span>
|
||||
</code></pre>
|
||||
<p>To run a particular script, just replace the <code>start</code> command in the examples above with the command associated with your script.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="using-arguments"></a><a href="#using-arguments" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using arguments</h2>
|
||||
<p>Some commands support optional arguments. For example, to start a server on port 8080, you can specify the <code>--port</code> argument when running <code>start</code>:</p>
|
||||
<pre><code class="hljs">yarn <span class="hljs-keyword">run</span><span class="bash"> start --port 8080
|
||||
</span></code></pre>
|
||||
<pre><code class="hljs">yarn <span class="hljs-built_in">run</span> start <span class="hljs-comment">--port 8080</span>
|
||||
</code></pre>
|
||||
<p>If you run Docusaurus using npm, you can still use the command line arguments by inserting a <code>--</code> between <code>npm run <command></code> and the command arguments:</p>
|
||||
<pre><code class="hljs">npm <span class="hljs-keyword">run</span><span class="bash"> start -- --port 8080
|
||||
</span></code></pre>
|
||||
<pre><code class="hljs">npm <span class="hljs-built_in">run</span> start <span class="hljs-comment">-- --port 8080</span>
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="configuration"></a><a href="#configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configuration</h2>
|
||||
<p>These scripts are set up under the <code>"scripts"</code> key in your <code>website/package.json</code> file as part of the installation process. If you need help setting them up again, please refer to the <a href="/docs/en/1.0.11/installation">Installation guide</a>.</p>
|
||||
<p>Docusaurus provides some default mappings to allow you to run commands following Node conventions. Instead of typing <code>docusaurus-start</code> every time, you can type <code>yarn run start</code> or <code>npm start</code> to achieve the same.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue