Updated the generated docs.
This commit is contained in:
parent
2a11c235d9
commit
c1caf47a62
45 changed files with 4761 additions and 2900 deletions
|
@ -3,13 +3,16 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Getting started — D:YAML v0.4 documentation</title>
|
||||
<title>Getting started — D:YAML 0.4 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../',
|
||||
|
@ -22,7 +25,7 @@
|
|||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
<link rel="top" title="D:YAML v0.4 documentation" href="../index.html" />
|
||||
<link rel="top" title="D:YAML 0.4 documentation" href="../index.html" />
|
||||
<link rel="next" title="Custom YAML data types" href="custom_types.html" />
|
||||
<link rel="prev" title="Welcome to D:YAML documentation!" href="../index.html" />
|
||||
</head>
|
||||
|
@ -36,7 +39,7 @@
|
|||
<li class="right" >
|
||||
<a href="../index.html" title="Welcome to D:YAML documentation!"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="../index.html">D:YAML v0.4 documentation</a> »</li>
|
||||
<li><a href="../index.html">D:YAML 0.4 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -103,7 +106,7 @@ To do this on Unix/Linux, use the following command:</p>
|
|||
<p>Now we need to parse it. Create a file called <tt class="docutils literal"><span class="pre">main.d</span></tt>. Paste following code
|
||||
into the file:</p>
|
||||
<div class="highlight-d"><div class="highlight"><pre><span class="k">import</span> <span class="n">std</span><span class="p">.</span><span class="n">stdio</span><span class="p">;</span>
|
||||
<span class="k">import</span> <span class="n">yaml</span><span class="p">;</span>
|
||||
<span class="k">import</span> <span class="n">dyaml</span><span class="p">.</span><span class="n">all</span><span class="p">;</span>
|
||||
|
||||
<span class="kt">void</span> <span class="n">main</span><span class="p">()</span>
|
||||
<span class="p">{</span>
|
||||
|
@ -124,8 +127,8 @@ into the file:</p>
|
|||
</div>
|
||||
<div class="section" id="explanation-of-the-code">
|
||||
<h3>Explanation of the code<a class="headerlink" href="#explanation-of-the-code" title="Permalink to this headline">¶</a></h3>
|
||||
<p>First, we import the <em>yaml</em> module. This is the only D:YAML module you need to
|
||||
import - it automatically imports all needed modules.</p>
|
||||
<p>First, we import the <em>dyaml.all</em> module. This is the only D:YAML module you
|
||||
need to import - it automatically imports all needed modules.</p>
|
||||
<p>Next we load the file using the <em>Loader.load()</em> method. <em>Loader</em> is a struct
|
||||
used for parsing YAML documents. The <em>load()</em> method loads the file as
|
||||
<strong>one</strong> YAML document, or throws <em>YAMLException</em>, D:YAML exception type, if the
|
||||
|
@ -161,19 +164,20 @@ formatted differently. Comments are not preserved, either.</p>
|
|||
<h3>Compiling<a class="headerlink" href="#compiling" title="Permalink to this headline">¶</a></h3>
|
||||
<p>To compile your project, DMD needs to know which directories contain the
|
||||
imported modules and the library. You also need to tell it to link with D:YAML.
|
||||
The import directory should be the D:YAML package directory. You can specify it
|
||||
using the <tt class="docutils literal"><span class="pre">-I</span></tt> option of DMD. The library directory should point to the
|
||||
compiled library. On Unix/Linux you can specify it using the <tt class="docutils literal"><span class="pre">-L-L</span></tt> option,
|
||||
and link with D:YAML using the <tt class="docutils literal"><span class="pre">-L-l</span></tt> option. On Windows, the import directory
|
||||
is used as the library directory. To link with the library on Windows, just add
|
||||
the path to it relative to the current directory.</p>
|
||||
The import directory should be the <tt class="docutils literal"><span class="pre">source</span></tt> subdirectory of the D:YAML
|
||||
directory. You can specify it using the <tt class="docutils literal"><span class="pre">-I</span></tt> option of DMD. The library
|
||||
directory should point to the compiled library. On Unix/Linux you can specify
|
||||
it using the <tt class="docutils literal"><span class="pre">-L-L</span></tt> option, and link with D:YAML using the <tt class="docutils literal"><span class="pre">-L-l</span></tt> option.
|
||||
On Windows, the import directory is used as the library directory. To link with
|
||||
the library on Windows, just add the path to it relative to the current
|
||||
directory.</p>
|
||||
<p>For example, if you extracted and compiled D:YAML in <tt class="docutils literal"><span class="pre">/home/xxx/dyaml</span></tt>, your
|
||||
project is in <tt class="docutils literal"><span class="pre">/home/xxx/dyaml-project</span></tt>, and you are currently in that
|
||||
directory, compile the project with the following command on Unix/Linux:</p>
|
||||
<div class="highlight-python"><pre>dmd -I../dyaml -L-L../dyaml -L-ldyaml main.d</pre>
|
||||
<div class="highlight-python"><pre>dmd -I../dyaml/source -L-L../dyaml -L-ldyaml main.d</pre>
|
||||
</div>
|
||||
<p>And the following on Windows:</p>
|
||||
<div class="highlight-python"><pre>dmd -I../dyaml ../dyaml/libdyaml.lib main.d</pre>
|
||||
<div class="highlight-python"><pre>dmd -I../dyaml/source ../dyaml/libdyaml.lib main.d</pre>
|
||||
</div>
|
||||
<p>This will produce an executable called <tt class="docutils literal"><span class="pre">main</span></tt> or <tt class="docutils literal"><span class="pre">main.exe</span></tt> in your
|
||||
directory. When you run it, it should produce the following output:</p>
|
||||
|
@ -231,13 +235,13 @@ example in the <tt class="docutils literal"><span class="pre">example/getting_st
|
|||
<li class="right" >
|
||||
<a href="../index.html" title="Welcome to D:YAML documentation!"
|
||||
>previous</a> |</li>
|
||||
<li><a href="../index.html">D:YAML v0.4 documentation</a> »</li>
|
||||
<li><a href="../index.html">D:YAML 0.4 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
||||
Last updated on Jan 23, 2012.
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
||||
Last updated on Dec 17, 2013.
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue