DeepBlueCLtd / LegacyMan

Legacy content for Field Service Manual
https://deepbluecltd.github.io/LegacyMan/index.html
Apache License 2.0
2 stars 0 forks source link

Don't import divs that aren't visible. #587

Closed IanMayo closed 8 months ago

IanMayo commented 9 months ago

I'm using some custom blocks of content to give some descriptions for the major blocks on the home page. This comes from document content: image

But, these blocks of content should not be parsed into the page itself. So, if a div has a style that includes visibility: hidden we should skip it.

When this is successfully implemented, the contents page should not include the List of supporting documents: image

robintw commented 9 months ago

I've implemented this for any divs that are processed normally, but divs with an id of short-description are processed separately (their text content is added to the <shortdesc> tag in DITA). Do you want this to apply to those too, or is it just a coincidence that the hidden style is attached to a short-description div?

IanMayo commented 9 months ago

Hello Robin, yes - this relates to the <short-description> tags. I'd like us to process the contents and create <shortdesc> entries, but not create content blocks when these are hidden.

I'd don't need the short-description content to be viewed on the page itself, it is just of value when summarising the page in the Oxygen template: image

robintw commented 9 months ago

I think this needs to be solved another way then. The only place this content appears in the resulting DITA file is in the <shortdesc> tag and we're not converting it to a standard content bloc - so I think the publishing process is taking the shortdesc tag and including it in the page.

The <shortdesc> tag seems to be translated in the publishing process to:

<p class="shortdesc">List of supporting documents</p>

Can this be changed somehow in the transformations that are applied during publishing?

IanMayo commented 9 months ago

Sorry - my misunderstanding. Assigning it to me :-)

We can probably sort it by hiding the content in CSS

robintw commented 9 months ago

I think I should still submit my PR that excludes all hidden divs from conversion, as that'll probably be useful in other ways. Just not the specific stuff for the short-description tags. I'll create a PR in a moment.

IanMayo commented 8 months ago

Done.