Skip to content
You are reading v0.8.0. Read the latest stable guide

Your first PDF ​

Follow installation first. This guide targets Doc42 0.8.0. It uses one small model and produces out/FIRST-001.pdf.

1. Get the example and its library ​

Download or clone the release repository at the matching release tag.

sh
git clone --branch v0.8.0 https://github.com/elan8/doc42-release
cd doc42-release
git clone https://github.com/elan8/sysml-domain-libraries
git -C sysml-domain-libraries checkout 4c73195b2f64176696b2e0f4d72606bfd044dcef

The example contains two prose sections. Its document vocabulary comes from the pinned domain library. Use the same library revision in your editor.

sysml
package FirstDocument {
    private import Elan8::Documents::*;
    view overview {
        @Document {
            title = "My first engineering document";
            number = "FIRST-001";
            revision = "A";
            status = "Sample draft";
            template = "elan8-standard";
        }
        view purpose {
            @Section { title = "Purpose"; }
            doc /* This PDF was generated from a SysML v2 document view. */
        }
        view nextSteps {
            @Section { title = "Next steps"; }
            doc /* Replace this prose with your project content, then add model-backed tables and diagrams. */
        }
    }
}

2. List and check the document ​

The following commands work in PowerShell and Linux shells and need no account:

sh
doc42 list examples/first-document --library-path sysml-domain-libraries/model
doc42 check examples/first-document --library-path sysml-domain-libraries/model

list identifies FirstDocument::overview. check should report no errors.

3. Connect your account ​

Create an Elan8 account, verify your email, and activate eligible trial or paid access. Create an API token in your account, then run:

sh
doc42 login
doc42 license

Paste the token at the hidden prompt. Do not put it in a command argument or commit it. Authentication explains caching, refresh and offline use.

4. Build the PDF ​

sh
doc42 build examples/first-document --library-path sysml-domain-libraries/model --out out

Open out/FIRST-001.pdf. Change the prose and run the build again to see the update. The same inputs and Doc42 version produce identical PDF bytes.

Next, try document-suite for requirement tables and multiple documents, or learn how to author your own views.

Models and documents stay local. License retrieval and refresh require online access.