mono / api-doc-tools

.NET Reference API Toolchain
MIT License
68 stars 48 forks source link
documentation-toolchain dotnet ecmaxml mdoc mono monodoc

mdoc

This repository contains the source for the .NET API Reference toolchain (used by learn.microsoft.com)

Contribution Guide

You can read the contribution guide for information about coding standards, and (perhaps most importantly), information about writing unit and integration tests.

Compiling

Dependencies

This repository uses submodules, so firstly, you have several options:

Visual Studio

On windows, you can build and compile apidoctools.sln. And you can run unit tests if you have NUnit installed. If you use Visual Studio for Mac, you can use its built-in support for NUnit tests to also run tests.

CLI

If you've got make and mono installed, you can run make prepare all check in a bash prompt to do a release build and run the full test suite (which for mdoc includes more than just the nunit tests). The available targets are:

You can also control some parameters from the command line:

If you want to compile in debug mode: make all CONFIGURATION=Debug

If you are using WSL, use: make all ENVIRONMENT=wsl

Feel free to open a pull request early in order to make it easy to ask questions during development, and for the maintainers to offer feedback.

Troubleshooting

Forcing Changes

When you make certain kinds of changes, it can confuse Make's dependency ... if you're running the test suite and it doesn't seem to be reflecting your changes, add the -B parameter to the make invocation, and it will force a rebuild of all targets.

WSL

Make sure you are at least on 16.04 (Xenial). You can check which version is currently installed by running the command lsb_release -a.

If you are running an older version (for example, if you originally installed WSL before the creator's update) and need to upgrade, you can run the following commands:

With that run ... you should be able to run the build locally using make prepare all check.

Linux

The following script will prepare, clone, and run a full build with tests of mdoc on an unbuntu docker container.

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF  
echo "deb http://download.mono-project.com/repo/ubuntu trusty main" | tee /etc/apt/sources.list.d/mono-official.list

apt-get update
apt-get install tzdata nuget -y --allow-unauthenticated
apt-get install git make mono-devel mono-vbnc ca-certificates-mono wget fsharp -y

wget -q 'http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1' -O "/tmp/certdata.txt" 
mozroots --import --ask-remove --file /tmp/certdata.txt

git clone https://github.com/mono/api-doc-tools
cd api-doc-tools
make prepare all check

Please review mono's installation guide if you are using a different flavor of linux.

How to debug

How to debug mdoc