Skip to content

Add examples on generated pages #1467

Description

@zvr

As per spdx/spdx-3-model#1422, examples for various classes (and other entities) are placed in a directory named examples with structure paralleling the one in model.

When the specification is generated, these examples should be included in the web pages.

This means that something like the following should run:

#!/usr/bin/env bash

find docs -type f -name '*.md' | while read -r f; do
    grep -q '^<!-- EXAMPLE -->$' "$f" || continue

    ex="examples/${f#docs/}"

    [ -f "$ex" ] || {
        echo "Missing example file: $ex" >&2
        continue
    }

    sed -i \
        -e "/^<!-- EXAMPLE -->$/{
            i\\
## Example
            r $ex
            d
        }" \
        "$f"
done

It would be great if these commands were not put in the current workflow mechanism, but be present as stand-alone script. as discussed in spdx/infrastructure#1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciDev workflow and repo managementpublishing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions