openshift-evangelists / workshopper

Workshop content rendering tool
63 stars 41 forks source link

linking to other modules does not appear to work #41

Closed thoraxe closed 6 years ago

thoraxe commented 7 years ago

Given a module definition:

modules:
  environment:
    name: Environment Overview
    vars:
      MASTERS:
      INFRA:
      NODES:
      NFS_ENABLED:
      LOGGING_ENABLED:
      ETHERPAD_ENABLED:
      NUM_USERS:
      ETHERPAD_URL_PREFIX:
  installation:
    name: Installation and Verification
  cns-deploy:
    name: Deploying Container Native Storage
    requires:
      - installation
    vars:
      NODE_BRICK_DEVICE: "/dev/xvdd"
      CNS_NAMESPACE: "container-native-storage"
      HEKETI_ADMIN_PW: "myS3cr3tpassw0rd"
      HEKETI_ADMIN_PW_BASE64: "bXlTM2NyM3RwYXNzdzByZA=="
      HEKETI_USER_PW: "mys3rs3cr3tpassw0rd"
      CNS_STORAGECLASS: "cns-gold"

The following asciidoc generates a link, but the resulting URL does not work:

This PVC has been automatically fulfilled by CNS because the `cns-gold` *StorageClass*
was set up as the system-wide default in lab module link:cns-deploy["Deploying
Container-native Storage"]

The URL should be: /#/workshop/ocp-admin-testdrive/module/cns-deploy

But it ends up being: /cns-deploy

Is there a special syntax for linking directly to a module? Or is this a bug with a hyphenated module name?

marekjelen commented 7 years ago

Yes, that is a bit more problematic then it looks like, but have added two tool to help with this on the ruby branch.

Two new functions, you can use in the template

with this in place, you can do something like

link:{% module_path cns-deploy %}[{% module_name cns-deploy %}]

it's a bit more verbose, but helps with abstracting the implementation detail from the content repository.

marekjelen commented 6 years ago

Can we close this one?

marekjelen commented 6 years ago

@thoraxe ?