Difference between revisions of "Dlang org development"

From D Wiki
Jump to: navigation, search
(Created page with "This page explains commonly used commands that are used while working with the <tt>[https://dlang.org dlang.org]</tt> repository which among many other things is used to build...")
 
(Replaced content with "Please see Dlang.org development")
 
Line 1: Line 1:
This page explains commonly used commands that are used while working with the <tt>[https://dlang.org dlang.org]</tt> repository which among many other things is used to build the language specification and library documentation of the D programming language.
+
Please see [[Contributing_to_dlang.org | Dlang.org development]]
 
 
You can also check [https://github.com/dlang/dlang.org/blob/master/CONTRIBUTING.md the dlang.org contribution guide] for build instructions.
 
 
 
= Fetch <tt>dlang.org</tt> =
 
 
 
Changes to <tt>phobos</tt> documentation require that the site (which includes automatically generated <tt>phobos</tt> documentation) builds successfully. Alternatively to building the documentation locally, you can use the documentation autotester service, which will build documentation, generate a diff of the results, and add a link to your GitHub pull request.
 
 
 
The following will clone the <tt>dlang.org</tt> repository:
 
 
 
<syntaxhighlight lang=bash>
 
cd ~/dlang
 
git clone https://github.com/dlang/dlang.org
 
cd dlang.org
 
</syntaxhighlight>
 
 
 
Furthermore, all of <tt>dmd</tt>, <tt>druntime</tt>, <tt>phobos</tt>, <tt>tools</tt> are needed for the site to build.
 
The instructions below will build the site to <tt>~/dlang/dlang.org/web</tt>.
 
 
 
= Build new Phobos documentation  =
 
 
 
If you are just interested in previewing your change to Phobos documentation, the <tt>html</tt> and <tt>phobos-prerelease</tt> will save time:
 
 
 
<syntaxhighlight lang=bash>
 
make -f posix.mak html phobos-prerelease
 
</syntaxhighlight>
 
 
 
Of course, parallelizing with <tt>-j</tt> improves speed as well.
 
 
 
To informally test it, open the appropriate HTML documents in that directory. Note that the currently released phobos would be in <tt>~/dlang/dlang.org/web/phobos</tt>, whereas the current (fresh) build of phobos's documentation will reside in  <tt>~/dlang/dlang.org/web/phobos-prerelease</tt>.
 
So, for example, if you change the embedded documentation in <tt>~/dlang/phobos/std/conv.d</tt>, the changes are visible in  <tt>~/dlang/dlang.org/web/phobos-prerelease/std_conv.html</tt>. (The build process replaces the slashes in submodules with underscores.)
 
 
 
= Avoiding network traffic =
 
 
 
Note that one of the first lines output during the <tt>make</tt> run looks like this:
 
 
 
<tt>LATEST={{Latest DMD Version Raw}}  <-- place in the command line to skip network traffic.</tt>
 
 
 
That's advice worth heeding because fetching <tt>LATEST</tt> automatically involves network traffic, which adds time to the build. So for future builds use this:
 
 
 
make -f posix.mak LATEST={{Latest DMD Version Raw}} html phobos-prerelease
 
 
 
= Full build =
 
 
 
Note that the full build all of the documentation in all forms, including Kindle builds and various other things that may require installing additional tools, and may download/build old versions of DMD.  This may take some time and can be run with:
 
 
 
make -f posix.mak
 
 
 
Or if you want to avoid network traffic:
 
 
 
make -f posix.mak LATEST={{Latest DMD Version Raw}}
 

Latest revision as of 21:38, 11 December 2017