HL7 / ig-template-base

Base IG template managed by HL7 but usable by anyone (no logos). The foundation for most HL7-published IGs
14 stars 27 forks source link

fix hide so works on all tabs not just the content tab #95

Closed Healthedata1 closed 4 years ago

Healthedata1 commented 4 years ago

Untitled 3

lmckenzi commented 4 years ago

Why can't we keep using page.path? If someone decides to override the algorithm for what filenames are called, failing to use page.path will break stuff...

Healthedata1 commented 4 years ago

I thought the site.data.pages was generated from type and id not the file name? lemme double check first before I update it.

lmckenzi commented 4 years ago

It is - but that's configurable. And if someone changes the configuration, that won't be reflected here.

Healthedata1 commented 4 years ago

I know the change is easy to make but I am just trying to understand the potential problem. I don't see how you can do what you say. The IG resource doesn't allow you to name the file anything you want an the ig-pub won't find it if you do. Can you describe to me how it is possible in a little more detail like what configuration exactly? The {{[type]}}-{{id]}} pattern seems to be baked into the java code and a change like that would mess up many things this since we use the pattern {{[type]}}-{{id]}} all over the place.

Healthedata1 commented 4 years ago

OK I think I get it you can recconfigure what they are called in config.json. but if that is the case then using the page.path won't work eithe since:

{% assign basepath = page.path | replace: '-mappings (or -definitions, or whatever ).html', '.html' %} won't work either.

The side effect is that the empty examples tab will be exposed instead of hidden.

lmckenzi commented 4 years ago

That bit should work so long as they allow the extensions and end with .html. Agree that if they change more than that, the templates won't work at all. I'm just suggesting we should allow what flexibility we can.

Healthedata1 commented 4 years ago

I don't see how to do this outside of string literals for the existing layouts. e.g. in pseudo code

to get basepath...

split page path by "-" if the last element in the array in ['mappings', 'definitions', profile.xml, profile.json, profile.ttl] then pop and join with '-' and append the '.html'

so this depends solely on the configuration too and doesn't buy us anything... is there another way?

Healthedata1 commented 4 years ago

where are we with this- I disagree with your suggestion and think my way is simpler and better. It works for the base and if the config change then everything changes any way. So I don't see the issue.

Healthedata1 commented 4 years ago

and right is inconsistent with examples tabs dissappearing and reappearing depending on which tab you click.

lmckenzi commented 4 years ago

I guess if it creates problems for others, we can always fix it later.