a question about section reference

30 views
Skip to first unread message

HaveF HaveF

unread,
Aug 7, 2023, 9:37:04 PM8/7/23
to leo-editor

Hi, there,

How are you today?

There is a question about section reference.

I find section reference useful when organizing profiles, as it logically divides profiles into sections.

But in some cases I find it a bit troublesome. For example, I want to generate the following configuration file:

title_1:
  title: title_1
  display:
    mark:
      type: bar
    color: red

title_2:
  title: title_2
  display:
    mark:
      type: bar
    color: red

I have to change the following as << display section >>

display:
    mark:
      type: bar
    color: red

It would be great, if there is a section reference like << title section >> {title_name='title_1'}

$$title_name:
  title: $$title_name
  display:
    mark:
      type: bar
    color: red

Do you have any solutions to this problem?

Thanks!

Best regards,

HaveF

Edward K. Ream

unread,
Aug 8, 2023, 7:30:39 AM8/8/23
to leo-e...@googlegroups.com
On Mon, Aug 7, 2023 at 8:39 PM HaveF HaveF <iamap...@gmail.com> wrote:

> I find section reference useful when organizing profiles, as it logically divides profiles into section
> But in some cases I find it a bit troublesome.

There have been several proposals to generalize Leo's section references.

However Leo's section-handling code must stay as is. Changes could break Leo's file-read code.

The workarounds include writing scripts to generate references.

Edward

HaveF HaveF

unread,
Aug 8, 2023, 7:52:15 AM8/8/23
to leo-editor
 
The workarounds include writing scripts to generate references.

Thanks, Edward.

Can you give me a general idea about the scripts?

Edward K. Ream

unread,
Aug 8, 2023, 8:07:49 AM8/8/23
to leo-e...@googlegroups.com
On Tue, Aug 8, 2023 at 6:54 AM HaveF HaveF <iamap...@gmail.com> wrote:

> Can you give me a general idea about the scripts?

The script could create or update an @file tree, creating section references from some input data.

I would write such a script only if it saved lots of work. Otoh, writing such scripts can be fun :-)

Edward

HaveF HaveF

unread,
Aug 8, 2023, 8:17:47 AM8/8/23
to leo-e...@googlegroups.com

The script could create or update an @file tree, creating section references from some input data.
I see. Thanks! Edward 


Reply all
Reply to author
Forward
0 new messages