perldoc / POD - не добавлять лишнюю строку в абзац - PullRequest
0 голосов
/ 30 ноября 2018

Я пытаюсь написать некоторую документацию по POD и использовать perldoc для ее отображения.Моя цель - сделать так, чтобы формат выглядел следующим образом:

REQUIRED ARGUMENTS
    argument1
        Description of the first argument. 

    argmuent2
        Description of the second argument.            

Где «ТРЕБУЕМЫЕ АРГУМЕНТЫ» - это жирный заголовок, а «аргумент1» и «аргумент2» выделены курсивом.

Но яне в состоянии понять, как получить этот конкретный отступ.

Я пробовал это:

=head1 REQUIRED ARGUMENTS

I<argument1>
Description of the first argument.

I<argument2>
Description of the second argument.

, который выдает следующее (жирный заголовок и курсив отображаются правильно, но запуск описаний нежелателен):

REQUIRED ARGUMENTS
    argument1 Description of the first argument.

    argument2 Description of the second argument.

И я попробовал:

=head1 REQUIRED ARGUMENTS

I<argument1>

Description of the first argument.

I<argument2>

Description of the second argument.

Что дает следующее (опять же жирный шрифт и курсив хорошие, но теперь между аргументом и описанием есть дополнительная строка):

REQUIRED ARGUMENTS
    argument1

    Description of the first argument.

    argument2

    Description of the second argument.

И среди прочего, что также не удалось, я пробовал это:

=head1 REQUIRED ARGUMENTS

I<argument1>

=over 4

Description of the first argument.

=back

со следующим результатом:

REQUIRED ARGUMENTS
    argument1

        Description of the first argument.

1 Ответ

0 голосов
/ 30 ноября 2018

Используйте элементы для аргументов:

=head1 REQUIRED ARGUMENTS

=over 4

=item I<argument1>

Description of the first argument.

=item I<argument2>

Description of the second argument.

=back

=cut
...