anz-bank / sysl-catalog

sysl-catalog (no, not catalogue): A static site generator for web service documentation
https://demo.sysl.io/
Apache License 2.0
7 stars 7 forks source link

Refactor generated Redoc to reference served file #176

Closed cuminandpaprika closed 4 years ago

cuminandpaprika commented 4 years ago

Modifies Redoc to reference the specification file (and assumes it has been copied to the output directory).

This requires copying of all imported specifications into the output directory. e.g Lets say you have a root.sysl file that imports specifications inside of a folder called sysl The sysl folder needs to be copied to the output directory, so that the redoc page can reference the spec directly via /sysl/targetspec.yaml

Checklist:

ChloePlanet commented 4 years ago

e.g Lets say you have a root.sysl file that imports specifications inside of a folder called sysl The sysl folder needs to be copied to the output directory, so that the redoc page can reference the spec directly via /sysl/targetspec.yaml

Do you mean like this?

.
├── root.sysl
├── sysl
│   ├── targetspec.yaml
│   └── deps.sysl
└── output

↓ after copy files

.
├── root.sysl
├── sysl
│   ├── targetspec.yaml
│   └── deps.sysl
└── output
    ├── root.sysl
    ├── sysl
    │   ├── targetspec.yaml
    │   └── deps.sysl
    └── ...
cuminandpaprika commented 4 years ago

e.g Lets say you have a root.sysl file that imports specifications inside of a folder called sysl The sysl folder needs to be copied to the output directory, so that the redoc page can reference the spec directly via /sysl/targetspec.yaml

Do you mean like this?

.
├── root.sysl
├── sysl
│   ├── targetspec.yaml
│   └── deps.sysl
└── output

↓ after copy files

.
├── root.sysl
├── sysl
│   ├── targetspec.yaml
│   └── deps.sysl
└── output
    ├── root.sysl
    ├── sysl
    │   ├── targetspec.yaml
    │   └── deps.sysl
    └── ...

Exactly that! Great diagram :D

That's what the sysl importer needs to be able to do, it'll help us clean up a lot of the links to the source files as well, because it'll mean we can just link directly to any referenced specifications

E.g if deps.sysl was imported from a different repo, having it copied over to the output directory would solve a lot of problems, it's the approach I'm looking to go with

ChloePlanet commented 4 years ago

So your end goal is getting rid of the importing statements and vendoring all the dependencies?

cuminandpaprika commented 4 years ago

So your end goal is getting rid of the importing statements and vendoring all the dependencies?

Not at all, this is just a workaround at the moment, till we work out how to solve module imports more generally