Menucascade

Hello,

I am having trouble getting uicontrol to be wrapped in menucascade.
I created new character tags: mc1, mc2 and alternately wrapped each word with the mc1 and mc2, with no space between the wrapped text, for example, FileImportFile

In my _m2dita.ini file, I have:

[DITACharTags]
mc*=uicontrol

[TopicParents]
mc*=menucascade

Each word is individually wrapped in uicontrol; however, the uicontrol elements are not wrapped in menucascade.

I am using the DITAconcept content model you recently helped me with.

Regards,
Stan

Menu cascade

First of all, [TopicParents] is used only in content model files, so you cannot use it in _m2dita.ini. It is ignored there. The equivalent [DITAParents] applies only to paragraph formats, not char formats.

The problem is that Frame does not nest character formats, so there is no way to have a char format that would map to DITA's menucascade. There are two alternative approaches.

1. Use two Code markers to add <menucascade> at the start of each series and </menucascade> at the end of each, per User's Guide par. 29.7.1, "Inserting marker content in output".

2. If the char format you use for these specific menu items is used only for menucascade items, you can use that fact to place the macros automatically, per User's Guide par. 28.9.3, "Surrounding or replacing text with code or macros". If for example your char format is named "MenuItem":

[HTMLCharStyles]
MenuItem = CodeBefore CodeAfter

[CharStyleCodeBefore]
MenuItem = <menucascade>

[CharStyleCodeAfter]
MenuItem = </menucascade>

You will then have to postprocess to remove all the "</menucascade><menucascade>" instances. You can't make them conditional, because there is nothing to trigger the final closing tag. That is, if you tried:

[CharStyleCodeBefore]
MenuItem = <$_if not ($$InCascade)><menucascade><$$InCascade=1><$_endif>

[CharStyleCodeAfter]
MenuItem = <$_if ($$InCascade)></menucascade><$$InCascade=0><$_endif>

[MacroVariables]
InCascade=0

you would still get the wrapper around every uicontrol element. We can logically determine the start of a series, but not the end of it. So there is no test possible for CodeAfter that will do what is needed.

The general method is described in par. 28.10, "Using macros to fine-tune HTML or XML output".

HTH!

Menu cascade

Thank you. I will implement ASAP.

BTW: That was [TopicParent] was a mistake. I did have it under
[DITAParents]
mc*=menucascade

Regards,
Stan

Stan Smith
Principal Technical Writer
iNetWriter, LLC

Signature

Could you please remove my email address from the previous comment.
Thanks,
Stan

Stan Smith
Principal Technical Writer
iNetWriter, LLC

Signature

Your email address is not in the comment. You may see it when you are entering the comment, but it is visible only to you. Drupal is pretty good at not revealing personal data unless you do so explicitly.