© Amsterdam UMC, 2024
This CLI tool converts LinkML models into HTML and PDF forms. It does not check for model validity and thus might crash or show errors when used with an invalid model. Use the official LinkML tools to check whether your model is valid.
This tool was built as part of a larger project by a programmer who is not part of the LinkML development team. Therefore, errors in the interpretation of slots of the modelling language are possible.
Under the hood, this tool uses the python adaptation of PDFKIT. It requires wkhtmltopdf to be installed on your system.
Installation steps:
- Install and add wkhtmltopdf to path
- Download here
- Add the /bin to the path variable in your system's environment variables
pip install linkmlformbuilder
- Make sure the working directory contains the pyproject.toml file
pip install build
python -m build
- Install the .whl file in the dist folder using
pip install
Without additional arguments, the command linkmlformbuilder [yamlfile]
with [yamlfile]
being an absolute or relative path to the LinkML yaml resource you want converted, processes the provided LinkML model and creates two files:
- An HTML file containing code for PDFKIT to use. This HTML file can be viewed, but will look different than the PDF file. This is due to a missing css file that is added during the PDF conversion
- A PDF form based on the provided LinkML model
usage: linkmlformbuilder [-h] [-html] [-dir [OUTPUT_DIRECTORY]] [--name [NAME]]
yamlfile
positional arguments:
yamlfile The LinkML yaml file for which a form should be built
optional arguments:
-h, --help show this help message and exit
-html, --html_only This flag is used when the user only wants an HTML
file returned, there will be no PDF export
-dir [OUTPUT_DIRECTORY], --output_directory [OUTPUT_DIRECTORY]
Specify an output directory, the current working
directory is used when this value not provided or the
flag is missing
--name [NAME] Specify an alternative file name, do not specify a
file extension. By default, the filename of the
yamlfile is used for the HTML and optionally PDF files
- UI update for html-only forms
- Add value fields to radio buttons so they show up in FormData
- Fix issue with inline attributes and slots without a name field
- Add name fields to input and textareas
- Missing 'name' field error is now a warning
- Default options for missing 'name' fields
- Throw error when field 'name' is missing from a model element
- Auto close file on error (with statement)
- Apply cardinality to slots
- Overwrite existing output file(s) instead of throwing fileExists errors
- Capitalize visible names, values, and descriptions
- Remove spaces in ids and enum names
- Improve support for inlined enums
- Add support for dynamic enums
- Fix entry point
- Initial commit