• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Preventing line breaks in code blocks in unstructured FM

New Here ,
Aug 08, 2023 Aug 08, 2023

Copy link to clipboard

Copied

The command line code example below needs to span 2 lines to fit the page but the line originally does not break and should not break. It needs to be one single command line. The document is not structured so we do not use elements. The code example is simply contained in a table cell. Is there a way to force or prevent the command line string from breaking as the customer often cuts/pastes the code into their editor and has to edit it manually? Do i need to use Elements or can i do it in an unstructured way?

code e.g 

# modprobe moal_5x17283_pcie_8997 drv_mode=1 cal_data_cfg=none cfg80211_wext=0xf fw_name=nxp/pcieuart8997_combo_v4_5x17283.bin

Views

178

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 08, 2023 Aug 08, 2023

Copy link to clipboard

Copied

... might be possible in 4-dimensional world.

Seeriously: Make a note that the line must not be broken on input to the command processor. 

I have also seen (e.g. in computer Magazins) the use of a special symbol at the end of the first line to indicate that the next line is a continuation and not an own line:

This is is the first part of a long code line ∆
Which is continued here
This an independent code line
And also this one is one of its own 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2023 Aug 09, 2023

Copy link to clipboard

Copied

How does it behave if you use non-breaking spaces? (just asking - never needed to think about something like that before)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2023 Aug 09, 2023

Copy link to clipboard

Copied

You could use a left indent after the first line to indicate that line breaks there are not to be added to the code.

 

image.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2023 Aug 09, 2023

Copy link to clipboard

Copied

When you replace all spaces with non-breaking spaces, then FrameMaker will break the line after a character which is in the Text Options dialog. Or just at the end of the line, no matter which character.

You might reduce the font size. And/or adjust the spread or stretch in the Paragraph Designer in the Font tab.

When there are spaces in your code, then I would break there. I would assume that all developers will know that there is a space.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2023 Aug 09, 2023

Copy link to clipboard

Copied

LATEST

Good advice thanks. Most end users are technicains and they do know that and just go in and remove the line break by hand. I have thought of simply adding a disclaimer to the effect that cut/pasting long lines of code (than need to span 2 lines in FM to fit the page) direclty from a PDF may add unwanted line breaks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines