Theme is copied from Daml Docs theme.
-
Open a terminal window.
-
Install
pyenvfor Python version management withbrew install pyenv. -
Install
pipenvfor virtual environment management withbrew install pipenv. -
Navigate to the root folder of the repository.
-
Run
pipenv installto create a virtual environment and download the required packages.
Ruby must be installed on your machine (brew install ruby).
Node and yarn must be installed on your machine.
The ruby version of sass must be installed: gem install sass.
If grunt is not already installed: npm install -g grunt-cli.
If you had to install anything new above, but it still does not work, you may have to recreate the
virtual environment: run pipenv install again in the root folder of the repository.
-
Navigate to the root folder of the repository.
-
make build-allto build the Daml Financedars. -
pipenv shellto enter the virtual environment. -
make doc-htmlto build the HTML documentation.
-
Navigate to the root folder of the repository.
-
Start a local web server on
http://localhost:8000/by running./docs/scripts/preview.sh. In case an old/cached html document is being shown, make sure to refresh your web browser.
Note - The table of contents (the menu on the left of the UI) will show more drop down links than
what it'll show on docs.daml.com (i.e., it is displaying anchor links). When making modifications
to the table of contents, ensure to test these changes as part of docs.daml.com repo's build.
It is useful to do the two parts above in two separate terminal windows. That way, you only have to
re-run make doc-html in the first terminal every time you want to see your changes in the
browser. The second terminal window can keep running the web server, which will automatically serve
the updated document.
Unfortunately, if you rename an .rst file it seems make doc-html does not pick this up. It will
still build the document structure using old file names / content. In order to solve this, first
run make doc-clean and then make doc-html again.
The same goes for changes to the documentation menu in index.rst. If you change the
structure (e.g. introducing sub-sections) or rename a heading (e.g. Tutorial -> Tutorials)
make doc-html does not pick this up. First run make doc-clean and then make doc-html again.
The website is currently hosted on Github pages.
In order to update it, you need to
- build the docs from the desired branch as outlined above
- copy the content of
docs/build/htmlto a temporary foldertemp - switch to the
github-pagesbranch - delete the content of the
docsfolder, except for the.nojekyllfile (e.g. go to the docs folder and runfind . ! -name .nojekyll -delete) - copy the content of
tempintodocs(notice the difference in folder structure: in themainbranch the html files are located indocs/build/html, but in thegithub-pagesbranch the html files must be indocs) - commit and push to remote (wait a minute or so before reloading the Github pages
In order to publish to the main documentation website at docs.daml.com, we need to execute the following steps:
- Update the
versionin daml.yaml. Merge this new version into main. - Create a branch beginning with
assemblyorAssembly. This must be an empty branch without any commits in it. Otherwise, the assembly tag will be incorrect. You can create a remote branch in the GitHub GUI. - Log into CircleCi and navigate to the Daml-Finance pipeline.
- Navigate to the branch that you created in step 2 with the CircleCi workflow
assembly. - Once CircleCI has successfully built both
buildanddocssteps, an approval step namedholdwill be enabled - select the step and pressApprove. - The next step named
assemblywill start processing. This step:- Runs the script
docs/scripts/build-assembly.shwhich:- Takes the documentation source at
docs/source, the build output atdocs/build/daml-finance-rstand thesrcdirectory and places them into a folder atdocs/.assemblywith the expected directory structure. - Updates the directory paths.
- Takes the documentation source at
- Creates a tarball file.
- Uploads this tarball to Artifactory (Note - if the target Daml SDK version already exists for Daml-Finance, this step will fail with a 403 http error code).
- Runs the script
- In the docs.daml.com repo, follow the
instructions here
to update the
daml-financeversion.
Note - the "Getting Started" code sample here is part of the
daml assembly build. The code samples in the daml repo are located
here in the daml
repo. As such, the build process of the docs.daml.com updates the references contained in the
various RST files of Daml-Finance that references these templates.